we are integrating with Stripe as a payment gateway
and call this API from secure flow
We need to read the error message in case of failed payment like invalid card or invalid expiry date
here's a sample of the failed response
{
"message": "The server encountered an unexpected condition which prevented it from fulfilling the request.",
"code": "internal.server.error",
"status": 500,
"messageParams": {},
"contextId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"details": [
{
"errorCode": "ACTION.REMOTE_ENDPOINT"
}
],
"errors": [
{
"message": "REST call for action execute failed. Message: Request to backend service failed. Response from web service: {\n "error": {\n "code": "invalid_expiry_year",\n "doc_url": "https://stripe.com/docs/error-codes/invalid-expiry-year\",\n "message": "Your card's expiration year is invalid.",\n "param": "exp_year",\n "request_log_url": "Stripe Login | Sign in to the Stripe Dashboard",\n "type": "card_error"\n }\n}\n [xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx]",
"code": "INTERNAL_SERVER_ERROR",
"status": 402,
"messageParams": {},
"details": [],
"errors": []
}
]
}
so, is there a way to read the error message from the data action ?