changeset 30b80810f653 in modules/account_payment_stripe:5.0
details:
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=30b80810f653
description:
Always set error code
and set param for all exception with param code.
issue9119
review278691005
(grafted from 29eb5ed773e770c1cc0627e0d343fdc2da254763)
diffstat:
payment.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (25 lines):
diff -r 6a3da2b7db98 -r 30b80810f653 payment.py
--- a/payment.py Mon Mar 09 18:35:43 2020 +0100
+++ b/payment.py Tue Mar 17 23:19:20 2020 +0100
@@ -387,8 +387,8 @@
logger.warning(str(e))
continue
payment.stripe_error_message = str(e)
- if isinstance(e, stripe.error.CardError):
- payment.stripe_error_code = e.code
+ payment.stripe_error_code = e.code
+ if isinstance(e, stripe.error.StripeErrorWithParamCode):
payment.stripe_error_param = e.param
payment.save()
cls.fail([payment])
@@ -853,8 +853,8 @@
logger.warning(str(e))
continue
customer.stripe_error_message = str(e)
- if isinstance(e, stripe.error.CardError):
- customer.stripe_error_code = e.code
+ customer.stripe_error_code = e.code
+ if isinstance(e, stripe.error.StripeErrorWithParamCode):
customer.stripe_error_param = e.param
customer.stripe_token = None
except Exception: