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

Manage different and multiple "paid subscription" products #1551

Open
giuseeFG opened this issue Mar 22, 2024 · 0 comments
Open

Manage different and multiple "paid subscription" products #1551

giuseeFG opened this issue Mar 22, 2024 · 0 comments

Comments

@giuseeFG
Copy link

giuseeFG commented Mar 22, 2024

In my app I need to purchase multiple paid subscription products in a different purchasing sessions
For instance:

  • (user) become pro ----> single user purchase
  • (page) purchase BASE ----> multiple pages
  • (page) purchase SILVER ----> multiple pages
  • (page) purchase GOLD ----> multiple pages

there could be multiple and different page type and an user could, potentially, purchase:

  • 3 pages type X
  • 2 pages type Y

the purchase flow works perfectly the first time, but I cannot understand how to achieve the renewal process because the Iaptic webhook send me data not related to a single purchase, but related to the customer who made the purchase.

"purchases": {
    "google:babaluapp_breeding": {
      "productId": "google:babaluapp_breeding",
      "purchaseId": "xxx",
      "transactionId": "xxx",
      "sandbox": true,
      "platform": "google",
      "purchaseDate": "2024-03-22T10:40:14.740Z",
      "expirationDate": "2024-03-22T12:10:00.968Z",
      "isBillingRetryPeriod": false,
      "isPending": false,
      "renewalIntent": "Renew",
      "isAcknowledged": true,
      "amountUSD": 64.87,
      "amountMicros": 59990000,
      "currency": "EUR",
      "lastRenewalDate": "2024-03-22T11:40:08.270Z",
      "isExpired": false
    },
    "google:babaluapp_page_petsitter": {
      "productId": "google:babaluapp_page_petsitter",
      "purchaseId": "xxx",
      "transactionId": "xxx",
      "sandbox": true,
      "platform": "google",
      "purchaseDate": "2024-03-22T11:38:20.253Z",
      "expirationDate": "2024-03-22T12:38:17.788Z",
      "isBillingRetryPeriod": false,
      "isPending": false,
      "renewalIntent": "Renew",
      "isAcknowledged": true,
      "amountUSD": null,
      "amountMicros": null,
      "currency": null,
      "lastRenewalDate": "2024-03-22T12:08:26.015Z",
      "isExpired": false
    }
  },

I tried to change the applicationUsername before making the purchase based on the specific case I need, and the first time (before the renewal) it works fine

"applicationUsername": "page_<ID>",

in case the user is purchasing a "page" item
or

"applicationUsername": "user_<ID>",

in case the user is purchasing the "user pro" item

So, my question is:
is there a way to "link" a purchase to a specific product (user/page) or a way to add additionalData to the purchase so my webhook code can understand which item is renewing?

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

No branches or pull requests

1 participant