j3k0 / cordova-plugin-purchase

In-App Purchase for Cordova on iOS, Android and Windows
https://purchase.cordova.fovea.cc
1.29k stars 529 forks source link

This item is not available for purchase #413

Closed ragrep closed 8 years ago

ragrep commented 8 years ago

Hi, I'm trying to run on Android. I keep getting this error "This item is not available for purchase" I set the test account and downloaded from the link (opt-in) provided in the console.

Help!!!

ragrep commented 8 years ago

code:

store.register({ id: 'coins2', alias: 'test2', type: store.CONSUMABLE });

        store.error(function (error) {
            console.log('ERROR ' + error.code + ': ' + error.message);
        });

        var product = store.get("coins2");

        store.when("test2").approved(function (product) {
            product.finish();
        });

        store.refresh();
    }

    function buyCoin() {
        store.order('coins2');
    }
AbuHani commented 8 years ago

make sure the product status is active ?

ragrep commented 8 years ago

yes, from yesterday

ragrep commented 8 years ago

I have 3 active products

JohnWeidner commented 8 years ago

Make sure that the versionCode that's in your AndroidManifest.xml for the build that you have on your phone is the same as the versionCode for your app that you uploaded to the Google developer console.

ragrep commented 8 years ago

Yes, I check is same version

AbuHani commented 8 years ago

use the same test account you specified in developer console.

ragrep commented 8 years ago

I created a test user (including g +) and placed on developer console> settings> Gmail accounts with testing access

ragrep commented 8 years ago

This user then has been enabled for alpha testing and shared the opt-in link and apk version is correct. I am going crazy!!!

AbuHani commented 8 years ago

try use different account ?

ragrep commented 8 years ago

Yes, I try with 2 account

ragrep commented 8 years ago

I always have same result

mparpaillon commented 8 years ago

I'm not sure it will solve your issue but I think I had the same issue when adding a new item to purchase. I had to upload and publish the APK in alpha stage before it appears available in app

mparpaillon commented 8 years ago

It can be alpha, beta or public release but I guess that you want to test it before publishing it, so go for alpha stage then try again... hope this helps

JohnWeidner commented 8 years ago

When you make a changes in Google's Developer Console to your In-app items, APK, or product settings, it can take a couple of hours before those changes become active. This makes debugging this issue extra hard because you must wait between changing something on google and testing to see if it made any difference.

  1. Make sure the In-App product shows a status of Active on the developer console.
  2. Make sure the In-App product id matches what your using in your app
  3. Make sure the build version listed on Google matches what's in the app you are testing
  4. Make sure the app is published (alpha, beta, or prod) in the google developer console

Watch the adb log as you run your app to see if an error is being displayed.

ragrep commented 8 years ago

I checked all the points you've described and are ok

AbuHani commented 8 years ago

try clear play store data from mobile ?

ragrep commented 8 years ago

I tried but it does not work

ragrep commented 8 years ago

I added the plugin by PhoneGap build, it could be a problem ?

ragrep commented 8 years ago

https://www.npmjs.com/package/cc.fovea.cordova.purchase

ragrep commented 8 years ago

Hi guys, I created a new empty app to run the tests. The first time I was able to buy the product (success). Now from any device / users the app no longer works.

ragrep commented 8 years ago

Now I get this error:

ERROR 6777001: Init failed - Failed to query inventory: IabResult: Error refreshing inventory (querying owned items). (response: 6777017:Error)

AbuHani commented 8 years ago

76

ragrep commented 8 years ago

With the app published in alpha state gave an error when closing the order and also every time that I tried to initialize the store. I think the problem is in the signature key, I managed to solve by publishing the apk also in production.