Skip to content

A simple library to grant easy access to the Pesapal portal on the android platform.

License

Notifications You must be signed in to change notification settings

kevinomyonga/PesapalDroid

Repository files navigation

PesapalDroid

A simple library to grant easy access to the Pesapal portal on the android platform.

##Preview

Demo

Click below to watch a quick demo.

IMAGE ALT TEXT HERE

Try out the app here:

Play Store Badge

Screenshots

ScreenShot ScreenShot

##Target Platforms Android API level 9 or later.

Setup

1. Get the Keys

Head over to the Pesapal website (https://www.pesapal.com) to register as a merchant and get the Consumer Key and Consumer Secret.

2. Provide the gradle dependency

dependencies {
    compile 'com.kevinomyonga.pesapaldroid:library:1.0.0'
}

3. Declare the fragment

Xml

<fragment xmlns:pesapal="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:name="com.kevinomyonga.pesapaldroid.PesapalDroidFragment"
        android:id="@+id/payment_fragment"
        pesapal:consumer_key="@string/consumer_key"
        pesapal:consumer_secret="@string/consumer_secret"
        pesapal:is_demo="false"
        pesapal:is_mobile="true"
        tools:layout="@layout/fragment_main" />

or

Java

        PesapalDroidFragment pesapalDroidFragment = new PesapalDroidFragment();
        pesapalDroidFragment.setConsumerKey(getString(R.string.consumer_key));
        pesapalDroidFragment.setConsumerSecret(getString(R.string.consumer_secret));
        pesapalDroidFragment.setDemoEnabled(false);
        pesapalDroidFragment.setMobileEnabled(true);

        // Insert the fragment by replacing any existing fragment
        getChildFragmentManager().beginTransaction()
                .replace(R.id.content_frame, pesapalDroidFragment)
                .commit();

Additional Setup

Passing values to the portal

        //Pass the buyer details
        pesapalDroidFragment.setfName(args.getString("fname"));
        pesapalDroidFragment.setlName(args.getString("lname"));
        pesapalDroidFragment.setEmail(args.getString("email"));
        pesapalDroidFragment.setPhone(args.getString("phone"));
        pesapalDroidFragment.setDesc(args.getString("desc"));
        pesapalDroidFragment.setAmount(args.getString("amount"));

Acknowledgments

Davide Parise bubini.mara5@gmail.com

License

This project is licensed under the Apache License - see the LICENSE file for details.

About

A simple library to grant easy access to the Pesapal portal on the android platform.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages