changeset f5a1e9c7b140 in modules/account_payment_stripe:default
details: 
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=f5a1e9c7b140
description:
        Allow going back to processing state

        This allows to avoid to use the failed state when updating a succeeded 
payment
        as specific workflow may be plugged to the fail transition.

        issue9525
        review302001002
diffstat:

 payment.py |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 0852decc2eb9 -r f5a1e9c7b140 payment.py
--- a/payment.py        Tue Aug 11 21:47:51 2020 +0200
+++ b/payment.py        Sat Aug 29 18:17:51 2020 +0200
@@ -1097,7 +1097,7 @@
             with Transaction().set_context(company=payment.company.id):
                 payment = Payment(payment.id)
                 if payment.state == 'succeeded':
-                    Payment.fail([payment])
+                    Payment.proceed([payment])
                 payment.stripe_captured = charge['captured']
                 payment.stripe_amount = (
                     charge['amount'] - charge['amount_refunded'])
@@ -1298,7 +1298,7 @@
             with Transaction().set_context(company=payment.company.id):
                 payment = Payment(payment.id)
                 if payment.state == 'succeeded':
-                    Payment.fail([payment])
+                    Payment.proceed([payment])
                 payment.stripe_captured = bool(
                     payment_intent['amount_received'])
                 payment.stripe_amount = payment_intent['amount_received']
@@ -1326,7 +1326,7 @@
             with Transaction().set_context(company=payment.company.id):
                 payment = Payment(payment.id)
                 if payment.state == 'succeeded':
-                    Payment.fail([payment])
+                    Payment.proceed([payment])
                 payment.stripe_capturable = bool(
                     payment_intent['amount_capturable'])
                 if payment.stripe_amount > payment_intent['amount_capturable']:

Reply via email to