我正在使用PaypalAdaptive。它会正确发送ipn_notification。 ipnNotification操作方法如下-
def ipn_notification
ipn = PaypalAdaptive::IpnNotification.new
ipn.send_back(request.raw_post.to_json)
print "=====================request.raw_post#{request.raw_post}=============="
if ipn.verified?
PaymentMailer.notify_unknown(request.raw_post).deliver
else
logger.info "IT DIDNT WORK"
end
render :nothing => true
end
但它返回错误
WARNING: Can't verify CSRF token authenticity rails
对这个问题有任何帮助。
最佳答案
在您的 Controller 中:
skip_before_filter :verify_authenticity_token, :only => [:ipn_notification]
对于快速阅读并分发-1的人(跳过重要部分:这不是来自客户端的POST调用...):
关于ruby-on-rails - 无法在Rails中验证CSRF token 的真实性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11986939/