Subscriptions google market billing api for android - android

In my android app internaly useing some transactions in that purpose i want use *Subscriptions Google market billing *.
i googled found some sites for In-app billing and Subscriptions ,now want used Subscriptions based api but not found any code related this api.i found in-app billing code only.
please send Subscriptions based code

There is no one specific API. It is an extension of in-app billing with a new parameter and a couple of modifications in the APIs. For example, in the RequestPurchase call in BillingService.java, the item type now needs to be 'subs'. You really need to read the documentation:
http://developer.android.com/guide/google/play/billing/billing_subscriptions.html
as well as download the 'Google play billing Rev 2' from the 'Extras' from the SDK manager as that's a sample app that does subscriptions. The entire code base for it is too big to just give you but the sample app is a good start. I suspect with such a vague question, you're not going to get more details.

Related

Google play console action required to update server side billing confirmation API, but API is already using latest version

We received this error in our Google play console recently:
ACTION REQUIRED: Your server-side billing confirmations will stop working on December 1, 2019
Your app is using an old version of the Google Play Developer API. From December 1 2019, versions 1 and 2 of this API will no longer be available, and any calls to these versions will fail. Update to version 3 before this date. Note that this is not related to the AIDL/Billing Library deprecation. Learn more
However, we are currently using the correct API version3 in our server to validate our in app purchase billing receipts. An in app purchase library we're using also exposes the functionality in client side, and I've confirmed their source code is also making use of v3. Both are calling request to https://www.googleapis.com/androidpublisher/v3/applications/...
We've had real purchases be validated in production so I know it's functional and I'm trying to understand where the source of problem is.
I also read here that it might be due to third party plugins.
If anything we've recently integrated Facebook SDK which said it could do android receipt validation for us to make sure it's not reporting any fraud/sandbox purchases.
Has anyone else encountered this action required sign? If so, what steps did you take to eliminate/resolve it, and were they related to third party plugins that were using the androidpublisher apis?
Might be you are using
https://www.googleapis.com/androidpublisher/v1/applications/
For validating purchase replace V1 with V3
https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get
for validating purchase receipt from server side.

How or which Payment system do I need to use for Subscription services which are mentioned as below , Stripe Or Google's In-App Billing?

I'm currently very much confused about with which subscription service to use between any Third-party or Google's In-App billing system.
Let me explain first , I have an app which is providing service to Landlord for Posting their vacant Properties where we are providing free trial 60 Days for full app features & after trial expires I would like to add Subscription Plans as below:
Silver: Less than 50 units (monthly or yearly)
Gold: Less than 51 - 100 units (monthly or yearly)
Platinum 100 and up units (monthly or yearly)
Now I'm exploring options to include to implement this subscription features & found that Stripe would be a good option for me but soon I find out about in-app purchases guidelines where they mentioned that In-app purchases must use Google Play’s payment system & also mentioned , examples of products not currently supported by Google Play In-app Billing:
So , basically there are two questions from my side :
Can I use other payment system or should I need to use Google's Play Billing system ?
For Google's Play system , How can I divide or how many subscriptions items will be there for above subscriptions plans?
Any help would be appreciated!
You can use both services Stripe and Google IAP(In App Purchases) or just 1 of them.
I suggest that you go with Google IAP since you do not have BE(BackEnd) and as I understand would be hard for you to maintain card numbers and everything.
Google IAP provides an SDK so that you can manage subscriptions on the Play Developers Console yourself. It also provides sandbox environment so that you can test it but also Stripe does that.
Here are some references:
https://developer.android.com/google/play/billing/billing_subscriptions
https://developer.android.com/google/play/billing/billing_overview.html
but I guess you have gone through them already. In the company that I previously worked on we were developing a project with pretty much the plans you described above and we used Google IAP and Apple IAP(for iOS/tvOS) without any problems. Furthermore we were able to query Google or Apple for previous subscriptions and let customers actually renew them instead of buying new ones.
As you mentioned the leasers/landlords will not be able to pay electronic bills with Google IAP but you can integrate Paypal/Stripe/BrainTree/WePay or any other alternatives for that.
Having mentioned that I would like to answer your questions now:
1) Yes you can use Stripe instead of Google IAP
2) You can divide subscriptions and you can manage them in your Google Developers Console at https://play.google.com/apps/publish/. However that can happen after you uploaded an .apk in console with in-app-billing dependencies and also permissions.
Hope it helps!!!
Your particular scenario is a bit of a grey area.
As a precedent the Autotrader app in the UK is using direct credit card billing in-app and this is a similar service to yours - i.e they are selling listings.
This seems correct to me because in app billing is designed to be used for digital content to be consumed in the app - not for real world services. Google may even reject your app for it.
In this case my advice would actually be to use Stripe or some other billing platform.
As for your billing model - it doesn't really fit the subscription model. I don't know specifically about Stripe but with Google you can't have a subscription AND a limit on items in the way you describe. So you would have to manage the listing limits yourself on your own backend.
There are some edge cases though - what happens if you use all of your 50 listings within the month? Do I have to buy another whole subscription?
The most suitable payment model I can see for you is Metered Billing from stripe - essentially pay as you go.
I recommended to use Google's In-App Billing. Because most of country payment support by google and user first trust on google that most benefit for you.

