CinetPay SDK-ANDROID integration


This package allows you to invoke the CinetPay payment gateway, make a payment and wait for the status of the initiated payment to the second after the payment is completed

🔗 The steps

The use of the package is the simplest possible, in its use, it is to invoke it with :

  • The initialization parameters of the counter
  • The data related to the payment

🛠 Installation

Start the installation by cloning CinetPay Android SDK on Github

  • Add com.cinetpay:androidsdk to your build.gradle dependencies
    dependencies {
    implementation 'com.cinetpay:androidsdk:1.0.0'
    }

Initialization of the counter

To function, the counter must receive data such as :

  • apikey | The merchant ID | String | Mandatory
  • site_id | The service identifier | Integer | Obligatory
  • notify_url | Valid payment notification | URL | Mandatory

Payment data

In order to make the payment, some data must be submitted to prepare the counter. Thus, we have :

  • amount | Payment amount (>= 100 XOF) | Integer | Obligatory
  • currency | Currency of payment (XOF - XAF - CND - GNF - USD) | String | Obligatory
  • Transaction_id | The transaction identifier. It must be unique for each transaction| Obligatory.
  • description | The description of your payment| Obligatory.
  • channels | The payment universe. Can be: ALL - MOBILE_MONEY - CREDIT_CARD - WALLET. Default: 'ALL' Any combination is applicable to comma separated: 'MOBILE_MONEY, WALLET' | Character string | Optional
  • metadata | String | Optional
  • customer_name | Customer name * | Character string | Optional
  • customer_surname | First name of the buyer * | String | Optional
  • customer_email | Buyer's email address * | String | Optional
  • customer_phone_number | Buyer's phone number * | String | Optional
  • customer_city | Buyer's city * | Character string | Optional
  • customer_country | Buyer's country. ISO2 country code (CI => Ivory Coast). Optional
  • customer_state | String| Buyer's state (when USA is used as country) * | String | Optional
  • customer_zip_code | Buyer's Zip Code * | Character string | Optional

    Note : * Mandatory if using the banking universe (CREDIT_CARD)

Use of the package

To initiate a payment add your credentials in the: app/src/main/java/com/cinetpay/androidsdk/sample/activities/MainActivity.java

    String api_key = ""; // TODO A remplacer par votre clé API
    String site_id = ""; // TODO A remplacer par votre Site ID

Management of responses

The different answers of the requests (success or error) are registered in the log : app/src/main/java/com/cinetpay/androidsdk/sample/MyCinetPayWebAppInterface.java

    @Override
    @JavascriptInterface
    public void onResponse(String response) {
        Log.d("MyCinetPayWebApp", response);
    }

    @Override
    @JavascriptInterface
    public void onError(String response) {
        Log.d("MyCinetPayWebApp", response);
    }
android