Please sign in to comment.
[FIX] payment_stripe_sca: better error handling
In some cases, Stripe will return the result of a transaction with a faulty HTTP Status (e.g. 4XX statuses) - not because the request was malformed, but because the payment failed. It is a bit unfortunate that Stripe would not differentiate between payment status and request validity, but that's the state of things. This commit ensures that such a response will be logged correctly, by removing a call to `raise_for_status` on the response object and instead forwarding the response's json to the validation flow. While testing this fix, it became apparent that some error message processing in the frontend was not correctly handled as well - instead of purely rejecting the promise, a failed payment should still send its payload to the backend, to allow the server to put the transaction in the correct state according to the response.
- Loading branch information
Showing with 3 additions and 16 deletions.