问题
I am trying to get my Google browser extension in-app purchase working, but I keep getting an error.
- I have connected my Google Wallet Merchant account to my Chrome Web Store Developer Dashboard.
- In the edit page of my extension in my Dashboard, I have added the items to the "In-app products" tab (and made sure they are active).
- I have included the buy.js JS file in your app/ext package.
But when I try to get a list of the items within my extension by calling getSkuDetails method, I always get the INVALID_RESPONSE_ERROR
Here is the code I'm running:
google.payments.inapp.getSkuDetails(
{
'parameters': {'env':'prod'},
'success': function(response)
{
console.log('Success', response);
},
'failure': function(response)
{
console.log('Failure', response);
}
});
As you can see, I have included the necessary parameters according to https://developer.chrome.com/webstore/payments-iap
Furthermore, when I try the sample extension provided by google, I get the same error. https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/managed-in-app-payments
Can anyone explain why I cannot get my code or the sample code from Google to work?
The interesting thing is that getPurchases method works perfectly and returns an array of the user licenses, so Google servers are at least working.
回答1:
Our team has run into a similar problem. Google extension inapp purchases failure messages are not clear at all.
What it looks like to me is that you are not in a country supported by the store because you are able to see licenses, but cannot retrieve a list of licenses for purchase. Have you tried proxying your test environment to one of the supported regions and trying the script then?
Regions supported by Chrome Web Store Payments https://developer.chrome.com/webstore/pricing
来源:https://stackoverflow.com/questions/32303918/invalid-response-error-from-google-payments-inapp-getskudetails