PayPal IPN:已完成500内部服务器JSON :: GeneratorError(源序列非法/格式错误utf-8):

时间:2016-09-13 10:43:46

标签: ruby-on-rails json ruby paypal paypal-ipn

当我尝试从PayPal IPN通知中保存参数时,我收到以下错误:

Completed 500 Internal Server JSON::GeneratorError (source sequence is illegal/malformed utf-8):

1 个答案:

答案 0 :(得分:0)

我发现了类似的问题:
Delivery status Failed notify_url IPN in ruby on rails
https://www.reddit.com/r/rails/comments/4nw7xn/help_force_utf8_encoding_on/

后者有正确答案:

params.each { |k, v| params[k] = v.force_encoding('ISO-8859-1').encode('UTF-8') }

PayPal正在发送非UTF-8字符,导致错误和PayPal威胁要因为太多失败的消息而停止我的IPN。