Verify consumable in-app purchase for Mac OS X on server side

那年仲夏 提交于 2019-12-22 05:31:09

问题


NOTE: This is for Mac OS X not iOS

I have a client app which will allow consumable in-app purchases. The receipts should be sent to the server where the server performs some operation when it gets an order. The operation the server performs costs me a bit of money so I need to be extra careful that the receipts are valid and only used once. I'm looking for the best way to design this.

It looks like I get the receipt from the storekit when the user completes the purchase. When I send that to my web server (running WCF) it will verify the receipt by posting the JSON to Apple. When Apple confirms the receipt it will do the operation that costs me a bit of money. During the verify receipt part my research tells me that a consumable receipt will always come up valid and is not actually "consumed". Am I supposed to just track every single receipt ever submitted to my server and make sure it hasn't been used? I will do everything I can to back up that list but I fear it getting lost at some point and am hoping for another way.

My other concern is that since consumable receipts are not recoverable via the storekit that if something happens like the user loses power right when the purchase is completed then the user won't get the product because there is no way of retrieving that receipt. Is that just a risk we have to take or am I overlooking something? It sounds like the only real difference between the consumable and non-consumable purchases is that you can't restore consumables.


回答1:


I was able to talk to an Apple rep about this issue. They basically said there is no way to verify a consumable receipt on the server in the current version of their framework.



来源:https://stackoverflow.com/questions/9366214/verify-consumable-in-app-purchase-for-mac-os-x-on-server-side

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!