AlexDisler / cordova-plugin-inapppurchase

A lightweight cordova plugin for in app purchases on iOS/Android
316 stars 191 forks source link

Error retrieving SKU details #149

Open richardmarais opened 7 years ago

richardmarais commented 7 years ago

I am using Ionic3 with Ionic Native In App Purchases. I set up a number of in-app purchases on the Google Play Store.

It was working perfectly and I could view all the products with:

.getProducts(this.PRODUCT_IDS)

, until I added a test user. Now I am getting this error:

Error retrieving SKU details

after I tried to make a purchase with the test user.

this.iap.buy(item.productId).then((data) => {
  return this.iap.consume(data.productType, data.receipt, data.signature);
}).then(() => {
  console.log('product was successfully consumed!');

And now I cannot access the products any longer.

I have read here that the reason may be because testers cannot consume a product and offers this solution:

SOLUTION: Pull up "orders" on the Play Console and "cancel" the pending purchase.

However, then I have two questions:

  1. How do you test purchases, if a tester cannot consume a product?
  2. Where do you pull up orders on the Play Console? I do look at "Order Management", but there are no orders listed.

Thanks

AngelaRg commented 7 years ago

Same problem. Any news on this?

markeames commented 7 years ago

For google play make sure you have your billing id in the src/manifest.json file "play_store_key": "MIIB-REST_OF_BILLING_ID_IN_HERE"

nilebma commented 7 years ago

Hi Everyone.

I have an app in production, with In-App purchase working on android (~7 sales validated every day).

However my crash reporting tools shows that the error you mentioned appears for ~5% of total users. I am afraid that it disables these users to buy something (??).

I checked the data reported by my tool, but I can't see any correlations between this error and any version of android or phone manufacturer.

I use the last version of the plugin ( with, Ionic 3.6.0, and Cordova 7.0.1 (with crosswalk plugin).

Does anyone have an idea about this error message ?

fujaru commented 6 years ago

I found a solution from here

Use this to consume a test purchase:

inAppPurchase.consume("inapp", "{\"purchaseToken\":\"inapp:YOUR_APP_ID:android.test.purchased\"}", "just put anything here");

YOUR_APP_ID is the application ID, for example: com.mydomain.myapp