Invertus / saferpayofficial

Saferpay Official
0 stars 1 forks source link

Race conditions ? #169

Open Aktarus006 opened 2 weeks ago

Aktarus006 commented 2 weeks ago

Hello,

We recently updated our website to Prestashop 8 and saferpay 1.2.2. Since then we faced some issues regarding orders,

At first, when creating order before authorization, some of them are stuck in 'Awaiting Saferpay Payment' or go from a 'Payment Completed By Saferpay' to 'Payment Authorized by Saferpay'.

image

When I look at the Prestashop logs I can see an error message saying that the cart cannot be loaded or an order as already been made using this cart.

image

So we tried to create orders after authorization. No more orders stucked in awaiting but the reference of the order is not set anymore to saferpay and some orders are authorized or captured by saferpay but they are not created by Prestashop at all. In saferpay logs I can see that these orders return an error saying the Transaction is in wrong state.

Are the notify and return controllers making request at the same time ?

Did you already face the same issues ? Do you have any clue on how to solve this ?

Thanks for your help

id-clic commented 1 week ago

Same issue. @SimonasB88 any idea ?

Dedra-be commented 1 week ago

i'm facing the same bug, wich is damn annoying.

Arnaud104 commented 1 week ago

Keep me informed if u guys find a solution because this bug is a pain 😒

justelis22 commented 1 week ago

Hi everyone, Thank you for raising this topic I understand it is inconvenient.

We are currently working on the race condition issue and a way to improve the locking process.

You are correct, the notification and authorization could happen at the same time, thus we need to improve the lock to avoid these issues.

I will keep you updated, as soon as I have some news.

Best Regards, Invertus Support team.

justelis22 commented 4 days ago

Hi there @Aktarus006 @id-clic @Dedra-be @Arnaud104, thank you for your patience!

We are currently in the process of testing the changes.

Here you can find the 1.2.3 beta release with the fixes - https://github.com/Invertus/saferpayofficial/releases/tag/v1.2.3-beta

As you can understand this is not an official release, but if you have a development shop, I would appreciate it if you could install the module and check if everything is working correctly.

There were a lot of edge cases that we have been facing, so we don't want to release the module with any bugs.

The official release should be done next week depending on your feedback! Thank you and I am eagerly waiting to hear from you.

Best Regards, Invertus Support team.

Aktarus006 commented 1 day ago

Hello @justelis22,

Thank you for your return... I just installed the beta you provided on my test environment. Right out of the box, I face some issue... All my orders are currently stucked when on the return page. I have the message with Awaiting Payment Status but can't reach the confirmation page.

The orders are well captured by Saferpay but in my Prestashop back office they still have the awaiting status. When I look at the logs though I can see "CAPTURED" or "AUTHORIZED" appearing several times.

Maybe some of our modules are interfering during the update of the status? It's hard to say... Unfortunately I won't have much time to test or investigate deeper since I will be off at the end of the week and till the end of the month.

I'll try again when I come back !