Cannot handle Stripe API's legitimate card declined response
Posted: Mon Jun 18, 2018 2:57 pm
Hello,
We are transacting with the Stripe API through REST modules, and when a call to charge a card receives what is a legitimate (though non-200) response the IVR system errors out without allowing the opportunity for us to handle the response (as far as we can tell). This does not happen with Authorize.net because they return their card declined message as a 2xx response and we are able to handle it and forward to customer service. Is there any way to accomplish this with such a response from Stripe? The response we get for a declined card is below.
Thanks for your time,
Fivable
-----
(This is a 402 HTTP status response)
Server: nginx
Date: Mon, 18 Jun 2018 19:10:42 GMT
Content-Type: application/json
Content-Length: 259
Connection: keep-alive
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
Access-Control-Max-Age: 300
Cache-Control: no-cache, no-store
Request-Id: req_T78ZJxMFecRu7m
Stripe-Version: 2016-07-06
Response
Raw
{
"error": {
"charge": "ch_D4byCRFgbj8n3g",
"code": "card_declined",
"decline_code": "generic_decline",
"doc_url": "https://stripe.com/docs/error-codes/card-declined",
"message": "Your card was declined.",
"type": "card_error"
}
}
We are transacting with the Stripe API through REST modules, and when a call to charge a card receives what is a legitimate (though non-200) response the IVR system errors out without allowing the opportunity for us to handle the response (as far as we can tell). This does not happen with Authorize.net because they return their card declined message as a 2xx response and we are able to handle it and forward to customer service. Is there any way to accomplish this with such a response from Stripe? The response we get for a declined card is below.
Thanks for your time,
Fivable
-----
(This is a 402 HTTP status response)
Server: nginx
Date: Mon, 18 Jun 2018 19:10:42 GMT
Content-Type: application/json
Content-Length: 259
Connection: keep-alive
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
Access-Control-Max-Age: 300
Cache-Control: no-cache, no-store
Request-Id: req_T78ZJxMFecRu7m
Stripe-Version: 2016-07-06
Response
Raw
{
"error": {
"charge": "ch_D4byCRFgbj8n3g",
"code": "card_declined",
"decline_code": "generic_decline",
"doc_url": "https://stripe.com/docs/error-codes/card-declined",
"message": "Your card was declined.",
"type": "card_error"
}
}