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:
Maikel Linke
2021-03-25 14:32:08 +11:00
parent 9fabca134a
commit 4d242af007

View File

@@ -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