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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top