What is the best way to migrate In-app billing Version 2 to Version 3?

I received an email from Google Wallet on Friday saying:
Our records indicate you are a Play Apps developer who may be using Google Checkout APIs for notifications or reporting. On May 20, we announced that we will be replacing these APIs.
We provided replacement Play APIs, as of July 25, and anyone using the Checkout >notifications or reporting APIs needs to implement the Play APIs by August 22 to prevent >disruption to your scripts.
If you used the Checkout API for notifications, use the Play Purchase Status API. If you >used the Checkout API for reporting, you can automate the download of your estimated sales >and earning reports via the gsutil utility
I assume that the Google Checkout APIs I must be using are in relation to the In-app Billing Version 2 implementation that I have. It relies on the Billing Service to share interprocess communications with the Google Play Store app via local notifications. So I believe that I am supposed to look into the Play Purchase Status API. I looked into it, but I wonder if there are any tutorials or better documentation for the process of transitioning from the old In-app Billing Version 2 to use the new Google Play Developer API.
The Play Purchase Status API page states:
The API is designed to be used from your backend servers as a way of securely managing in-app products and subscriptions, as well as extending and integrating them with other services.
That really adds confusion for me since all of the purchase requests and tokens are handled by the Android app on the device. My back-end server just records the information that my app sends to it via web service call. Is my back-end server now expected to periodically poll the Google Wallet servers via Play Purchase Status API?
Google has now sent out emails that yes they ARE shutting down V2 of In-App Billing. I wrote a blog post discussing how to migrate (it's more like a re-write than a migration).
http://www.innodroid.com/blog/post/migrating-from-in-app-billing-v2-to-v3
Hopefully this helps others out. V3 is totally different (although much easier to understand and maintain, in my opinion).
This has nothing to do with in-app billing version 2, or what you are using in your app. This is about the Web services formerly offered by Google Checkout, which are being deprecated. Unless your app is accessing those Web services directly, you don't have to do anything at the app side. If you have your own Web application (for reporting,etc.) that pulls data from the Google Checkout API, you have to update it or stop using it.
Announcements section from Developer Console:
Beginning January 27, 2015, we will end support for the In-app Billing Version 2 API. In-app purchases made using the In-app Billing Version 2 API will be blocked.
To help ensure that users have time to update their apps, we recommend you migrate your applications to use the In-app Billing Version 3 API by November 2014.
It looks like we should still have until November.
For those of you looking for Server-To-Server API update instructions, the only noticeable difference is that you change the "v2" to "v3" in the endpoint path.
What was previously this:
https://www.googleapis.com/androidpublisher/v2/applications/packageName/purchases/products/productId/tokens/token
Is now this:
https://www.googleapis.com/androidpublisher/v3/applications/packageName/purchases/products/productId/tokens/token
They've also added a new field called "acknowledgementState", but this seems useless. If you were using it entirely to see if your purchase was consumed and valid, then the endpoint is essentially identical.

Google Play Android Developer API

I'm developing an android application that is going to sell in-app products.
In the google documentation about "Google Play In-App Billing" there is a section called Purchase Status API. After reading this section what I've understood is that purchases verification should be done with the Google Play Android Developer API v1.1 in my backend server.
I've tried to understand the Google Play Android Developer API documentation, but I don't understand what I have to do to get an authorization token.
Please, help me!
Thanks
I've found a thread where it's explained everything. How to obtain the refresh token, how to use it to obtain a new access token, and how to use the API to query a subscription.
This is the thread where I've found the solution:
Unable to get the subscription information from Google Play Android Developer API
Hope this helps.
Have you looked at https://developers.google.com/android-publisher/authorization. This contains all the details you should need.
Basically, you login via your Google Account to the google api console, create a new project from the menu on the left and then on the list of api's on the right find the name of the api for the google play developer api and turn it on.
You will then need to follow the instruction on the web page about you create a new client.
Hope this helps.

Android and Checkout API for in app purchases

I want to know if its possible/legal(not against terms of service) to use the google checkout api for an android app to support in app purchases. The types of items being purchased would be something like extra coins where they can be purchased multiple times.
I know that this would require getting the user's credentials or pointing them to the checkout page or something. I want to know if its possible to do this within the app by opening a webview to the checkout process, and then getting a callback to a custom url on my server that will allow the app to see that the purchase was successful. Something like what the android market does for app purchases.
Thanks for any responses. I don't currently have code to show as I am researching into this before devoting time to create something I won't be able to use. Also maybe android will support native in-app purchases in newer versions of the sdk.
Spoke to (Android evangelist) Reto Meier at Google Tech Days about this and he said it is perfectly OK to do inter-app purchases in the market. You should comply to other regulations - most common is that you need to only buy content that is consumed on the mobile. Virtual "coins" are on quite thin ice, some countries ban issuing "virtual money" but you can do essentially the same with just little different paradigm. Hope this helps.
Android market documentation explicitly states that you can do check it.
http://developer.android.com/guide/market/billing/billing_admin.html#billing-refunds
Important: You cannot use the Google Checkout API to issue refunds or
cancel in-app billing transactions. You must do this manually through
your Google Checkout merchant account. However, you can use the Google
Checkout API to retrieve order information.

Categories

Resources