我正在尝试设置方法来处理来自Coinbase的应用程序的回调。当我通过POST发送测试回调时,我的"服务器响应:422不可处理的实体"。
回调/ POST只是发送一个简单的JSON并期待状态200返回。为了测试,我试图让事情变得简单。这就是我在我的控制器中所拥有的:
def callbacks
render json: {status: "OK"}
end
但即便如此,我还是在我的服务器控制台日志中得到了这个:
2014-10-10T16:31:30.318374+00:00 app[web.1]: Started POST "/contribute/callbacks for 173.245.56.73 at 2014-10-10 09:31:30 -0700
2014-10-10T16:31:30.323217+00:00 app[web.1]: Parameters: {"order"=>{"id"=>nil, "created_at"=>nil, "status"=>"completed", "event"=>nil, "total_btc"=>{"cents"=>100000000, "currency_iso"=>"BTC"}, "total_native"=>{"cents"=>35925, "currency_iso"=>"USD"}, "total_payout"=>{"cents"=>35925, "currency_iso"=>"USD"}, "custom"=>"123456789", "id"=>nil}, "transaction"=>{"id"=>"54380", "hash"=>"4a5e1b", "confirmations"=>0}}}}
2014-10-10T16:31:30.324629+00:00 app[web.1]: Completed 422 Unprocessable Entity in 1ms
2014-10-10T16:31:30.323041+00:00 app[web.1]: Processing by PaymentsController#callbacks as JSON
2014-10-10T16:31:30.324325+00:00 app[web.1]: Can't verify CSRF token authenticity
我真的很感激任何帮助。我也尝试过渲染的变体。不知道接下来要排除故障后该做什么。