-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use purchases.subscriptionsv2 for Android Feast subscriptions (#1545)
Use the purchases.subscriptionsv2 [1] endpoint to retrieve data about Android Feast subs, instead of purchases.subscriptions v1 [2] (which we use for the live app). The reason for the migration is that when using the v1 endpoint, we rely on being able to map a product ID to a billing duration. This mapping is defined here [3]. This isn't very robust (in the past, new products have been added in the Play store, but not reflected here, meaning we get rows without a billing period). Furthermore, the was the Feast app has been configured in the Play store, it's not actually possible to map things this way. Instead, if we use the v2 endpoint, we can retrieve the billing period using Play store APIs. Some back story on the v2 endpont: Tom Wadeson did some work to implement the v2 endpoint. In prod there's a test which uses the v2 endpoint in parallel with the v1 endpoint for x% of requests to the subscriptions endpoint. There's a draft PR #1338 to use the new endpoint everywhere, but not merged yet. Using this for Feast feels like a nice step in the migration path as we're using it for real but in a focused context. [1]: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2 [2]: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions [3]: https://github.com/guardian/mobile-purchases/blob/bb1632ea1e53d0fb2ca0e870b67677558a4ea2b9/typescript/src/services/productBillingPeriod.ts#L4
- Loading branch information
Showing
3 changed files
with
72 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters