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

Add subscription deferral for Google play #59

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

antonio0
Copy link

@antonio0 antonio0 commented Jan 6, 2019

Implemented this functionality: https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/defer

I know for sure that Apple doesn't provide an analogous functionality, not sure about the other providers though.

README.md Outdated Show resolved Hide resolved
@ronkorving
Copy link
Collaborator

I would love some feedback from other Google Play users (as I am not one).
Can anyone weigh in on the approach taken here?

@antonio0
Copy link
Author

antonio0 commented Jun 3, 2019

At our company we're running this code in production since January and have used this function a few thousand times (to delay some subscription payments). It's been stable and reliable so far, never had a problem with it.

It would be great to see it merged 🚢

@ronkorving
Copy link
Collaborator

@antonio0 Could you update this to use Google API v3?

@antonio0
Copy link
Author

@antonio0 Could you update this to use Google API v3?

@ronkorving just updated now to v3


if (!engine.deferSubscription) {
return syncError(new Error(`Platform ${platform
} does not have deferSubscription method`));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was the line too long for lint's liking?

superandrew213 and others added 4 commits November 22, 2019 18:53
[Apple] Check for cancellation_date_ms first

If cancellation date is available it means that Apple Customer Support refunded subscription payment.

From Apple:
To check whether a purchase has been canceled by Apple Customer Support, look for the
Cancellation Date field in the receipt. If the field contains a date, regardless of the
subscription’s expiration date, the purchase has been canceled. With respect to providing
content or service, treat a canceled transaction the same as if no purchase had ever been made.
Referencing the following documentation:

https://developer.apple.com/documentation/appstorereceipts/status

We can see that 21009 and 21010 are available codes we should handle.
@justinpage
Copy link
Contributor

@antonio0 With nine commits might make sense to squash?

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.

6 participants