Skip to content

Add sandbox agnostic receipt verification#1228

Merged
hyochan merged 1 commit intohyochan:masterfrom
ninjaboy:master
Jan 26, 2021
Merged

Add sandbox agnostic receipt verification#1228
hyochan merged 1 commit intohyochan:masterfrom
ninjaboy:master

Conversation

@ninjaboy
Copy link
Copy Markdown
Contributor

@ninjaboy ninjaboy commented Jan 9, 2021

As per Apple receipt verification best practices:

As a best practice, always call the production URL for verifyReceipt first, and proceed to verify with the sandbox URL if you receive a 21007 status code.

In case if isTest parameter is undefined or defined as null (basically means that developer prefers to perform environment agnostic check:

  1. Query production verification endpoint
  2. In case if 20017 error is returned - query sandbox receipt verification endpoint

For the cases when isTest parameter is explicitly defined as true or false - run the old logic

@hyochan hyochan requested a review from iaphub January 21, 2021 00:51
@hyochan hyochan added the 🍗 enhancement New feature or request label Jan 21, 2021
@hyochan
Copy link
Copy Markdown
Owner

hyochan commented Jan 21, 2021

@iaphub Could you kindly review this? Looks like this is somehow related to what you are working on.

Copy link
Copy Markdown
Owner

@hyochan hyochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just gone through this and this is what Apple wanted. Thanks for your contribution 💯

@hyochan hyochan merged commit f73a491 into hyochan:master Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍗 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants