If you want to block or prevent particular payment methods from being used to complete a payment, you can explicitly disable them when creating payment sessions.
When creating a payment session via the paymentSessionCreate endpoint, you can specify the settings.paymentMethodOptions field as shown below.
Disable Payment Methods - Payload Example
{
"amount": 54550,
"currency": "GBP",
"customerEmail": "test@mail.com",
"settings": {
"paymentMethodOptions": {
"disabled": ["Amex"]
}
}
}The Payment Session created above will ensure that Amex payments are disabled when processing the payment. If the customer attempts to pay with Amex, the payment session will be marked as failed.
This feature is not enabled by default. Please contact support if you want to make use of them.
- To process a payment with specific payment methods disabled, you can follow the steps outlined in the Initial Setup guide. No special SDK configuration is required.
- Additionally, have a look at the error codes on this page to handle scenarios where a customer attempts to use a disabled payment method.