mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Apply voucher after transitionning to the confirmation step
Testing that VoucherAdjustmentsService.calculate has been called after a transition doens't work, skipping test for now.
This commit is contained in:
@@ -81,6 +81,12 @@ module Spree
|
||||
order.create_tax_charge!
|
||||
order.update_totals_and_states
|
||||
end
|
||||
|
||||
after_transition to: :confirmation do |order|
|
||||
VoucherAdjustmentsService.calculate(order)
|
||||
order.update_totals_and_states
|
||||
end
|
||||
|
||||
after_transition to: :complete, do: :finalize!
|
||||
after_transition to: :resumed, do: :after_resume
|
||||
after_transition to: :canceled, do: :after_cancel
|
||||
|
||||
Reference in New Issue
Block a user