Integrate our products into your software. Let's make payment happen together!
Look at all the possibilitiesIn the C-TAP protocol it is allowed to cancel a previously performed transaction. This is done by a Cancellation transaction.
A cancellation is only possible if the card brand allows (in general only credit cards) this, and the terminal supports this transaction due to proper contracts.
Cancellation is possible for Sale transactions, Cash Advance transactions, Reservation transactions and Sale after Reservation transactions.
When a transaction is done by mistake, the cashier can use Cancel Last Transaction to void the last transaction.
A Cancel Last Transaction is only possible when the original transaction was successful.\
The following code snippet demonstrates how you can perform a payment reversal (cancel last).
CAUTION: Make sure that the transaction you want to cancel is the last transaction performed on the terminal.
Payment payment = Payment .builder() .type(Payment.Type.VOID) .build(); PaymentApi paymentService = new PaymentService(); PaymentDelegate paymentDelegate = new PaymentDelegate() { ... }; paymentService.payment(terminal, payment, paymentDelegate);
When a transaction is done by mistake, the cashier can use Cancel Last Transaction to void the last transaction.
A Cancel Last Transaction is only possible when the original transaction was successful.\
The following code snippet demonstrates how you can perform a payment reversal (cancel last).
CAUTION: Make sure that the transaction you want to cancel is the last transaction performed on the terminal.
Payment payment = Payment .builder() .type(Payment.Type.VOID) .build(); PaymentApi paymentService = new PaymentService(); PaymentDelegate paymentDelegate = new PaymentDelegate() { ... // During reversal an cashier input (must be shown to merchant) is required as extra confirmation @Override public void askCashierInput(CashierInput cashierInput, InputCallback inputCallback) { if (cashierInput.commandRequest().command().equals("GetConfirmation")) { inputCallback.passInput(CashierInputCallback.builder() .booleanCommand(true || false) .build()); } } ... }; paymentService.payment(terminal, payment, paymentDelegate);
The following code snippet demonstrates how you can perform a cancel any transaction for attended OPI-NL terminals.
Payment payment = Payment .builder() .type(Payment.Type.VOID) .approvalCode("123456") //ApprovalCode of the transaction you want to cancel .originalTransactionRequestType(RequestType) //RequestType of the transaction you want to Cancel .build(); PaymentApi paymentService = new PaymentService(); PaymentDelegate paymentDelegate = new PaymentDelegate() { ... }; paymentService.payment(terminal, payment, paymentDelegate);
The following code snippet demonstrates how you can perform a cancel any transaction for attended OPI-NL terminals.
Payment payment = Payment .builder() .type(Payment.Type.VOID) .approvalCode("123456") //ApprovalCode of the transaction you want to cancel .originalTransactionRequestType(RequestType) //RequestType of the transaction you want to cancel .token("123456789") //This is the token of the transaction you want to cancel .build(); PaymentApi paymentService = new PaymentService(); PaymentDelegate paymentDelegate = new PaymentDelegate() { ... }; paymentService.payment(terminal, payment, paymentDelegate);
The following code snippet demonstrates how you can perform a cancel any transaction. For the cancel any transaction you need to pass the STAN of the transaction you want to cancel, this STAN is returned on the PaymentResult via paymentResult.paymentSTAN.
Payment payment = Payment .builder() .type(Payment.Type.VOID) .transactionId(paymentSTAN) .build(); PaymentApi paymentService = new PaymentService(); PaymentDelegate paymentDelegate = new PaymentDelegate() { ... }; paymentService.payment(terminal, payment, paymentDelegate);
The following code snippet demonstrates how you can perform a cancel a transaction performed on another terminal. For the cancel a transaction that was performed on another terminal you need to pass the STAN, approvalCode, total amount and the transaction type of the original transaction. The cancellation of an external transaction is only available for the following transaction types:
Payment payment = Payment .builder() .type(Payment.Type.VOID) .transactionId(paymentSTAN) .approvalCode(approvalCode) .originalTransactionRequestType(requestType) .amount(Money.EUR(5)) .build(); PaymentApi paymentService = new PaymentService(); PaymentDelegate paymentDelegate = new PaymentDelegate() { ... }; paymentService.payment(terminal, payment, paymentDelegate);