简体   繁体   中英

ios In-App Purchase In-App Purchase transactionReceipt validation

After successful purchase my app sends the transactionReceipt to server so that it is validated using https://buy.itunes.apple.com/verifyReceipt. .

Now i does the following.

  1. store the key in db
  2. if the status received is 0 php script add the sucbscription to the user.
  3. expire the key.,up to this its ok but he problem now is

if the user somehow submit the transactionReceipt which he has used for some other purchase and sent to our server .it also validate true if posted to https://buy.itunes.apple.com/verifyReceipt so he gets another subscription for free . please help to solve this issue

Apple has a documentation about this issue here .

basically the verifyReceipt respond holds a receipt field with data about the original transaction. you need to check this data if it belongs to the right purchase and make sure, the customer does not get the purchase twice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM