Integrate our products into your software. Let's make payment happen together!
Look at all the possibilitiesIt is possible to allow or deny a card brands while during a payment. In this guide we will show you how to allow only a certain list of card brands.
The following code snippet demonstrates how you can allow certain card brands during a payment.
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
}
};
List cardCircuits = new ArrayList<>();
cardCircuits.add(CardCircuit.ECMC)
cardCircuits.add(CardCircuit.MAES)
// OPI-NL terminals
CardCircuitCollectionRequest cardCircuitCollectionRequest = CardCircuitCollectionRequest.builder().cardCircuits(cardCircuits).build();
// OPI-NL terminal untyped card circuit collection (typed has higher order but both can be used if type is new and not supported yet)
CardCircuitCollectionRequest cardCircuitCollectionRequest = CardCircuitCollectionRequest.builder().cardCircuitCollection(List.of("ECMC", "MAES")).build();
// OPI-DE terminals
CardCircuitCollectionRequest cardCircuitCollectionRequest = CardCircuitCollectionRequest.builder().cardCircuits(cardCircuits).cardCircuitState(CardCircuitStateType.ACCEPTED).build();
Payment payment = Payment
.builder()
.type(Payment.Type.SALE)
.amount(new Money(amount, Currency.getInstance("EUR")))
.cardCircuitCollectionRequest(cardCircuitCollectionRequest)
.build();
paymentService.payment(terminal, payment, delegate);
The following code snippet demonstrates how you can deny certain card brands during a payment.
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
}
};
List cardCircuits = new ArrayList<>();
cardCircuits.add(CardCircuit.ECMC)
cardCircuits.add(CardCircuit.MAES)
// OPI-DE terminals only
CardCircuitCollectionRequest cardCircuitCollectionRequest = CardCircuitCollectionRequest.builder().cardCircuits(cardCircuits).cardCircuitState(CardCircuitStateType.DENIED).build();
Payment payment = Payment
.builder()
.type(Payment.Type.SALE)
.amount(new Money(amount, Currency.getInstance("EUR")))
.cardCircuitCollectionRequest(cardCircuitCollectionRequest)
.build();
paymentService.payment(terminal, payment, delegate);