Google In-App Purchase testing with Static Responses

Google recommends first testing In-App Purchases with “Static Reponses” (https://developer.android.com/google/play/billing/billing_testing.html#billing-testing-static)

If I understood correctly, after Initialization, I just:

store.purchase( {“android.test.purchased”})

But I’ll get an error code:

Unable to buy item (response: 5:Developer Error)

I managed to get the product information like prices from the Google, but I’m stuck with this testing.

I’m testing with a device and I’m logged in with my developer account.

Thanks!

I believe for Android, you do not put the items in brackets…

store.purchase("android.test.purchased")

Alsso, (it’s been a while since I tested this), but Google does not allow you to purchase your own items, even in test mode.  You may have to go into your Android Developer Console and add some testers.

–john

Thanks schizoid2k,

Unfortunately this was not the case (just tested). First if testing with Reserved Product IDs you have test with your developer account (Documentation: Sign in to your device with your developer account.)

And I tried also with this without brackets. Still the same error code.

Sorry that didn’t work.

Just throwing out some more suggestions:

I just checked a bit, and in my app, I am not using brackets in the purchase call for Android.  

Also, I see that I added myself as a tester in the Android Developer Console.

Finally, I think I had to upload a beta version to test IAP… I could not side-load the app directly.

There are some permissions required in build.settings

Perhaps one or more of these will help?

schizoid2k, I really appreciate your help! And you know what. Because I started to write a specific answer what I’ve done to you, I noticed one mistake! And a really stupid one :wink:

I had everything right, but for some strange reason my Version Name in Corona’s Build Window for incorrect. It’s a bit strange that I could publish an alpha test version without any problems.

In brief: Version Name and Version Code should be the same as in the released APK in Google Play Developer Console.

Glad it’s working!  :slight_smile:

I believe for Android, you do not put the items in brackets…

store.purchase("android.test.purchased")

Alsso, (it’s been a while since I tested this), but Google does not allow you to purchase your own items, even in test mode.  You may have to go into your Android Developer Console and add some testers.

–john

Thanks schizoid2k,

Unfortunately this was not the case (just tested). First if testing with Reserved Product IDs you have test with your developer account (Documentation: Sign in to your device with your developer account.)

And I tried also with this without brackets. Still the same error code.

Sorry that didn’t work.

Just throwing out some more suggestions:

I just checked a bit, and in my app, I am not using brackets in the purchase call for Android.  

Also, I see that I added myself as a tester in the Android Developer Console.

Finally, I think I had to upload a beta version to test IAP… I could not side-load the app directly.

There are some permissions required in build.settings

Perhaps one or more of these will help?

schizoid2k, I really appreciate your help! And you know what. Because I started to write a specific answer what I’ve done to you, I noticed one mistake! And a really stupid one :wink:

I had everything right, but for some strange reason my Version Name in Corona’s Build Window for incorrect. It’s a bit strange that I could publish an alpha test version without any problems.

In brief: Version Name and Version Code should be the same as in the released APK in Google Play Developer Console.

Glad it’s working!  :slight_smile: