Rails Casts #142 Paypal Notifications

Hey all,

I ran into a bit of an issue in Rails Cast #142. I received the following error while testing the IPN:

WARNING: Can't verify CSRF token authenticity
Completed 500 Internal Server Error in 2ms
app/controllers/payment_notifications_controller.rb:11:in `process_ipn_payment'

Simply replace the following line with the alternative below it:

1
2
#Payment_Notifications_Controller.rb
protect_from_forgery :except => [:create]
1
2
#Payment_Notifications_Controller.rb
skip_before_filter :verify_authenticity_token, :only => [:create]

Leave a Reply