I am using aasm statemachine. I have the below event. What this does is changes the state from order_created
to payment_response_received
. So after changing this I want to call a method verify_payment_response(data)
.
I can make this state change by calling @booking.move_to_payment_response_received!
, but how can I pass parameters for use in the after callback?
event :move_to_payment_response_received do
after_commit do
self.verify_payment_response(data) #How can I pass this data param from my controller
end
transitions from: :order_created, to: :payment_response_received
end