limegrow / ingenico-m2-payments

2 stars 15 forks source link

Order status incorrectly resets when navigating back after payment success #26

Open lphilippo opened 3 years ago

lphilippo commented 3 years ago

We have recently had several occurrences where after a successful payment, the customer would navigate the browser back to the redirect page /ingenico/payment/redirect/.

Unfortunately, this causes that Block/Method/View::setOrderRedirected is called again, which means that the order status is being reset from "Payment received" back to "Payment pending". This results in paid orders being displayed as unpaid, which of course is a big concern.

Two thoughts about this:

The best approach, in my opinion, is to move the addStatusToHistory call towards the controller Ingenico\Payment\Controller\Payment\Redirect, add a check for the PENDING_PAYMENT state and remove the order status change there.

Please let me know if this customer behavior should be prevented in another file, but we did not find it.

Cheers