Commerce: Cancel is ignored

Created on 21 March 2025, 19 days ago

Problem/Motivation

If a customer clicks on the payment page of Mollie on the "back to the site" button in the bottom left corner the status of the payment is "open" and Mollie interprets it in MollieRedirectEventSubscriper.php on line 58 as a successfull payment because the payment is not null or false:

      if (!$payment) {
        $route_name = 'commerce_payment.checkout.cancel';
      }
      else
      ....

Proposed resolution

As already stated in this issue it should check the status of the payment as well.
Something like:


	$canceled_statuses = [
		PaymentStatus::STATUS_CANCELED,
		PaymentStatus::STATUS_EXPIRED,
		PaymentStatus::STATUS_FAILED,
		PaymentStatus::STATUS_OPEN,
	];

	if (!$payment || in_array($payment->getStatus(), $canceled_statuses, TRUE)) {
🐛 Bug report
Status

Active

Version

2.2

Component

Code

Created by

🇦🇹Austria mathiasgmeiner

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

Comments & Activities

Production build 0.71.5 2024