summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvm-odoo <jvm@odoo.com>2020-06-26 12:58:12 +0000
committerjvm-odoo <jvm@odoo.com>2020-06-29 14:38:56 +0000
commit9b2c05742db839cfaf5bd5813a3ba1f6ca96e78e (patch)
tree1f4b8ccf2ede7f5df986d812d0db7e944d743733
parent45138611bcf7ca3ed22047b3dcd784608d456b61 (diff)
[FIX] payment_stripe: fix can pay a cancelled order
Issue - Install eCommerce, Stripe - Setup stripe for testing - Order something - Open stripe payment interface (not with odoo) - Go back with the stripe interface button Order Cancelled - Go back with browser back button - Enter your data Can pay but order still cancelled so you paid for nothing Cause I fixed a linked error in b8b9a04ff5b5b2ba40b26632 but I didn't mind that we should cancel the stripe payment intent too Solution Cancel the stripe payment intent so that filling the stripe form by following those step will returns an error from stripe OPW-2282946 closes odoo/odoo#53819 X-original-commit: 5acb2a649a2f2490725283c7f4cff5a5183d8ed0 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com> Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
-rw-r--r--addons/payment_stripe/models/payment.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/payment_stripe/models/payment.py b/addons/payment_stripe/models/payment.py
index 936e8d1c601..09fa865a54e 100644
--- a/addons/payment_stripe/models/payment.py
+++ b/addons/payment_stripe/models/payment.py
@@ -296,6 +296,7 @@ class PaymentTransactionStripe(models.Model):
return True
if status == 'requires_payment_method':
self._set_transaction_cancel()
+ self.acquirer_id._stripe_request('payment_intents/%s/cancel' % self.stripe_payment_intent)
return False
else:
error = tree.get("failure_message") or tree.get('error', {}).get('message')