当我尝试从PayPal IPN通知中保存参数时,我收到以下错误:
Completed 500 Internal Server JSON::GeneratorError (source sequence is illegal/malformed utf-8):
答案 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。