mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Record invalid payment states for debugging
We observed invalid payment states in Bugsnag but we don't actually know in which state the payment intent was in. From the context we can guess that it was "succeeded" but it would be good to validate this. And in the future it would be good to know if there are other invalid states we can end up in. The notification to Bugsnag happens in another part of the code.
This commit is contained in:
@@ -23,9 +23,10 @@ module Stripe
|
||||
end
|
||||
|
||||
def raise_if_not_in_capture_state(payment_intent_response)
|
||||
return unless payment_intent_response.status != 'requires_capture'
|
||||
state = payment_intent_response.status
|
||||
return unless state != 'requires_capture'
|
||||
|
||||
raise Stripe::StripeError, I18n.t(:invalid_payment_state)
|
||||
raise Stripe::StripeError, I18n.t(:invalid_payment_state, state: state)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user