How does one find Google play billing authentication details? - android

I am trying to understand how does the google play billing library authenticate.
All the tutorials start with BillingClient but how does billing client know which account to connect how do I pass authentication credentials to it and more importantly where do I get those credentials.
I checked google play billing documentation before asking here and multiple other docs but everyone assumes the developer has the information magically without need to explain.
When I try to use the client without any credentials I just keep getting disconnection errors.

Google Play Billing library authenticates with your Google Play Application Id which is already defined in google-services.json or string variables on your android project. When you check on Google Play Console you will see there is no extra credentials and so you can retrieve in app purchase sku list by their own keys you defined of each product or subscription.

Related

android purchase in app money not received

I want to add an android in-app payment method, so I followed instructions by this page using AIDL
I successfully added it and tried to do an effective payment using my personal google account. The payment was successful but I didn't receive the money.
I know that, implementing this type of purchase, a user can buy add-on app features or simply make a small donation. Isnt' it? Is there a better method to do that?
As Google say in billing testing: To test your Google Play Billing implementation with actual in-app purchases, you must use a test account. By default, the only test account registered is the one that's associated with your developer account.
Money not charged if you account equivalent to you Google Play account.
Also you can try to use more convenient library from google for in-app billing

Google Play InApp Billing Purchase Error

I implemented google play IAB sdk but when I run the application I got the following message:
Authentication is Required. You need to sign into your Google Account.
Although I published the application on Developers Console and also I double check the ProductID.
I guess you are testing your app directly from Android studio, you have to create a closed beta, add your email to testers and publish.
Use only signed APK to test inapp purchase with same version code and version name as you have in published APK on google console
Also add your email to tester
In addition to #Tinco De Simone's answer, maybe you are trying to access wrong item id from the console. From this thread, "In the developer console subscription item had id "premium" and I've tried to access "premium_version" item". Double check if the itemID fits with id that you request in your app.
Also be noted that it might take up to 6-8 hours before a newly created in-app product is available.
You may also check this related SO quesiton: Android IAB. Error - Authentication is required. You need to sign into your Google Account
This message indicates that, may be you are not logged in with any Google account in your testing device, as Google pay always requires a Google account to purchase anything from play-store.

Implement InApp Purchase in an existng project of Android?

I am working on a android project where I received an enhancement from client to add in App Purchase to add certain points in the game. So the player can increase his life by using in app purchase. I have checked the sample app provided by google and also configured inApp purchase same as it was doing. Now I want to do it from my live account so that live account can be used for testing and in live app.
Please provide links and steps by which I can get the details which I need to set in my application such as AppID etc.
Thanks in Advance.
Add your email id to the testers account on google developer console.
Add the iap products in google developer console.
Sign the build with live keystore.
Do inapp. (Make sure that the prompt that comes up says This is a test account bla bla)

Is it possible to get list of in-app purchases from Google Play API directly to my server?

I need to integrate google play in-app purchases with my server-side billing.
Any way to get list of in-app purchases via some Google Play API to my server without client app in between?
Tried to find anything relevant in documentation and all I found is status check API which gives you status of specific purchase, but I need to get list of purchases too.
Okay, it's possible via Callback functions in Integration tab of Settings page but only if you have classic Google Checkout account.
If you just registered as Android Developer — you have a different type of account and those options are unavailable for you.
No way to sign up for classic account as Google Checkout is being substituted by Google Wallet and no way to change account time once you are registered.
sarcasm on:Thank you, Google!:sarcasm off

Android in-app billing developer payload

I would like to implement in-app billing in my android app, but I am not sure how should I create for a developer payload. I don't have any information about user, only unique identifier created in the app to recognize it.
Is it possible to restore the purchase when the user buy a product, then uninstall the app and install it again? How to test it, because I didn't get any events when I tried to test it?
Yes, you can check the completed purchase after uninstall app and install it again.
All purchased items stored on the Play Server and particularly in your installed Google Play app. So after item is purchased once the information about purchase is stored and you can request it at any time untill you "consume" this purchase. "Consume" means reset the information about purchase to allow make new purchase with same ID. This is only for v3 if Android Billing Library, because all purchases in v3 are one-off (you can buy it only once) and have to be "consumed" to be purchased again.
The identifier of the purchase item is a simple string that you define in the Google Developer Console. You should login to the developer console, create new project for the future app, upload signed .apk (necessary), after that you have to select the project, move to "In-App products" section and there you can create necessary purchase items with purchase IDs. While purchase action in the application you should pass the matched purchaseID to the launchPurchaseFlow() method on the IabHelper object (these are all from v3 Billing Library). The information about purchased items can also be received by using matched purchaseID.
Official Google developer documentation has pretty decent amount of information about implementing and using Billing Library:
Implementing billing library guide
Administering In-App products in the developer console
Testing In-app billing. Sorry, cannot post link because of lack of reputation (2 links in answer only), but you can also find this section in the official android documentation. This section also has information about testing with special android test purchase IDs which doesn't require signed and uploaded .apk or any actual money-transfers

Categories

Resources