Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out all receipts with "cancellation_date" != nil (#163) #164

Merged
merged 1 commit into from
Mar 13, 2017

Conversation

bizz84
Copy link
Owner

@bizz84 bizz84 commented Mar 12, 2017

See #163. According to Apple docs:

Cancellation Date
For a transaction that was canceled by Apple customer support, the time and date of the cancellation.
ASN.1 Field Type 1712
ASN.1 Field Value IA5STRING, interpreted as an RFC 3339 date
JSON Field Name cancellation_date
JSON Field Value string, interpreted as an RFC 3339 date
Treat a canceled receipt the same as if no purchase had ever been made.

https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html

@bizz84 bizz84 merged commit 3762f0a into develop Mar 13, 2017
@bizz84 bizz84 deleted the feature/verify-subscription-check-cancellation_date branch March 14, 2017 09:57
@vitovalov
Copy link

As mentioned in docs,

The Cancellation Date (cancellation_date) field is designed for use with auto-renewable subscription and non-consumable products.

It also applies to non-consumables. Then I'd like to know how to proceed if the user has bought an item ("no ads") and later cancelled it.

Initially I thought I need to make verify receipt call on every app launch to update the state of a product to "purchased" or "not purchased". Now reading this PR, I don't understand how this works.

If user returns a bought product, it's like he didn't pay for it. Therefore the app should return to the state when the product was not bought. How can we accomplish this?

@harryworld
Copy link

@vitovalov This is how I handle it now.

  1. Force Refresh the receipt at launch
  2. Updated receipt will have cancellation_date (Available in ASN.1 Field Type 1712)
  3. This PR will verify cancellation_date and return as .notPurchased

Now, my question to @bizz84
If I refresh the receipt at launch, quite often, I am prompted for the sign-in again. Is there a better way to handle the scenario in practice?

@hamzabinamin
Copy link

hamzabinamin commented Jan 22, 2019

If the user cancels an auto renewable subscription from the settings of his phone, what would be the right field in the receipt result to check for that? is_cancelled?

@harryworld
Copy link

cancellation_date @hamzabinamin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants