anjlab / android-inapp-billing-v3

A lightweight implementation of Android In-app Billing Version 3
Other
2.19k stars 535 forks source link

Nothing happened when payment success. #199

Open YasirAmeen opened 8 years ago

YasirAmeen commented 8 years ago

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.

frankyxcs commented 8 years ago

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

joshid commented 8 years ago

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

frankyxcs commented 8 years ago

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

mustii82 commented 8 years ago

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);

}
joshid commented 8 years ago

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.

frankyxcs commented 8 years ago

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

YasirAmeen commented 8 years ago

Is this working? You tested?

On Sep 3, 2016 1:00 AM, "Musti" notifications@github.com 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 .

YasirAmeen commented 8 years ago

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

serggl commented 8 years ago

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

mustii82 commented 8 years ago

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

mustii82 commented 8 years ago

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

frankyxcs commented 8 years ago

@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();

YasirAmeen commented 8 years ago

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" notifications@github.com 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 .

mustii82 commented 8 years ago

@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

mustii82 commented 8 years ago

@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

frankyxcs commented 8 years ago

@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.

umashankarpandey commented 8 years ago

i am facing same error as @frankyxcs

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

and did not called onProductPurchased

mustii82 commented 8 years ago

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

thats a hot fix

frankyxcs commented 8 years ago

@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

ItsCalebJones commented 8 years ago

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

mustii82 commented 8 years ago

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); }

ItsCalebJones commented 8 years ago

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.

frankyxcs commented 8 years ago

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

mustii82 commented 8 years ago

@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

frankyxcs commented 8 years ago

@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); }

ItsCalebJones commented 8 years ago

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

umashankarpandey commented 8 years ago

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

YasirAmeen commented 8 years ago

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

umashankarpandey commented 8 years ago

Yes sure bro i am using it in my app https://play.google.com/store/apps/details?id=com.spraato.teenpatti

YasirAmeen commented 8 years ago

Bro can i have your whatsapp contact bro ? email me here yasirameen92@gmail.com

umashankarpandey commented 8 years ago

+919711090237 whatsapp and uspmca@gmail.com email i just send you an email also

serggl commented 7 years ago

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?

franciscofranco commented 7 years ago

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

curliq commented 7 years ago

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

umashankarpandey commented 7 years ago

Check above my answer please