We were trying to validate the receipt generated from the mobile app from the server-side. It was working initially, but we were providing the receipt details directly to the code. Now we are trying it from the mobile app API functions, we are getting an error code 503.
{
"error": {
"code": 503,
"message": "An internal error occurred.",
"errors": [
{
"message": "An internal error occurred.",
"domain": "androidpublisher",
"reason": "subscriptionInternal"
}
]
}
}
What I am doing is validating my receipt by using google API. For that, I have created a service account in google play console and grant permission for the same. And also created OAuth 2.0 Client IDs in the developer console.
By using the client_id, client secret and redirect URI am validating the receipt.
If I am giving an invalid data in the Google API, for example, I enter the package name incorrectly then it will show a correct response like
{
"error": {
"code": 400,
"message": "The purchase token does not match the package name.",
"errors": [
{
"message": "The purchase token does not match the package name.",
"domain": "androidpublisher",
"reason": "purchaseTokenDoesNotMatchPackageName",
"location": "token",
"locationType": "parameter"
}
]
}
}
The issue is happening when I give all the data correctly in my code.
And I already did the same in another project and I get a correct response also. But I have no idea why here the response is always 503.
below one is sample URL which I am using to make receipt validation in server-side
'https://www.googleapis.com/androidpublisher/v3/applications/appId/purchases/subscriptions/subscriptionId/tokens/myPrchaseToken?access_token=myAccesstoken'