Numo Button Android SDK

The purpose of this SDK is to help developers to implement the NUMO Android button payment SDK

To use this SDK, you need a Merchant id ,Terminal id and Secure key.
To get your own credentials Please contact us at:

GETTING STARTED

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

You can use the below test data for testing :

DATA

Field Type Value
Merchant id String 10081014649
Terminal Id String 99179395
Secure key String 39636630633731362D663963322D346362642D386531662D633963303432353936373431

DATA

Field Type Value
Card number String 6394993077260781
EXP date String 10/23
OTP String 111111

Prerequisites

What things you need to install the software and how to install them

  1. JDK installed on your machine with minimum version 1.7 .
  2. Android Studio.
  3. Create new Android project in Android Studio to use SDK or if you have created a project before with minSdkVersion api version 19.
  4. AndroidX compatibility.

Installation

A step by step that tell you how to get our SDK in your project.

  1. Open your android project.
  2. Add the below to repositories{} inside allproject{} in your project level build.gradle file

  3. 
        maven { url 'https://jitpack.io' }
        
                    

    Example

    
        allprojects { repositories {
                maven { url 'https://jitpack.io' }
                        }
                    }
                    

  4. in your build.gradle file in app level in dependencies add:

  5. 
        implementation 'com.github.payskyCompany:NUMO-PayButton-SDK-
        android:1.0.7'
                    

    Example

    
        dependencies {
            implementation 'com.github.payskyCompany:NUMO-PayButton-SDK-
                android:1.0.7'
                    }
                    

    • Note: make sure to use the latest version of our SDK by checking the GitHub repo.

  6. Sync your project

Using the SDK

Please note that In order to use the SDK you need to get a Merchant ID a Terminal ID from MOAMALAT FINANCIAL SERVICES

  1. Create a new instance from PayButton:

        
        PayButton payButton = new PayButton(context);
                       

    You need to pass the following parameters to the PayButton class instance:
    • Merchat id.
    • Terminal id.
    • Payment amount.
    • Currency code [Optional].
    • merchant secure hash.
    • transaction Reference Number.
    And please note that you should keep your secure hash ,merchant ID and Terminal ID encrypted before saving them in storage .

    Example:

    
        payButton.setMerchantId("XXXXXXXX");
            // your merchant id 
        payButton.setTerminalId("XXXXXXXXXXX"); 
            // your terminal id 
        payButton.setAmount(0);
            // the payment amount 
        payButton.setCurrencyCode(434);
            // use 434 for the Libyan currency [Optional]
        payButton.setMerchantSecureHash("");
            // Merchant secure hash 
        payButton.setTransactionReferenceNumber("");
            // unique transaction reference number.
        payButton.setProductionStatus(STAGINIG);
            // "Use AllURLsStatus.STAGINIG for test environment, 
            //AllURLsStatus.PRODUCTION for production"
        payButton.setLang("localLang");
                                              
                             

    Reference number can be generated from AppUtils.generateRandomNumber(); example:

                           
        payButton.setTransactionReferenceNumber(AppUtils.generateRandomNumber());
        
                        

  2. In order to create a transaction you just call create Transaction method and pass to it
    • onCardTransactionSuccess method this method called in case transaction success by card payment with SuccessfulCardTransaction object
      SuccessfulCardTransaction object from create transaction listener contains:-
      • NetworkReference variable that is reference number of transaction.
      • AuthCode variable
      • ActionCode variable.
      • ReceiptNumber variable.
      • Amount variable.
    • onWalletTransactionSuccess method this method is called if customer make a wallet transaction with SuccessfulWalletTransaction object.

      SuccessfulWalletTransaction object from create transaction listener contains:-
      • NetworkReference variable that is reference number of transaction.
      • Amount variable.
    • onError method will be called with throwable exception that has the error details In case the transaction fails.
    
        payButton.createTransaction(new
        PayButton.PaymentTransactionCallback() {
            @Override
            public void onCardTransactionSuccess
                (SuccessfulCardTransaction cardTransaction) {
                    Toast.makeText(MainActivity.this,
                                    cardTransaction.toString(),
                                    Toast. LENGTH_LONG)
                                    .show();
                }
            @Override
            public void onWalletTransactionSuccess
                (SuccessfulWalletTransaction walletTransaction) {
                    Toast.makeText(MainActivity.this,
                                walletTransaction.toString(),
                                Toast.LENGTH_LONG)
                                .show();
                }
            @Override
            public void onError(TransactionException error) {
                Toast.makeText(MainActivity.this,
                                error.toString(),
                                Toast.LENGTH_LON G)
                                .show();
                });
    
                        

Sample Project

To get a sample project CLICK HERE