Canceled payment leads to completed order

Created on 21 November 2023, about 1 year ago

Problem/Motivation

Hi,
I don't know if I'm missing something or if I'm misunderstanding how this should work (if so, please forgive me) but I experienced that, if the user cancel the payment, the order is completed anyway.
That seems because, unless the onReturn method on StripeKlarna.php throws an exception ( eg. if the payment is null), it returns a RedirectResponse that is actually ignored by the commerce Off-site endpoint controller ( PaymentCheckoutController), that redirects to next checkout step 'completed'.

Steps to reproduce

Drupal core 9.5.11
Commerce 2.36
Commerce Stripe 1.1

In order to reproduce, close the klarna modal without completing the payment

Proposed resolution

Probably the payment gateway on onReturn should throw a dedicated exception in case the payment is canceled.

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇮🇹Italy puidu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024