I have a problem checking the receipt of a mailbox on the server side. I tried to find a solution on the Internet, but failed.
So, the description: First of all, the application is made for iOS7. Secondly, I have several elements (type = Non-Renewing Subscription). Thus, the user can buy one or more items, and then he must manually update them (buy again).
Applications send a receipt to the server, I make a request to Apple and get the result with a lot of in_app receipts. Something like:
"in_app":[ { "quantity":"1", "product_id":"...", "transaction_id":"...", "original_transaction_id":"...", "purchase_date":"...", "purchase_date_ms":"...", "purchase_date_pst":"...", "original_purchase_date":"...", "original_purchase_date_ms":"...", "original_purchase_date_pst":"...", "is_trial_period":"..."}, { "quantity":"1", "product_id":"...", "transaction_id":"...","original_transaction_id":"...", "purchase_date":"...", "purchase_date_ms":"...", "purchase_date_pst":"...", "original_purchase_date":"...", "original_purchase_date_ms":"...", "original_purchase_date_pst":"...", "is_trial_period":"..."} ]
So, each "receipt" in "in_app" has transaction_id. But how can I determine the transactionId of the current purchase? I would also like to test it and make sure that it is unique.
It bothers me: if someone receives one valid receipt, he will be able to crack our server-side API and make an unlimited number of purchases in the application with the same valid receipt.
Do I have to somehow decrypt and verify the "original" receipt for transaction_id, which I send to Apple for verification?
Any help / suggestions would be greatly appreciated. Thank you in advance.
Regards, Maxim