EBT sample requests are described below. For more information please check our sample app.
Once the card has been swiped, onRequestPin callback will be triggered whenever the device asks for PIN with the following enum types, which can be used to display dialog with edit text field (to display * whenever the pin character was added).
/** * Display prompt */ PIN_STARTED, /** * Pin character was added */ CHARACTER_ADDED, /** * Pin character was removed */ CHARACTER_REMOVED, /** * Dismiss prompt */ PIN_FINISHED;
CoreSaleEbt ebt = new CoreSaleEbt(amount);
ebt.setCardAccount(CardAccount.CASH);
ebt.setOperator("operator");
ebt.setDeviceId("1234567");
ebt.setSaleRequestType(SaleRequestType.PURCHASE);
AndroidTerminal.getInstance().processSale(ebt);
AndroidTerminal.getInstance().submitCardNumber(cardNum);
AndroidTerminal.getInstance().submitExpiryDate(expiryDate);
onRequestPin callback will be triggered whenever the device asks for PIN with the following enum types, which can be used to display dialog with edittext (to display * whenever the pin character was added).
/** * Display prompt */ PIN_STARTED, /** * Pin character was added */ CHARACTER_ADDED, /** * Pin character was removed */ CHARACTER_REMOVED, /** * Dismiss prompt */ PIN_FINISHED;
CoreSaleEbt ebt = new CoreSaleEbt(amount);
ebt.setCardAccount(CardAccount.CASH);
ebt.setOperator("operator");
ebt.setDeviceId("1234567");
ebt.setSaleRequestType(SaleRequestType.PURCHASE);
AndroidTerminal.getInstance().processSale(ebt);
Cashback field:
ebt.setCashBackAmount(BigDecimal.ONE);
be set to FOOD_STAMP:
coreSale.setCardAccount(CardAccount.FOOD_STAMP);
coreSale.setCardAccount(CardAccount.CASH);
coreSale.setSaleRequestType(SaleRequestType.CASH_WITHDRAWAL);
CoreVoucher voucher = new CoreVoucher();
voucher.setCardAccount(CardAccount.FOOD_STAMP);
voucher.setVoucherApprovalCode("123456");
voucher.setVoucherNumber("123456789012345");
voucher.setCardNumber("6007602801003837968");
((CoreSaleEbt) coreSale).setVoucher(voucher);
coreSale.setSaleRequestType(SaleRequestType.PURCHASE);
AndroidTerminal.getInstance().processSale(coreSale);
Refund Unreferenced
Swipe/ Keyed
CoreUnreferencedRefundEbt ebt = new
CoreUnreferencedRefundEbt(amount));
ebt.setCardAccount(CardAccount.FOOD_STAMP);
ebt.setReason("reason");
ebt.setOperator("android-operator");
ebt.setDeviceId("12345678");
AndroidTerminal.getInstance().processUnreferencedRefund(ebt);
Once the pin gets confirmed the transaction gets processed and the transaction
response will be returned in onRefundResponse callback method.
Voucher
CoreUnreferencedRefundEbt ebt = new
CoreUnreferencedRefundEbt(amount));
ebt.setOperator("android-operator");
ebt.setDeviceId("12345678");
CoreVoucher voucher = new CoreVoucher();
voucher.setCardAccount(CardAccount.FOOD_STAMP);
voucher.setCardNumber("6007602801003837968");
voucher.setVoucherApprovalCode("123456");
voucher.setVoucherNumber("123456789012345");
ebt.setVoucher(voucher);
ebt.setReason("reason");
AndroidTerminal.getInstance().processUnreferencedRefund(ebt);
This is usually used during the transaction if something goes wrong. Only applies to transactions which are not settled yet. The uniqueRef from the previous transaction is required. The transaction response will be returned in onReversalRetrieved callback method.
CoreReversalEbt
CoreReversalEbt reversal = new
CoreReversalEbt("PAX_A920_ATTENDED",
transaction.getUniqueRef(), "reason");
reversal.setDeviceId("PAX_A920_ATTENDED");
reversal.setOperator("android_operator");
AndroidTerminal.getInstance().processReversal(reversal);
CoreRefund
CoreRefund refund = new CoreRefund(transaction.getAmount());
refund.setUniqueRef(transaction.getUniqueRef());
refund.setReason("reason");
AndroidTerminal.getInstance().processRefund(refund);
Balance Inquiry
Swipe/ Keyed
CoreBalanceInquiryEbt ebt = new CoreBalanceInquiryEbt();
ebt.setCardAccount(CardAccount.FOOD_STAMP);
ebt.setOperator("android-operator");
ebt.setDeviceId("12345678");
AndroidTerminal.getInstance().processBalanceInquiry(ebt);
Reporting request requires settlementDate, criterionType and criterionValue fields to be set. criterionType can be set to OPERATOR with the value of operator field being used in sale requests or DEVICE_ID with the value of deviceId field being used in sale requests.
settlementDate needs to be in the following format dd-MM-yyyy
AndroidTerminal.getInstance().getTransactionReports("25-11-2
019", "OPERATOR", "android-operator");
The reporting response will be returned in onTransactionReportRetrieved callback method.
To enable SP30 device, set externalPinpad flag to true during the device initialization.
if the device is not plugged in, the SDK will return
EXTERNAL_PINPAD_NOT_DETECTED error.
HashMap data = new HashMap<>();
data.put("externalPinpad", true);
AndroidTerminal.getInstance().initDevice(DeviceEnum.PAX,
DeviceConnectionType.AIDL, null, data);