Hi,
I would like to intercept checkout flow by adding following in order_decorator.rb:
Spree::Order.state_machine.before_transition :to => :delivery, :do => :test?
def test?
errors.add(:base, "error 1")
return false
end
It does work however the only error it shows to the user while moving to that state is this:
Payment could not be processed, please check the details you entered
It remains the same whether I add the errors.add line or note. Also it remains the same even if I change the state from :delivery to any other.
Thanks