mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-17 00:07:24 +00:00
Use pessimistic locking processing Stripe payment
We used pessimistic locking around the `update` action already but when Stripe redirects back to us we complete the payment in the `edit` action.
This commit is contained in:
@@ -14,7 +14,7 @@ class CheckoutController < ::BaseController
|
||||
|
||||
# We need pessimistic locking to avoid race conditions.
|
||||
# Otherwise we fail on duplicate indexes or end up with negative stock.
|
||||
prepend_around_action CurrentOrderLocker, only: :update
|
||||
prepend_around_action CurrentOrderLocker, only: [:edit, :update]
|
||||
|
||||
prepend_before_action :check_hub_ready_for_checkout
|
||||
prepend_before_action :check_order_cycle_expiry
|
||||
|
||||
Reference in New Issue
Block a user