Integrate our products into your software. Let's make payment happen together!
Look at all the possibilitiesOPI-DE terminals allow you to pass additional text to the terminal that you want to add to the receipt.
The following code snippet demonstrates how you can pass additional text to the terminal.
For OPI-DE terminals only.
createTerminal(ExternalTerminal.TerminalType.OPI_DE);
PaymentApi paymentService = new PaymentService();
PaymentDelegate paymentDelegate = new PaymentDelegate() {
@Override
public void onPaymentSuccess(PaymentResult result) {
// The payment is completed successful!
// The paymentResult contains all information about the transaction
}
@Override
public void onError(Error error) {
// The payment failed
// The Error object contains information about what went wrong
}
@Override
public void printMerchantReceiptAndSignature(PaymentReceipt receipt) {
// Code to handle the MerchantReceipt
}
@Override
public void printCustomerReceiptAndSignature(PaymentReceipt receipt) {
//Code to handle CustomerReceipt
}
};
Payment payment = Payment
.builder()
.type(Payment.Type.SALE)
.amount(new Money(amount, Currency.getInstance("EUR")))
.lastReceiptNumber("1")
.additionalReceiptTextRequestList(additionalReceiptTextRequest())
.build();
paymentService.payment(terminal, payment, delegate);
private List additionalReceiptTextRequest() {
List additionalReceiptText = new ArrayList<>();
additionalReceiptText.add("Welcome To My shop");
additionalReceiptText.add("Thank You For Coming");
List requestList = new ArrayList<>();
requestList.add(new AdditionalReceiptTextRequest(ReceiptDeviceTarget.PRINTER, additionalReceiptText));
return requestList;
}