mollie / Magento

Mollie Payments for Magento 1.x
https://www.mollie.com/
BSD 2-Clause "Simplified" License
39 stars 30 forks source link

Cancelling payment leads to checkout success #214

Closed mybinaryromance closed 2 years ago

mybinaryromance commented 2 years ago

When a customer decides to cancel the payment process on the payment page (for example when using the 'return to merchant'-link on the paypal screen), he is still redirected to the checkout success page. The expected behaviour would be the customer being redirected to cart and have the quote restored.

This is happening using magento 1.9.4.5 (Mage One) and mollie extension v 5.6.8, using magento core onepage checkout.

When cancelling a payment the customer is redirected to https://www.mysite.com/mpm/api/return/?order_id=58185&payment_token=96d1669d7c8[...]&utm_nooverride=1

Digging into the problem I found that Mollie_Mpm_ApiController::returnAction() can not behave as expected because !empty($status['success']) in line 219 is evaluating to true, even with payments cancelled by the customer.

This happens because Mollie_Mpm_Model_Client_Orders::processTransaction() will handle the transaction as 'created', not 'cancelled' and return for example

Array
(
    [success] => 1
    [status] => created
    [order_id] => 58185
    [type] => success
)

At this point I really can not figure out whether the mollie API is not responding correctly or what else is going wrong. Anyway one is left with a really bad customer experience, leading customers from 'I want to go back and try another payment method' directly to 'Thank you we have received your order'.

Frank-Magmodules commented 2 years ago

HI @mybinaryromance , thank you for opening this issue. 
It seems that we can't reproduce this issue, we always end on the cart page with a "Payment canceled, please try again". 

Can you share a staging/development environment where we can reproduce this and help you debug the issue? 
Please fill in our contact form with these details and we will come back to you as soon as possible.

mybinaryromance commented 2 years ago

Hi @Frank-Magmodules, I fixed the issue by re-downloading and re-installing the latest release. Works for me now :) Thank you!