Hi Nicolas,
Thank you for your input. What you say may make sense for other Payment Gateways but I’m afraid it is not applicable to the MangoPay Payment Gateway which is the scenario I’m dealing with.
First let me explain how the payment process works when using MangoPay. After the user completes the checkout process and clicks “finish”, he is redirected to the MangoPay Payment Gateway page where the user only sees the amount he is about to pay and the only inputs are the credit card number, expiry date and CVV code (please see the attachment). At that point the order is created and the user has been notified via email. Then he enters his CC details in the MangoPay page and once the user clicks “validate”, if the CC number is correct he is ALWAYS redirected back to the store. But that does NOT mean the payment was accepted, the bank may reject the payment which happens a lot (you can test this by using CC 4706750000000009 together with CVV 999 ). So it is up to us to provide visual validation about what has happened since MangoPay does NOT provide any feedback to the user about the transaction.
If the payment is accepted the user is redirected back to the “checkout→ after_end” view where we show a message saying payment was accepted. The order gets changed to confirmed and the user gets another email saying the order is confirmed. That’s great.
However, if the payment is declined he is redirected back to the shopping cart and no message whatsoever shows. So the user has no clue what has happened with the payment. In addition, the order stays as created (he does not know about Hikashop and HikaShop order statuses) and he has received a nice email saying your order is created and showing the content of the shopping cart. So there are a lot of possibilities he thinks everything went well when in fact it did not.
If you think about the Payment process when using your Stripe Payment Plugin, you will realise it is very similar to what I have described. After finishing the checkout process the user is also presented with a very small form (instead of being redirected to the MangPay form the Stripe form is embeded in the website) where he can only input his credit card details (see attached) and when submitting the CC form then he is either redirected back to the “checkout→ after_end” view if it is successful or to the shopping cart if it is not.
But there are three big differences in what happens when the bank declines the payment and the user is Paying via Stripe (you can test it with card number 4000000000000002):
A) When the user is redirected back to the shopping cart there is a Joomla Jerror message saying “your card was declined” .
B ) The order status is automatically changed to CANCELLED (even if the CREATED status is NOT Cancellable in system→order statuses)
C) The user gets a second email saying your order is cancelled
So it is very obvious for the User his order did not go through when using Stripe. And it should be the same way if using MangoPay instead, but unfortunately as it works today it does not support A), B ) nor C), which is very disappointing.
The workarounds I have so far are not so great:
A) I can use the “cancel URL” parameter in the MangoPay Payment plugin to redirect the user to a menu item with an article showing a message that the transaction was not successful. This is not so bad but it is not as elegant as showing a Jerror message in the shopping cart saying your transaction was declined. This way the user is already in the shopping cart and he can try immediately with another card. By having the user in a different Menu Item I then need to suggest him to go back to the shopping cart which is an extra step.
B ) To get the order status automatically changed to CANCELLED I need to go to system→ order statuses and make the CREATED status Cancellable. This is NOT great because now users get a button in their order history to cancel their orders in CREATED status and I don’t want that. The stripe plugin cancels the order even if the CREATED Status is NOT Cancellable.
C) For the user to get notified about his order being cancelled you’re suggesting to add a parameter (email=1) in the MangoPay plugin. In which file? In which line? Will this be applied to the new versions moving forward? Or are you suggesting a core hack?
I really hope you can get declined Payments to behave the same for Stripe and MangoPay since it is perfect how it works for Stripe and I think it should behave the same way for A), B ) and C) when MangoPay is used.
Many thanks!