changeset 05be07e81853 in modules/account_payment_stripe:5.0
details: 
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=05be07e81853
description:
        Deduce dispute amount only if smaller than amount

        The dispute amount is based on the initial amount of the charge. So if 
there
        was already refunds that reduced the payment amount, we must not set a 
negative
        amount.

        issue9452
        review290491002
        (grafted from b17ec8f1c68cb52d476741a05d6d2b7264044656)
diffstat:

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

diffs (12 lines):

diff -r 1ea00e69a583 -r 05be07e81853 payment.py
--- a/payment.py        Sat Apr 04 17:47:41 2020 +0200
+++ b/payment.py        Mon Jul 13 20:54:31 2020 +0200
@@ -686,7 +686,7 @@
                 payment.save()
                 if source['status'] == 'lost':
                     Payment.fail([payment])
-                    if payment.stripe_amount != source['amount']:
+                    if payment.stripe_amount > source['amount']:
                         payment.stripe_amount -= source['amount']
                         payment.save()
                         Payment.succeed([payment])

Reply via email to