Invertus / saferpayofficial

Saferpay Official
1 stars 2 forks source link

Order confirmed despite Saferpay refusing payment #120

Closed dsimunic closed 1 year ago

dsimunic commented 1 year ago

We have found an order in the PrestaShop list of orders with the status history "Awaiting Saferpay payment" followed by "Payment by bank transfer" two minutes later. The payment source in the list of orders is "SaferpayOfficial":

image

What does that mean?

Further testing has confirmed that the module creates new orders as soon as the user selects the payment option. However this does not set the payment source to "SaferpayOfficial" so we are unclear what steps lead to the above outcome.

Repro steps:

  1. Create a basket in Prestashop, check out.
  2. At checkout, select Mastercard as payment option presented by Saferpay module and click on "Place order" to open the Saferpay payment page.
  3. On the payment page enter a Visa card number (or an expired date or any other invalid payment detail).
  4. Saferpay page says the payment cannot proceed and offers a "cancel" link for the buyer to choose another payment method.
  5. Clicking on "cancel" returns the buyer to the shop, presents the "Your order is confirmed" page, and sends the order confirmation email to the buyer.

The order appears in the list of orders immediately after step 2, and doesn't get deleted if the user cancels out of payment.

Expected behavior (like other payment modules behave) is to create an order only on successful payment. If the user cancels out of payment, the order should not be created at all.

Also note that the Saferpay screen suggests to "select another payment method":

image

Clicking on "Cancel" in that case should return the user to the purchasing flow to select another payment method, and not to "Order confirmed" screen.

PrestaShop 1.7.8.8, module 1.1.3

dsimunic commented 1 year ago

Addendum: note the order creation behavior is the same whether the "Behaviour when 3D secure fails" is set to "Cancel" or "Authorize".

justelis22 commented 1 year ago

Hi there @dsimunic, thank you for your patience!

At the moment, the module does work like this, it is not a bug, but rather a lack of functionality. We are already talking with the Worldline team to improve this flow, but at the moment, I am not able to provide a timeline for this, as it would be a big change.

I will post any updates here!

Best Regards, Invertus Support team.

justelis22 commented 1 year ago

Hi there @dsimunic,

We have analyzed the issue and it seems like the case that you reported is a bug and not a missing feature. It was fixed by our team and now when the order is canceled, you should not see the order confirmation window. You can download the latest version here - https://github.com/Invertus/saferpayofficial/releases/tag/1.1.5

Any feedback is appreciated!

Best Regards, Invertus Support team.

dsimunic commented 1 year ago

Hi, thank you for this update. We have tested it, and while there's progress (the order confirmation no longer appears to the client, the client returns to the shopping basket and can retry checkout), the client still receives an email with order confirmation.

The order is still recorded in the "orders" list with status "Order authorization failed by Saferpay" even though it was the client that clicked on "Cancel."

Note that upon seeing "authorization failed by Saferpay" our salesperson is compelled to call the client to find out what happened, which is problematic from both reputation and workload aspects. A proper status would be "Customer cancelled payment attempt" or some such.

justelis22 commented 1 year ago

Hi @dsimunic,

We will check why the email is being sent.

As for the other things that you have mentioned, this is the lack of the functionality I was referring to. As orders are created as the buyer clicks the Pay button in the checkout, that is why the merchant sees the order even if the client hasn't even tried to pay for the items.

We will see if there is a way to change the order status for canceled orders.

Best Regards, Invertus Support team.

justelis22 commented 1 year ago

Hi there @dsimunic,

We have done the initial analysis for the email functionality, but at the moment, we still need some more time to fix the issue.

As for the order flow, this is also being discussed with us and the Saferpay team, so we should improve this in the near future as well.

Best Regards, Invertus Support team.

justelis22 commented 1 year ago

Hello there, Thanks for waiting!

The email functionality was improved, now the email will be sent only when the payment is authorized and captured. The new version can be downloaded here - https://github.com/Invertus/saferpayofficial/releases/tag/v1.1.6

Best Regards, Invertus Support team.