使用httparty进行itunes验证时出现异常

发布于 2024-09-26 22:49:35 字数 1610 浏览 7 评论 0原文

这是我为实现 itunes_verification 编写的一段代码。

http://gist.github.com/raw/622038/b32accd30e86f7c714f2cffefd19857f55 8c8d97/gistfile1.rb

ItunesVerification.verify_apple_receipt("wefwfrw")

但是,它总是从 itunes 服务器抛出 {"exception"=>"java.lang.NullPointerException", "status"=>21002} 。

#<HTTParty::Response:0x46d59a8 @parsed_response={"exception"=>"java.lang.NullPointerException", "status"=>21002}, @response=#<Net::HTTPOK 200 Apple WebObjects readbody=true>, @headers={"x-webobjects-loadaverage"=>["0"], "x-apple-application-site"=>["SB"], "expires"=>["Thu, 14 Oct 2010 04:24:12 GMT"], "connection"=>["keep-alive"], "edge-control"=>["no-store", "max-age=0"], "pod"=>["100"], "date"=>["Thu, 14 Oct 2010 04:24:12 GMT"], "x-apple-max-age"=>["0"], "x-apple-application-instance"=>["1000407"], "x-apple-woa-inbound-url"=>["/WebObjects/MZFinance.woa/wa/verifyReceipt?output=json&receipt-data=d2Vmd2U%3D%0A"], "content-length"=>["62"], "set-cookie"=>["Pod=100; version=\"1\"; expires=Sun, 14-Nov-2010 05:24:12 GMT; path=/; domain=.apple.com", "mzf_in=1000407; version=\"1\"; path=/WebObjects; domain=.apple.com"], "x-apple-lokamai-no-cache"=>["true"], "cache-control"=>["no-transform", "private", "no-cache", "no-store", "must-revalidate", "max-age=0"], "pragma"=>["no-cache"]}>

另外,我传递的字符串被编码为 Base64。

我尝试过其他选项,例如将键从“body”更改为“query”。

这非常紧急,我们将不胜感激任何帮助。

谢谢

Here is a piece of code I wrote to implement itunes_verification.

http://gist.github.com/raw/622038/b32accd30e86f7c714f2cffefd19857f558c8d97/gistfile1.rb

ItunesVerification.verify_apple_receipt("wefwfrw")

But, its always throwing {"exception"=>"java.lang.NullPointerException", "status"=>21002} from the itunes server.

#<HTTParty::Response:0x46d59a8 @parsed_response={"exception"=>"java.lang.NullPointerException", "status"=>21002}, @response=#<Net::HTTPOK 200 Apple WebObjects readbody=true>, @headers={"x-webobjects-loadaverage"=>["0"], "x-apple-application-site"=>["SB"], "expires"=>["Thu, 14 Oct 2010 04:24:12 GMT"], "connection"=>["keep-alive"], "edge-control"=>["no-store", "max-age=0"], "pod"=>["100"], "date"=>["Thu, 14 Oct 2010 04:24:12 GMT"], "x-apple-max-age"=>["0"], "x-apple-application-instance"=>["1000407"], "x-apple-woa-inbound-url"=>["/WebObjects/MZFinance.woa/wa/verifyReceipt?output=json&receipt-data=d2Vmd2U%3D%0A"], "content-length"=>["62"], "set-cookie"=>["Pod=100; version=\"1\"; expires=Sun, 14-Nov-2010 05:24:12 GMT; path=/; domain=.apple.com", "mzf_in=1000407; version=\"1\"; path=/WebObjects; domain=.apple.com"], "x-apple-lokamai-no-cache"=>["true"], "cache-control"=>["no-transform", "private", "no-cache", "no-store", "must-revalidate", "max-age=0"], "pragma"=>["no-cache"]}>

Also, the string I pass is encoded to Base64.

I have tried other options like changing the key from "body" to "query".

This is very urgent and any help will be greatly appreciated.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↙厌世 2024-10-03 22:49:35

已经发布了类似的问题,在这里查看,也许是建议那里可以帮助你。

There already is a similar problem posted, check it out here, perhaps the suggestions there can help you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文