Understanding the Error Response🔗
Let us take an example where a payment failed because the customer entered a wrong OTP while making a payment using card on the Checkout.
Copy{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "Authentication failed due to incorrect otp",
"field": null,
"source": "customer",
"step": "payment_authentication",
"reason": "invalid_otp",
"metadata": {
"payment_id": "pay_EDNBKIP31Y4jl8",
"order_id": "order_DBJKIP31Y4jl8"
}
}
}
Looking at the source
, step
and reason
provided in the error description, you can understand that the payment failed at the authentication step due to the incorrect OTP entered by the customer. An elegant way to handle this error would be to notify your customer and bring them back to the checkout window and ask them to retry the payment with the correct OTP.