sammie-gh / SlydepayAndroidSDK

An android sdk to help developers easily integrate the Slydepay SDK into their applications to accept mobile money and credit card payments.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SLYDEPAY ANDROID SDK

This is a sample project to show how to use the slydepay sdk to accept mobile money from several networks and credit card payments in your android apps.

PREVIEW


Payment Options Mobile Money Visa Success Error
Payment Options Mobile Money Visa success Error occured

Skip this if you have an active Merchant Account


Create a Merchant Account on Slydepay

Follow the link to get started on that: (Slydepay Merchant Account)

How to install


To use the sdk in your project:

  1. Download the project zip file.
  2. Unzip the file.
  3. In android studio right file -> new - import module and go to the path for the zip file -> open the folder -> and click on paywithslydepay.
  4. Change the name of your module if you wish and click next.
  5. Wait till the build finishes and you now have the paywithslydepay sdk.

From Android Studio :

->Right click your project folder 
        ->Open Module Settings 
                ->Select the Dependency Tab 
                          ->Tap on the green plus sign on the right and select "Module dependency" 
                                    ->You would see the "paywithslydepay" module. Select it.

Tap on OK and you are good to add it in your build.gradle file.

Usage


  1. Initialize sdk preferably in your Application class to avoid initializing it multiple time. How to create an Application class
//merchantEmail and merchantKey refers to the credentials associated with your merchant account from SLYDEPAY
  new SlydepayPayment(YourActivity.this).initCredentials.initCredentials(merchantEmail,merchantKey);
  1. Performing transactions.
//Performing transaction with provided ui
PayWithSlydepay.Pay("itemName",amount,"description","customerName","customerEmail","orderCode","phoneNumber",requestCode);
 
//Listen for results
@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

            if(requestCode==YOUR_REQUEST_CODE)
            {
                switch (resultCode){
                    case RESULT_OK:
                        //Payment was successful
                        break;
                    case RESULT_CANCELED:
                        //Payment failed
                        break;
                    case RESULT_FIRST_USER:
                        //Payment was cancelled by user
                        break;
                }
        }
    }

You can now recieve payments through your app with Slydepay

Special Thanks

@Knesis For his sdk Slydepay-android-sdk-with-sample

TODO

  • Write tests.
  • Singleton approach.

About

An android sdk to help developers easily integrate the Slydepay SDK into their applications to accept mobile money and credit card payments.


Languages

Language:Java 100.0%