See:
Description
Packages | |
---|---|
com.globalcharge.android |
This document is intended to provide an overview of the Globalcharge Android in-app billing Library (GAL) and ways in which it may be integrated to a developer's Android application. The GAL is a self-contained Java Archive (JAR) file that can be included in the classpath of your Android application. The GAL allows Android application developers to charge mobile users through their mobile phone accounts. The GAL was designed to minimise the integration process as well as the billing data held by the developer while not compromising the library’s seamless user experience.
There are two types of subscription payments:-
For GlobalCharge managed subscriptions, the integration is as simple as one-off payment integration and exactly follows the same steps; the GlobalCharge subscriptions engine subscribes users and triggers the recurring subscription transactions at the subscribed payment intervals.
The Client-managed subscriptions type allow the client to retain scheduling control of subscriptions within their subscriptions engine and notifies GlobalCharge’s billing system when to bill the user. This type of subscription requires a custom integration with the developer's existing subscription engine. However, developers still have to integrate to the GAL as normal.
This document just focuses on the client-side integration for both subscription and one-off payments. The client-side integration is a four step process:-
com.globalcharge.android.PaymentListener
(see the sample Eclipse Project named GC_Sample) com.globalcharge.android.BillingManger
to initiate the transaction (see the sample Eclipse Project named GC_Sample)
The GAL can display the appropriate product selection screens (price selection screen) for each country, take selection from users, and display confirmation and notification screens whilst handling regulatory requirements, internationalisation, etc. With this approach, the client needs only to initiate payment by passing the accountId only once and finally, the GlobalCharge Billing System will notify the application and/or the server web-service the outcome of the billing transaction. GlobalCharge's terminology for this kind of setup is 'ONE STEP BILLING'.
TWO STEP BILLING
However, if there is a requirement to display the product selection screens within the client application, outside of the GAL, a flag can be set to indicate this to the GAL, which will then silently return the list of products available for the user's country on your account and not display the price selection screen. The client application will therefore take the price selection from the user and pass the selected product back to the GAL. GlobalCharge's terminology for this kind of setup is called 'TWO STEP BILLING'. It is two steps because first the application must initiate the payment, then the GAL accepts that and returns a list of products to the client application. Once the client application takes the product selection from the user, it calls the GAL again to request billing for the purchase of the selected product.
- com.globalcharge.android.BillingManger.Environment.LOCAL
- com.globalcharge.android.BillingManger.Environment.TEST
- com.globalcharge.android.BillingManger.Enviroment.PRODUCTION
Environment.LOCAL
allows developers to test the integration without connecting to GlobalCharge's billing servers. It retrieves products and account configuration information from a sandbox server embedded into the GlobalCharge Android Library (GAL). This is the first stage of integration.
Environment.TEST
allows developers to test the integration with GlobalCharges Test server which is a clone of the Production server. To test the integration on the Test Platform, the developer will need a unique account and products setup. This is the second stage of integration. Enviroment.PRODUCTION
allows developers to connect to the production platform. This is the default behaviour if the Environment MODE is not set. Similarly, when using this mode the developer will need prior Account and Product setup for the application. This is the final stage of integration before going live.