NOTE. This is for Mac OS X, not iOS
I have a client application that allows me to pay for purchases inside the application. Receipts must be sent to the server, where the server performs some operation when it receives the order. The operation performed by the server requires me a little money, so I need to be especially careful that the receipts are valid and used only once. I am looking for a better way to develop this.
It looks like I get a receipt from the store when the user completes the purchase. When I send this to my web server (by running WCF), it will verify receipt by sending JSON to Apple. When Apple confirms the receipt, it will perform an operation that costs me some money. While checking part of the confirmation, my research tells me that a receipt will always be valid and not actually “consumed”. Should I just keep track of every single receipt ever presented on my server and make sure it is not in use? I will do my best to back up this list, but I am afraid that it will be lost at some point, and I hope the other way.
My other problem is because consumable receipts cannot be restored via storekit, if something happens, for example, when a user loses the right immediately after the purchase is completed, the user will not receive the product, because there is no way to get this receipt, It’s just Is the risk we should take, or am I missing something? It seems that the only real difference between purchased and non-consumed purchases is that you cannot restore consumables.
source share