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

Lib not giving base plan info for the new google play subscription structure #366

Open
marianolc opened this issue Mar 7, 2024 · 0 comments

Comments

@marianolc
Copy link

Base on how subscriptions works now:

https://support.google.com/googleplay/android-developer/answer/12124625?sjid=10922029906795459446-EU

Where everything should be in the same subscription:

1O4B580sKFSrmTgbPhHxpIRzj0qYeioCUDTx

For example, a doing a iap.getPurchaseData(result) from a validation I get the following information:

[
   {
      "service":"google",
      "status":0,
      "packageName":"app.yyyy",
      "productId":"yyyy",
      "purchaseToken":"xxxx",
      "startTimeMillis":1709565742304,
      "expiryTimeMillis":1709568021739,
      "autoRenewing":false,
      "priceCurrencyCode":"USD",
      "priceAmountMicros":10770000,
      "countryCode":"XX",
      "developerPayload":null,
      "cancelReason":1,
      "orderId":"GPA.0000-0000-0000-00000..6",
      "purchaseType":0,
      "acknowledgementState":1,
      "kind":"androidpublisher#subscriptionPurchase",
      "transactionId":"xxxx",
      "quantity":1,
      "expirationDate":"1709568021739",
      "cancellationDate":"1709568021739"
   }
]

If I call the subscriptionV2 api from google:

https://androidpublisher.googleapis.com/androidpublisher/v3/applications/${packageName}/purchases/subscriptionsv2/tokens/${purchaseToken}

In the response there is an array of "LineItems" that I guess is what is mapped to get the previous object. In the line items the basePlanId is there:

{
   "kind":"androidpublisher#subscriptionPurchaseV2",
   "startTime":"2024-03-04T15:22:22.696Z",
   "regionCode":"XX",
   "subscriptionState":"SUBSCRIPTION_STATE_EXPIRED",
   "latestOrderId":"GPA.0000-0000-0000-00000..6",
   "canceledStateContext":{
      "systemInitiatedCancellation":{
         
      }
   },
   "testPurchase":{
      
   },
   "acknowledgementState":"ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
   "lineItems":[
      {
         "productId":"yyyy",
         "expiryTime":"2024-03-04T16:00:21.739Z",
         "autoRenewingPlan":{
            
         },
         "offerDetails":{
            "basePlanId":"BASE_PLAN_ID",
            "offerId":"starter",
            "offerTags":[
               "monthly",
               "starter",
               "starter-test"
            ]
         }
      }
   ]
}

This value is important because is the only way to recognize "gold" / "silver" plan for example.

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