我有问题。当我购买消耗品时。按照Validating Receipts With the App Store中的教程,我已按照以下步骤完成了验证收据
首先从receiptData
获取NSBundle.mainBundle().appStoreReceiptURL
然后
已完成,我收到了有关交易的回复信息(不包括Apple的标志,响应是纯文本)。但是当我使用我的服务器时,他们不接受来自收据数据的Hexa数据。他们问这样的base64EncodeData示例:
Base64EncodeData = ew0KCSJzaWduYXR1cmUiID0gIkFwTVVCQzg2QWx6TmlrVjVZdHJaQU1pSlFiSzhFZGVYazYza1dCQVh6bEM4ZFhHdWpxNDdabklZS29GRTFvTi9GUzhjWGxGZnA5WVh0OWlNQmRMMjUwbFJSbWlOR2J5aGl0cnlZVkFRb3JpMzJXOWFSMFQ4TC9hWVZCZGZXK095L1F5UFpFbW9OS3hobnQyV05TVURvVWhaOForNHBQNzBwZTVrVVFsYmRJVmhBQUFEVnpDQ0ExTXdnZ0k3b0FNQ0FRSUNDR1VVa1UzWldBUzFNQTBHQ1NxR1NJYjNEUUVCQlFVQU1IOHhDekFKQmdOVkJBWVRBbFZUTVJNd0VRWURWUVFLREFwQmNIQnNaU0JKYm1NdU1TWXdKQVlEVlFRTERCMUJjSEJzWlNCRFpYSjBhV1pwWTJGMGFXOXVJRUYxZEdodmNtbDBlVEV6TURFR0ExVUVBd3dxUVhCd2JHVWdhVlIxYm1WeklGTjBiM0psSUVObGNuUnBabWxqWVhScGIyNGdRWFYwYUc5eWFYUjVNQjRYRFRBNU1EWXhOVEl5TURVMU5sb1hEVEUwTURZeE5ESXlNRFUxTmxvd1pERWpNQ0VHQTFVRUF3d2FVSFZ5WTJoaGMyVlNaV05sYVhCMFEyVnlkR2xtYVdOaGRHVXhHekFaQmdOVkJBc01Fa0Z3Y0d4bElHbFVkVzVsY3lCVGRHOXlaVEVUTUJFR0ExVUVDZ3dLUVhCd2JHVWdTVzVqTGpFTE1Ba0dBMVVFQmhNQ1ZWTXdnWjh3RFFZSktvWklodmNOQVFFQkJRQURnWTBBTUlHSkFvR0JBTXJSakYyY3Q0SXJT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Base64encode";
"purchase-info" = "Base64encode";
"environment" = "Sandbox";
"pod" = "100";
"signing-status" = "0";
}
据我所知,收据已加密,我们无法读取。如何获得Decode Base64Encoded
等收据信息?谢谢!
更新:在互联网上游览并帮助我的朋友。我意识到,我的格式不像服务器端请求。这种格式很旧。我的解决方案是:对收据进行编码并发送到使用第三方库的服务器。
答案 0 :(得分:0)
嗯,我认为你的服务器端应该处理收据数据(基本编码64)。
您应该检查这些问题:
Verify receipt for in App purchase How to get iOS appStoreReceiptURL into Base 64 Encoded String?