Duplicate transactions

Created on 7 December 2023, 7 months ago

Despite the lock mechanism it's still possible to create duplicate transactions.

Request-A creates the lock and after 30 seconds it is still in txn creation process(slow server), then comes request-B (31st second) with the same txn-id and passes the expired lock. Both create the same transaction.

The solution is to acquire the lock for the payment intent id(not the order id) for max_execution_time. This way no other request can create the same txn until the current one finishes. We also allow other txns to be created on the order by not locking the order.

Attached a patch for an old version of the module that we use in our site.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

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

Comments & Activities

Production build 0.69.0 2024