In-App purchases with test accounts not possible (IAP Badger)

I have a problem with in-app purchases. I use Corona (2018.3215) with the IAP Badger plugin.

For testing:
Device 1: Account A (Developer), Account B
Device 2: Account C

I start my app on device 1 with account A (my developer account). I can call iap.loadProducts without any problems and the given function is executed. I can process all in-app product data (title, price) further. But I can’t buy the products, because it doesn’t work through the developer account. It’s all good so far. If I test the same app with my two test accounts (B and C), the products will not be loaded. I read Google’s page about creating test accounts. I put them on my alpha channel as testers. I also added them to my account details so you can make free trial purchases. No errors are reported via ADB.

What could be the reason why the In-App products are not loaded in the test accounts, but in the Developer account?

If your IAPs are fully approved they will be visible on any Google account - not just test accounts.

How can I fully approve the in app products?

Drill down into your IAPs and check their status is active.

The in app products are active. I made some screenshots to show you my google play console.

I’m happy about every idea.

In your product callback what do you get for both of these?

event.products event.invalidProducts

In your test accounts, have you confirmed the accounts are part of your alpha program by:

  • switching accounts on Google Play (on your devices)
  • clicking on the confirmation/sign-up URLs

Sometimes, I’ve found I also have to sign out of Chrome on the device, and back in using the test Google account, to make this work.

A way of testing this is trying to download the app from Google Play.  If you can’t find it, your test accounts haven’t been confirmed properly.

Simon

Thanks for your answers!

On the devices with test accounts I see the website with “You are a tester” and I find the app in the store.

Now I added “verboseDebugOutput = true” to my code. The output in the developer account looks good. But in the test accounts there is this error:

02-07 18:31:44.275 32085 32100 I Corona : IAP Badger: loadProductsCallback 02-07 18:31:44.275 32085 32100 I Corona : Raw event data: 02-07 18:31:44.275 32085 32100 I Corona : table: 0x8a2c1980 { 02-07 18:31:44.275 32085 32100 I Corona : [errorString] =\> "Error refreshing inventory (querying owned items). (response: -1003:Purchase signature verification failed)" 02-07 18:31:44.275 32085 32100 I Corona : [name] =\> "productList" 02-07 18:31:44.275 32085 32100 I Corona : [isError] =\> true 02-07 18:31:44.275 32085 32100 I Corona : [errorType] =\> -1003 02-07 18:31:44.275 32085 32100 I Corona : } 02-07 18:31:44.275 32085 32100 I Corona : 02-07 18:31:44.275 32085 32100 I Corona : Product catalogue couldn't be loaded due to error 02-07 18:31:44.275 32085 32100 I Corona : IAP Badger: leaving loadProductsCallback

What does this mean?

Try clearing the cache for Google Play in the Android settings menu (and any data as well).

Simon

PS - out of curiosity, how many in-app products do you have?  I’ve just searched for this error, and came up with a reference to Google IAP v3, where if you do a loadProducts with more than 20 items at once, it throws an error.

Wondered if that was relevant here, if Corona automatically batches calls in 20 to avoid error etc.

I have 24 IAPs per game so that is not the issue.

Clearing cache may help but are you building with a different certificate?

I can’t comment on the helper plugin you are using (I go direct) but I can confirm that if the IAPs are active they can be viewed/purchased by any client.  I am moving from closed alpha to open alpha and I’ll change nothing (other than flipping the switch).

There error you are getting could be because you have purchased but not consumed a test purchase or because of a cert mismatch.

Thanks for a step forward!

After deleting the cache and data for the Google Play App, the in app products were loaded. I can buy them with my test accounts. BUT after the confirmation of the payment I get this error:

After that, I made two new test:

  1. I created a new test account. Result: Same problems.

  2. I created a new entry in the Google Play Console with an other app id. Result: Same problems.

@happymongoose: I have only 4 products.

@Sphere Game Studios: I’m using only one certificate. Is it possible to do something wrong while creating it?

I’ve done it. :smiley:

I used the wrong Google License Key in config.lua.

If someone has the same problem, do this:

  • Go to the Google Play Console

  • Select your app

  • Open “Development Tools” - “Services & APIs”

  • Copy the long key (“Licensing & in-app billing”)

  • Paste it to your config.lua: application ={ license = { google = { key = “YOUR_KEY”  } } }

I’m glad you got this solved.

Rob

If your IAPs are fully approved they will be visible on any Google account - not just test accounts.

How can I fully approve the in app products?

Drill down into your IAPs and check their status is active.

The in app products are active. I made some screenshots to show you my google play console.

I’m happy about every idea.

In your product callback what do you get for both of these?

event.products event.invalidProducts

In your test accounts, have you confirmed the accounts are part of your alpha program by:

  • switching accounts on Google Play (on your devices)
  • clicking on the confirmation/sign-up URLs

Sometimes, I’ve found I also have to sign out of Chrome on the device, and back in using the test Google account, to make this work.

A way of testing this is trying to download the app from Google Play.  If you can’t find it, your test accounts haven’t been confirmed properly.

Simon