Android SDK
The Android SDK is designed to allow the integration of KKiaPay into your mobile application.
Integrating the Android SDK into your mobile application will require adding these few lines of code to your build.gradle file :
Required for further integration your API key is available on your dashboard.
In the singleton class of your application: the one that extends the Application class of the Android framework, add the following code in the onCreate method:
Initialized to true the enableSandbox attribute allows you to switch to test mode.
The SdkConfig parameter of the above function is optional. It allows you to configure your preferences.
The SDK is now initialized. Add a listener to it to hear the payment status events.
For example, add the following lines of code within the onCreate method of your activity.
Within the onActivityResult method of your activity, add the handler
Once the environment is ready, trigger a payment request in your application with the following code:
The parameters of the function are:
The context of the activity
The amount to be debited to the customer (without charges)
The reason (Example: The object, the description of the service purchased, the description of the product...)
The name of the customer
Phone number (Optional)
The different statuses
STATUS | DESCRIPTION |
SUCCESS | The payment was successfully made |
INSUFFICIENT_FUND | The customer does not have enough money in his account |
FAILED | The payment failed or was declined by the customer |
Last updated