Android Library


Seamless integration for one-tap purchase.

We've built the Android Library to provide you with easy and seamless integration of Android in-app payments with all the cool features like one-tap payment. Just import the library into your project and start using in-app payments from your Android app.


How does it work?


  1. User wants to make the payment within your application and taps the PayByMobile button.
  2. Our library pops up a dialog box, displaying localised information about the payment.
  3. User taps the "Yes" button to confirm payment.
  4. Transaction is completed and your application is triggered via the appropriate callback method.

Android Library

By using our solution, you will have more time to focus on your application while we take care of the complexities of the payment process.


Integration


The following source code represents the usage of the Centili Android Library. The only thing you need to do is to implement callback methods which will be triggered by the following events:


  • Purchase process initiated - Library displays the progress bar.
  • Purchase Cancelled by the user - User taps the "No" button.
  • Purchase failed – Library has been notified by the server that the purchase process has failed.
  • Successful Purchase.

public void onPurchaseButtonClick(View v) {

    PurchaseManager.attachPurchaseListener(new PurchaseListener() {
        @Override
        public void onPurchaseSuccess(PurchaseResponse paramPurchaseResponse) {
            //TODO: Called when purchase has been successfully completed
        }
        
        @Override
        public void onPurchaseFailed(PurchaseResponse paramPurchaseResponse) {
            //TODO: Called when purchase has failed
        }
        
        @Override
        public void onPurchaseCanceled(PurchaseResponse paramPurchaseResponse) {
            //TODO: Called when purchase is canceled by user
        }
        
        @Override
        public void onPurchasePending(PurchaseResponse paramPurchaseResponse) {
            //TODO: Called when purchase process has been started
        }
    });

    PurchaseRequest pr = new PurchaseRequest("YOUR_API_KEY");
    PurchaseManager.startPurchase(pr, this);



Would you like to create your own payment service? No problem! Check out our Unified Payment API.



Would you like to know more about in-app payments?

Get your free account in no time or contact us for more information.