You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of our clients is experiencing intermittent problems where order payment details are not getting saved correctly. We suspect this happens as follows:
Customer places an order.
Payment is handled with Mollie (PSP)
ActiveCampaign OrderSync observer responds to event checkout_onepage_controller_success_action, loads the order from the database, and triggers a call to \ActiveCampaign\Order\Model\OrderData\OrderDataSend::orderDataSend. This method takes a bit of time because it sends data back and forth to the ActiveCampaign API.
Meanwhile, Mollie sends back a webhook with further payment details. The Mollie module also loads the order form the database, registers their information, and saves the order.
ActiveCampaign API call finishes and the orderDataSend method saves that the order was sync'ed:
As a result, the changes the Mollie webhook made are overwritten. As you can imagine, this is problematic for our client because orders that have been paid are incorrectly marked as pending payment, and after a while they're automatically cancelled for being open for too long. So customers paid, but their orders get cancelled.
This doesn't happen all the time, it's a race condition depending on when the Mollie webhook fires and how long your CURL call takes here:
I think a possible solution would be to reload the order from the database before saving ac_order_sync_status and ac_order_sync_id, to make sure you don't overwrite any changes that happened during your CURL call.
The text was updated successfully, but these errors were encountered:
One of our clients is experiencing intermittent problems where order payment details are not getting saved correctly. We suspect this happens as follows:
checkout_onepage_controller_success_action
, loads the order from the database, and triggers a call to \ActiveCampaign\Order\Model\OrderData\OrderDataSend::orderDataSend. This method takes a bit of time because it sends data back and forth to the ActiveCampaign API.As a result, the changes the Mollie webhook made are overwritten. As you can imagine, this is problematic for our client because orders that have been paid are incorrectly marked as pending payment, and after a while they're automatically cancelled for being open for too long. So customers paid, but their orders get cancelled.
This doesn't happen all the time, it's a race condition depending on when the Mollie webhook fires and how long your CURL call takes here:
I think a possible solution would be to reload the order from the database before saving
ac_order_sync_status
andac_order_sync_id
, to make sure you don't overwrite any changes that happened during your CURL call.The text was updated successfully, but these errors were encountered: