Skip to content

ybanezmi/android-sdk

Repository files navigation

Kkiapay

Build Status Download

Kkiapay is developer friendly solution that allows you to accept mobile money and credit card payments in your application or website.

Before using this SDK, make sure you have a right Merchant Account on Kkiapay, otherwise go and create your account is free and without pain 😎.

Installation

Android Studio ( or Gradle )

To add kkiapay in your android app, just add the following line in your app's build.gradle file inside dependencies section

implementation 'co.opensi.kkiapay:kkiapay:+'

Don't worry about changes, we will maintain backward compatibility of this sdk

Usage

Get your API Key on kkiapay Dashboard at Developer section and initialize the Sdk in Application Class or Activity

Kotlin

You still use java ? 😦, jump to this section 😦

Initiate the API
KkiaPay("<kkiapay-api-key>")

Quick payment request

"22967434270" debit 100
//To recover 100 XOF from account (674324270)

To manage request status you should process like this

 ("22967434270" debit  100) { status, phone, transactionId -> when (status) {

               STATUS.SUCCESS -> // payment is succed
               STATUS.INSUFFICIENT_FUND -> // user haven't enough money
               // .....
            }

        }

Complete payment request with user's data

// subscrber details are usefull on dashboard.kkiapay.me
  from {
          phoneNumber = "22967434270"
          firstName = "ALI"
          lastName = "SHAD"
          
  }.debit(100) { status, phone, transactionId ->
        //handle response
   }

JAVA

Initiate the API
KkiaPay api = new KkiaPay("<your-api-key>");

Request a payment

 api.from("22967434270")
        .debit(1500, new KKiapayCallback() {
           @Override
           public void onResponse(@NotNull STATUS status,
            @NotNull String phone, @NotNull String transactionId ) {
            
               switch (status) {
                     
                  case FAILED :
                           // .....
                        break;
                  case SUCCESS :
                          //....
                        break;
                  case INSUFFICIENT_FUND :
                        //...
                      break;
                }           
               
       }
  });

Add subscribers details to request

// subscrber details are usefull on dashboard.kkiapay.me
 Subscriber subscriber =  new Subscriber("22967434270","ALI","SHAD");
        
 manager.from(subscriber)
        .debit(1500, new KKiapayCallback() {
           @Override
           public void onResponse(@NotNull STATUS status,
            @NotNull String phone , @NotNull String transactionId ) {
               //handle response

     }
  });

COMPLETE STATUS LIST

STATUS DESCRIPTION
SUCCESS
FAILED
INSUFFICIENT_FUND
INVALID_PHONE_NUMBER
INVALID_API_KEY

Testimony ❤️

GoMedical MTN MOMO SHOP

LICENSE

    The MIT License
    
    Copyright (c) 2018 Open SI, . http://opensi.co
    
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.

About

Android Sdk for KKIAPAY API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 95.3%
  • Java 4.7%