Android-inapp-billing-v3: Nothing happened when payment success.

Created on 29 Aug 2016  Â·  35Comments  Â·  Source: anjlab/android-inapp-billing-v3

I want to show custom dialog when payment process complete. Nothing happened when payment success, we have to click again to purchase for receiving a result. In short onProductPurchased() is useless for the first time buy click.

question

Most helpful comment

I was having the same issue, turned out I just forgot to override onActivityResult, did that and it's working.

All 35 comments

Hi i have the same problem . also the purchase is working fine. But i´m getting (after hitting the "OK" button) the error "Error ! You already own this product! and then nothing happens.

Only hitting the purchase button again will restore the purchase and it works.

would be nice to fix this ! Thanx in advance

Same issue here with suscriptions. Nothing happens when payment is complete...
Any workaround meanwhile?

No the payment is fine and works for me but the bug after buying sucks :) and i really do not now how to fix it
i hope anyone can provide a fix for this

I use this

@Override
public void onBillingError(int errorCode, Throwable error) {
    // Called when some error occurred. See Constants class for more details

    if (errorCode == 102 || errorCode == 103)
        bp.purchase(this, ITEM_ID);

}

The point is that there is no errors so onBillingError is not called.
The problem is that no feedback method is called when payment is successfully completed.

Im getting only this error here after successfull purchase in my preferencefragment
public static final int BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7;
//Failure to purchase since item is already owned
and public void onProductPurchased is not called the first time

Is this working? You tested?

On Sep 3, 2016 1:00 AM, "Musti" [email protected] wrote:

I use this

@Override
public void onBillingError(int errorCode, Throwable error) {
// Called when some error occurred. See Constants class for more details

if (errorCode == 102 || errorCode == 103)
    bp.purchase(this, ITEM_ID);

}

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/anjlab/android-inapp-billing-v3/issues/199#issuecomment-244473937,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIorey7bZRIwtHVOm_j1_gjNwni5O8idks5qmIBvgaJpZM4Jv20X
.

Who developed the library ?
Developer is reading all our comment ?

Can someone wrap it out into PR? Happy to merge it anytime

@frankyxcs I think you must consume it first to purchase the item again

@YasirAmeen Yes I tested and it works if you get this error codes

@mustii82 no i do not want to consume the purchase. One time purchase is ok for me. And i was wrong here BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7;
is not a billing error ... it´s a response

i hope somebody here is deeper with this billing stuff and maybe nows hopefully how to fix it or the developer here

there must be a bug in billingprocessor.java nearby here
else if (response == Constants.BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED) {
if (!isPurchased(productId) && !isSubscribed(productId))
loadOwnedPurchasesFromGoogle();

Ok good and what if, we have multiple products for selling, how can i
recognized them in on error.

On Sep 4, 2016 3:10 AM, "Musti" [email protected] wrote:

@YasirAmeen https://github.com/YasirAmeen Yes I tested and it works if
you get this error codes

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/anjlab/android-inapp-billing-v3/issues/199#issuecomment-244572872,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIore4PJfdXuVq8NBy9Rw3uj7hP7UR_Pks5qmfBYgaJpZM4Jv20X
.

@YasirAmeen Thats easy make a Static String lastPurchase and on every purchase attempt you can set lastPurchase with the purchased itemID and if it failed the variable lastPurchase will contain the last purchase Item ID

@frankyxcs you can't do this you must consume it the api changed so you must consume every purchase before you can buy some more of it. so consume it directly after purchase like i do

@mustii82
i have tried it now again. the purchase works fine but the 1st time onProductPurchased is not called and also i do not have any billingerror :( i have then to hit the purchase button again and everything is fine ...really do not know how to fix this little bug.

i am facing same error as @frankyxcs

after purchased it say "Error ! You already own this product!"

and did not called onProductPurchased

@frankyxcs you can use purchase("ITEMID") on onProductPurchase()

thats a hot fix

@mustii82
you mean onProductPurchased() ? but this is not called the 1st time. so it would be useless
or i do not understand now what you mean

@umashankarpandey @frankyxcs i'm seeing this same bug as well.

override the purchase method the Library is very buggy but I think this is a good hot fix

@Override
public purchase(String id){
super.purchase(id);
super.purchase(id);
}

Hm, i'm not sure that's a good hot fix. Any idea if this repo is still being maintained? I know the issue count is pretty high and it's been a few months since a commit. I wonder if one of the devs would be available to work on this library.

Unfortunately this looks like the only IAP billings libraries.

Anyone hast tested the library from this guy here yet ? It´s based on this library
https://github.com/pavlospt/RxIAPv3
Just downloaded this and i will check this out later. hopefully it will work with my preferencefragment

@caman9119 I never said that this hot fix is the best solution but a quick one thats because it called hot fix. this library is not the only IAP Library for Android

@mustii82
thanx i will try this out later too how it works..but it would be very good if the developer here could fix the library or another person who is deeper involved with all the billing stuff.

so i have to put this into billingprocessor.java ??
@Override
public purchase(String id){
super.purchase(id);
super.purchase(id);
}

@mustii82 Sorry, didn't mean it negatively. I'll test it out though.

Hi All

i think this lib has no issue because i am using Trivial Drive suggested by android

after purchased success when press "OK" it say "Error ! You already own this product!"
and did not called onProductPurchased

This is error due to google policy

for first Time if product cost is 60 INR

then google deduct 60+50(as $1) 50 for google account verification once it is verified then it google will return you amount 50INR

after this for next purchase you will be never charged extra

and no errors as we are mentioned

promo codes also will be working after this

so try first purchase only with credit card

Thanks to all of you

@umashankarpandey so are you sure about that ? can we use it in a production app ?

Bro can i have your whatsapp contact bro ? email me here [email protected]

+919711090237 whatsapp and [email protected] email i just send you an email also

one more suggestion is that there is some issue with handleActivityResult. Can someone who face this error can confirm that its actually being called as per README?

I have this same problem just now. handleActivityResult is being called. requestCode is 32459, resultCode is -1.

I was having the same issue, turned out I just forgot to override onActivityResult, did that and it's working.

Check above my answer please

Was this page helpful?
0 / 5 - 0 ratings

Related issues

najam-amfnrh9 picture najam-amfnrh9  Â·  6Comments

RajatVaghani picture RajatVaghani  Â·  8Comments

RishabhTayal picture RishabhTayal  Â·  3Comments

mattiaferigutti picture mattiaferigutti  Â·  6Comments

pro-guitar picture pro-guitar  Â·  6Comments