fix order test

This commit is contained in:
Andy Brett
2021-03-05 12:05:06 -08:00
committed by Pau Perez
parent a5fbd6bb57
commit bc7469c7aa
2 changed files with 5 additions and 6 deletions

View File

@@ -21,12 +21,6 @@ module Spree
go_to_state :complete
end
state_machine.after_transition to: :payment, do: :charge_shipping_and_payment_fees!
state_machine.event :restart_checkout do
transition to: :cart, unless: :completed?
end
token_resource
belongs_to :user, class_name: Spree.user_class.to_s

View File

@@ -63,6 +63,10 @@ module Spree
transition to: :awaiting_return
end
event :restart_checkout do
transition to: :cart, unless: :completed?
end
if states[:payment]
before_transition to: :complete do |order|
order.process_payments! if order.payment_required?
@@ -78,6 +82,7 @@ module Spree
after_transition to: :delivery, do: :create_tax_charge!
after_transition to: :resumed, do: :after_resume
after_transition to: :canceled, do: :after_cancel
after_transition to: :payment, do: :charge_shipping_and_payment_fees!
end
end