I’m setting up Recurly JS on my rails app. To access the current_order or current_user I store their ids within the session. However, when Recurly JS is posting to my ‘success’ path, all this data is getting stripped out of my session. I can manually make sure this data is there by doing this:
update_checkout_url("payment", :order_id => session[:order_id], :user_id => current_user.id)
But this doesn’t seem very railsy. Is this some sort of csrf issue? Or is it just not possible to keep this data persistent when posting to recurly?
I had this same problem and with the help of the recuryly google group, I found that it was a csrf thing with rails protection. I added the following to my controller and specified the action.
protect_from_forgery :except => :successful
This took care of the problem. Hopefull this will help someone else.