You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would have expected it to say something about the subscription.
Actual Behavior
I always received : no matter what I tried
Error Response: { "error": { "code": 400, "message": "Your request is invalid for this subscription purchase.", "errors": [ { "message": "Your request is invalid for this subscription purchase.", "domain": "androidpublisher", "reason": "subscriptionInvalidArgument" } ] } }
Also present in the androidpublisher.v3.json file:
"subscriptionsv2": {
"methods": {
"get": {
"description": "Get metadata about a subscription",
"flatPath": "androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}",
"httpMethod": "GET",
"id": "androidpublisher.purchases.subscriptionsv2.get",
"parameterOrder": [
"packageName",
"token"
],
"parameters": {
"packageName": {
"description": "The package of the application for which this subscription was purchased (for example, 'com.some.thing').",
"location": "path",
"required": true,
"type": "string"
},
"token": {
"description": "Required. The token provided to the user's device when the subscription was purchased.",
"location": "path",
"required": true,
"type": "string"
}
},
"path": "androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}",
"response": {
"$ref": "SubscriptionPurchaseV2"
},
"scopes": [
"https://www.googleapis.com/auth/androidpublisher"
]
}
}
}
Steps to Reproduce
When using the new v2 framework in googleplay.py, it seems to work again:
def check_purchase_subscription(self, purchase_token: str, product_sku: str, service) -> dict:
try:
purchases = service.purchases()
subscriptions = purchases.subscriptionsv2()
subscriptions_get = subscriptions.get(
packageName=self.bundle_id, token=purchase_token
)
result = subscriptions_get.execute(http=self.http)
return result
except HttpError as e:
if e.resp.status == 400:
raise GoogleError(e.resp.reason, repr(e))
else:
raise e
Your Environment
Version used: 2.5.2
The text was updated successfully, but these errors were encountered:
Subscriptions can soon no longer be validated with the original subscription link, but should go to the v2 version.
https://developer.android.com/google/play/billing/compatibility
Description
I tried a long time to get things working with the current code, but google was giving me cryptic error message saying I provided wrong arguments to the API call when calling the URL:
Method: https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}
Expected Behavior
I would have expected it to say something about the subscription.
Actual Behavior
I always received : no matter what I tried
Error Response: { "error": { "code": 400, "message": "Your request is invalid for this subscription purchase.", "errors": [ { "message": "Your request is invalid for this subscription purchase.", "domain": "androidpublisher", "reason": "subscriptionInvalidArgument" } ] } }
Possible Fix
Looking at the following link, I noticed there is now a subscriptionv2 endpoint that should be used.
https://developer.android.com/google/play/billing/compatibility
Also present in the androidpublisher.v3.json file:
"subscriptionsv2": {
"methods": {
"get": {
"description": "Get metadata about a subscription",
"flatPath": "androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}",
"httpMethod": "GET",
"id": "androidpublisher.purchases.subscriptionsv2.get",
"parameterOrder": [
"packageName",
"token"
],
"parameters": {
"packageName": {
"description": "The package of the application for which this subscription was purchased (for example, 'com.some.thing').",
"location": "path",
"required": true,
"type": "string"
},
"token": {
"description": "Required. The token provided to the user's device when the subscription was purchased.",
"location": "path",
"required": true,
"type": "string"
}
},
"path": "androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}",
"response": {
"$ref": "SubscriptionPurchaseV2"
},
"scopes": [
"https://www.googleapis.com/auth/androidpublisher"
]
}
}
}
Steps to Reproduce
When using the new v2 framework in googleplay.py, it seems to work again:
Your Environment
The text was updated successfully, but these errors were encountered: