Implement order locking to prevent race conditions with async payment notification.

Created on 14 July 2021, over 3 years ago
Updated 20 May 2023, over 1 year ago

For a long time we always had race conditions between these two requests:

  1. When the client returns after a successful payment back to the website
  2. When the payment provider sends a notification about a successful payment

The issue is, that the payment is completed in PaymentOrderUpdater on request destruction and because both orders are processed in parallel, race conditions happens like order mails are sent twice and so on.
See here:
https://www.drupal.org/project/commerce/issues/3085805

All attempt to fix the issue on commerce_core side did not work. So the proper solution seems to be to use order locking on the payment provider.

The idea is to basically always wait for the notification from Saferpay BEFORE the client can trigger the "onReturn" functionality when returning from the payment provider.

Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇭Switzerland ayalon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024