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:
- e-mail ecomm.support@moamalat.net
- tel 0910003325
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
- JDK installed on your machine with minimum version 1.7 .
- Android Studio.
- Create new Android project in Android Studio to use SDK or if you have created a project before with minSdkVersion api version 19.
- AndroidX compatibility.
Installation
A step by step that tell you how to get our SDK in your project.
- Open your android project.
- Add the below to repositories{} inside allproject{} in your project level build.gradle file
- in your build.gradle file in app level in dependencies add:
- Sync your project
maven { url 'https://jitpack.io' }
Example
allprojects { repositories { maven { url 'https://jitpack.io' } } }
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.
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
- Create a new instance from PayButton:
PayButton payButton = new PayButton(context);
- Merchat id.
- Terminal id.
- Payment amount.
- Currency code [Optional].
- merchant secure hash.
- transaction Reference Number.
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");
payButton.setTransactionReferenceNumber(AppUtils.generateRandomNumber());
-
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(); });
-
onCardTransactionSuccess method this method called in case
transaction success by card payment with SuccessfulCardTransaction
object
Sample Project
To get a sample project CLICK HERE