Routing Error on PayPal Re-direct
I'm having an issue integrating PayPal into my Rails 3 app using Ryan Bates's screencasts as a guide ( http://railscasts.com/episodes/143-paypal-security).
After payment's complete on the PayPal sandbox, the user's redirected back to the correct URL. Everything from encrypt开发者_StackOverflow社区ion to IPN works great.
For some reason, though, Rails throws a routing error immediately when the user's redirected from PayPal--even though the resource exists. The page repeats the error when I refresh the page, but when I navigate to the URL on my own it renders correctly. The routing error only occurs when PayPal redirects to my app.
I'm using Rails 3.0.10 with Ruby 1.9.2.
Has anyone ever seen this before? What's the cause?
Thanks!
If I remember correctly, the production version of PayPal does a POST of the redirect URL, while the sandox would do a GET. Which is, I know, weird!
Can you change your route for the specific redirect action to match
instead of get
and try again!?
Also, make sure you exempt it from protect_from_forgery :)
精彩评论