changeset 5554e2484cbc in modules/account_payment_stripe:5.8
details: 
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset&node=5554e2484cbc
description:
        Access to refund status as key in webhook

        issue10909
        review383491002
        (grafted from 162483e8a37ab1b22a63bc49659ca19555d6835b)
diffstat:

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

diffs (18 lines):

diff -r 6eacaa258a9c -r 5554e2484cbc payment.py
--- a/payment.py        Fri Feb 19 21:28:11 2021 +0100
+++ b/payment.py        Sat Oct 30 02:21:45 2021 +0200
@@ -1135,11 +1135,11 @@
             # TODO: remove when https://bugs.tryton.org/issue4080
             with Transaction().set_context(company=refund.payment.company.id):
                 refund = Refund(refund.id)
-                if rf.status == 'pending':
+                if rf['status'] == 'pending':
                     Refund.processing([refund])
-                elif rf.status == 'succeeded':
+                elif rf['status'] == 'succeeded':
                     Refund.succeed([refund])
-                elif rf.status in {'failed', 'canceled'}:
+                elif rf['status'] in {'failed', 'canceled'}:
                     refund.stripe_error_code = rf['failure_reason']
                     Refund.fail([refund])
                 refund.save()

Reply via email to