mirror of
https://github.com/pretix/pretix.git
synced 2026-08-27 13:24:41 +00:00
First try at working around Stripe's iDEAL idempotency issues
This commit is contained in:
@@ -406,6 +406,20 @@ class StripeMethod(BasePaymentProvider):
|
|||||||
})
|
})
|
||||||
raise PaymentException(_('Stripe reported an error with your card: %s') % err['message'])
|
raise PaymentException(_('Stripe reported an error with your card: %s') % err['message'])
|
||||||
|
|
||||||
|
# This is not an error we normally expect, however some payment methods like iDEAL will redirect
|
||||||
|
# the user back to our confirmation page at the same time from two devices: the web browser the
|
||||||
|
# purchase is executed from and the online banking app the payment is authorized from.
|
||||||
|
# In this case we will just log the idempotency error but not expose it to the user and just
|
||||||
|
# forward them back to their order page. There is a good chance that by the time the user hits
|
||||||
|
# the order page, the other request has gone through and the payment is confirmed.
|
||||||
|
except stripe.error.IdempotencyError as e:
|
||||||
|
if e.json_body and 'error' in e.json_body:
|
||||||
|
err = e.json_body['error']
|
||||||
|
logger.exception('Stripe error: %s' % str(err))
|
||||||
|
else:
|
||||||
|
logger.exception('Stripe error: %s' % str(e))
|
||||||
|
return
|
||||||
|
|
||||||
except stripe.error.StripeError as e:
|
except stripe.error.StripeError as e:
|
||||||
if e.json_body and 'error' in e.json_body:
|
if e.json_body and 'error' in e.json_body:
|
||||||
err = e.json_body['error']
|
err = e.json_body['error']
|
||||||
|
|||||||
Reference in New Issue
Block a user