Skip to content
Sample for Paytabs android library
Branch: master
Clone or download
Latest commit 74c62cf Apr 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Add paytabs android SDK documentation file Oct 21, 2018
sample Add sample for SDK v3.0.0 Oct 18, 2018
sdk Add files via upload Apr 8, 2019
LICENSE Initial commit Oct 17, 2018
README.md Update README.md Apr 8, 2019

README.md

Paytabs android library sample

Paytabs-android-library-v3.0.3

For more information please see the website.

Download

Download the latest AAR:

Read the documentation to know how to integrate your application with the library documentation

implementation project(':paytabs_sdk-v3.0.3')

Library requires at minimum Java 7 or Android 4.0.

You have to include the following dependencies:

implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'

Pay now

Intent in = new Intent(getApplicationContext(), PayTabActivity.class);
in.putExtra(PaymentParams.MERCHANT_EMAIL, "merchant-email@example.com"); //this a demo account for testing the sdk
in.putExtra(PaymentParams.SECRET_KEY,"secret key");//Add your Secret Key Here
in.putExtra(PaymentParams.LANGUAGE,PaymentParams.ENGLISH);
in.putExtra(PaymentParams.TRANSACTION_TITLE, "Test Paytabs android library");
in.putExtra(PaymentParams.AMOUNT, 5.0);

in.putExtra(PaymentParams.CURRENCY_CODE, "BHD");
in.putExtra(PaymentParams.CUSTOMER_PHONE_NUMBER, "009733");
in.putExtra(PaymentParams.CUSTOMER_EMAIL, "customer-email@example.com");
in.putExtra(PaymentParams.ORDER_ID, "123456");
in.putExtra(PaymentParams.PRODUCT_NAME, "Product 1, Product 2");

//Billing Address
in.putExtra(PaymentParams.ADDRESS_BILLING, "Flat 1,Building 123, Road 2345");
in.putExtra(PaymentParams.CITY_BILLING, "Manama");
in.putExtra(PaymentParams.STATE_BILLING, "Manama");
in.putExtra(PaymentParams.COUNTRY_BILLING, "BHR");
in.putExtra(PaymentParams.POSTAL_CODE_BILLING, "00973"); //Put Country Phone code if Postal code not available '00973'

//Shipping Address
in.putExtra(PaymentParams.ADDRESS_SHIPPING, "Flat 1,Building 123, Road 2345");
in.putExtra(PaymentParams.CITY_SHIPPING, "Manama");
in.putExtra(PaymentParams.STATE_SHIPPING, "Manama");
in.putExtra(PaymentParams.COUNTRY_SHIPPING, "BHR");
in.putExtra(PaymentParams.POSTAL_CODE_SHIPPING, "00973"); //Put Country Phone code if Postal code not available '00973'

//Payment Page Style
in.putExtra(PaymentParams.PAY_BUTTON_COLOR, "#2474bc");
in.putExtra(PaymentParams.THEME, PaymentParams.THEME_LIGHT);

//Tokenization
in.putExtra(PaymentParams.IS_TOKENIZATION, true);
startActivityForResult(in, PaymentParams.PAYMENT_REQUEST_CODE);

Paytabs

Support | Terms of Use | Privacy Policy

You can’t perform that action at this time.