Permalink
Browse files

Limited the pend_payment and fail_payment actions to the appropriate …

…states.
  • Loading branch information...
1 parent 25a5bd0 commit 1efe0d2965653e36170fe1be6baa8009a0d0f448 @schof schof committed Nov 18, 2008
Showing with 2 additions and 2 deletions.
  1. +2 −2 pp_website_standard_extension.rb
View
4 pp_website_standard_extension.rb
@@ -48,10 +48,10 @@ def associate_order
# add new events and states to the FSM
fsm = Order.state_machines['state']
fsm.events["fail_payment"] = PluginAWeek::StateMachine::Event.new(fsm, "fail_payment")
- fsm.events["fail_payment"].transition(:to => 'payment_failure')
+ fsm.events["fail_payment"].transition(:to => 'payment_failure', :from => ['in_progress', 'payment_pending'])
fsm.events["pend_payment"] = PluginAWeek::StateMachine::Event.new(fsm, "pend_payment")
- fsm.events["pend_payment"].transition(:to => 'payment_pending')
+ fsm.events["pend_payment"].transition(:to => 'payment_pending', :from => 'in_progress')
fsm.after_transition :to => 'payment_pending', :do => lambda {|order| order.update_attribute(:checkout_complete, true)}
fsm.events["pay"] = PluginAWeek::StateMachine::Event.new(fsm, "pay")

0 comments on commit 1efe0d2

Please sign in to comment.