changeset b17ec8f1c68c in modules/account_payment_stripe:default
details: 
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=b17ec8f1c68c
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
diffstat:

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

diffs (12 lines):

diff -r 2d8909b58477 -r b17ec8f1c68c payment.py
--- a/payment.py        Thu Jul 09 10:21:06 2020 +0100
+++ b/payment.py        Mon Jul 13 20:54:31 2020 +0200
@@ -1234,7 +1234,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