changeset 78f56dae7632 in modules/account_payment_stripe:5.2
details: 
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=78f56dae7632
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 ae75e5e612e0 -r 78f56dae7632 payment.py
--- a/payment.py        Mon Mar 09 18:35:24 2020 +0100
+++ b/payment.py        Tue Mar 17 23:19:20 2020 +0100
@@ -388,8 +388,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])
@@ -864,8 +864,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:

Reply via email to