且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AppStore 应用内购买收据验证问题

更新时间:2021-07-09 22:12:10

如果我正确阅读了文档,那么您就走错了路.您发送用于验证的收据是由 transactionReceipt 属性返回的数据块.你不应该关心它解码成什么,或者它是否解码成任何东西.您只需对它进行 base64 编码,将其放入一个 json 对象中作为键receipt-data"的值,然后将该 json 对象发布给 Apple.

If I read the documentation correctly, you're on the wrong track. The receipt that you send for verification is that chunk of data returned by the transactionReceipt property. You shouldn't care what it decodes to, or if it decodes to anything at all. You just base64-encode it, put it into a json object as the value for a key "receipt-data", and post that json object to Apple.

当您从 Apple 得到回复时,应该包含 json 格式的收据数据.

When you get the response back from Apple, that is what is supposed to contain the receipt data in json format.