FLUX-SE / PayumStripe

Payum Stripe gateways (with SCA support)
MIT License
28 stars 15 forks source link

[CheckoutSession] Hitting back url is not canceling the paiement #28

Closed Prometee closed 1 year ago

Prometee commented 1 year ago

When a customer hit the "Back" link during a Checkout Session a Payum Extension is in charge to cancel the PaymentIntent created by the Checkout Session.

Due to an update of the API behaviour this Payment Intent cancelation is silently throwing an exception because like the Stripe doc is now mentioning it : https://stripe.com/docs/api/payment_intents/cancel

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session instead

Thank you @dragosprotung for taking time to explain and show me how the issue can be spotted 😉

PR will follow this afternoon.

dragosprotung commented 1 year ago

Not to forget, this behaiviour is depended on the Stripe base API version. Version 2020-08-27 and newer has this issue, while previous versions do not.