简体   繁体   English

PayPal IPN停止工作422错误

[英]PayPal IPN Stopped Working 422 Error

I was using PayPal Web Standard and receiving IPN notices from my payments perfectly fine for a couple months. 我使用PayPal Web Standard并在几个月内从付款中收到IPN通知完全正常。 Earlier this week it stopped working. 本周初,它停止了工作。 I have not changed any of the code for the function in sometime. 我有时没有更改该功能的任何代码。 I figured I would try here as a last resort as PayPal support pretty much just said, "not our problem". 我想我会在这里尝试最后一种方法,因为PayPal支持人员几乎说过:“不是我们的问题”。

I'm using ruby 1.8.7 and rails 2.3.9. 我正在使用ruby 1.8.7和rails 2.3.9。 I more or less just followed step by step the railscasts for setting up PayPal standard. 我或多或少只是逐步遵循了建立PayPal标准的轨道。 http://railscasts.com/episodes/archive?search=paypal http://railscasts.com/episodes/archive?search=paypal

Looking through the logs on the server. 查看服务器上的日志。 I am getting 422 errors with error ActionController::InvalidAuthenticityToken. 我收到422错误,错误代码为ActionController :: InvalidAuthenticityToken。

I'm already using: protect_from_forgery :except => [:paypal_IPN] 我已经在使用:protect_from_forgery:except => [:paypal_IPN]

It is not getting to the paypal_ipn function 它没有到达paypal_ipn函数

Any help is appreciated. 任何帮助表示赞赏。

Turns out it was a bonehead mistake on my end. 原来,这是我犯下的一个严重错误。 The route that received the IPNs was setup to receive get requests and not post request. 接收IPN的路由被设置为接收get请求而不是post请求。 Changing the method in my routes file to use post fixed the issue. 更改我的路线文件中的方法以使用后修复了该问题。 This doesn't explain why it was working for the few months prior. 这并不能解释为什么它在几个月前一直在工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM