A simple library to grant easy access to the Pesapal portal on the android platform.
##Preview
Click below to watch a quick demo.
Try out the app here:
##Target Platforms Android API level 9 or later.
Head over to the Pesapal website (https://www.pesapal.com) to register as a merchant and get the Consumer Key and Consumer Secret.
dependencies {
compile 'com.kevinomyonga.pesapaldroid:library:1.0.0'
}
<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
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();
//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"));
Davide Parise bubini.mara5@gmail.com
This project is licensed under the Apache License - see the LICENSE file for details.