Step 1 - Setup and activate the integration method
PayTabs Mobile SDKs streamline the integration process with the PayTabs payment gateway by offering a pre-configured payment interface. This interface efficiently manages card data entry, billing and shipping information, and automatically supplements any missing details required to complete the transaction flow.
System Requirementsβ
To start integrating your system through this SDK, kindly make sure of the following system requirements first to avoid any environmental issues:
- Having a PayTabs merchant account relative to your country.
- "No external dependencies needed"
Setup, Activate and Upgrade the integration methodβ
we will walk you through how to manage the setup of our Android SDK from scratch. You will be introduced to how to install the SDK, activate it, and upgrade it as well if needed. You will be also introduced to how to uninstall it as well if needed. Kindly take your time in reading and simulate the following guidelines:
How to install and activate this SDK?β
Details
You can install this SDK into your native Android project as clarified below:
That for the version number, please use the latest version according to our latest update on our repository
A native android code means that it's developed using Android framework classes like Activity, Fragment, and View where only the Android SDK applications need an emulator or device to run. To integrate PayTabs SDK into your native Android project, specify it in your dependencies file:
dependencies {
implementation 'com.PayTabs:payment-sdk:X.X.X'
}
Then after that, you will receive a notification message asking you if you want to synchronize the dependencies file as you just modified it. Kindly approve the "Sync Now" option as shown below:
Additional Stepsβ
In some cases such as using Kotlin Coroutine or enabling the Proguard in your Android project, you will need to perform additional steps to avoid any dependency issues as clarified below:
- Kotlin Coroutine
A coroutine is a concurrency design pattern that you can use on Android to simplify code that executes asynchronously. Coroutines were added to Kotlin in version 1.3 and are based on established concepts from other languages. To avoid the "Duplicated class" dependency conflict issue with the coroutine API, kindly add the following lines to your application's Gradle file.
<project-root>/app/build.gradleconfigurations.all {
resolutionStrategy {
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
}
} - Proguard
ProGuard is an open-source command-line tool that shrinks, optimizes, and obfuscates Java code. It is able to optimize bytecode as well as to detect and remove unused instructions. You will need to exclude the library classes in the Proguard rules file as shown below:
<project-root>/app/proguard-rules.pro-keep public class com.payment.paymentsdk.**{*;}
How to deactivate the SDK?β
Nothing you have to do from your side in this step as our SDKs don't need activation, once you installed it properly, it will be considered activated automatically and ready for use.
How to upgrade the SDK?β
Details
A native android code means that it's developed using Android framework classes like Activity, Fragment, and View where only the Android SDK applications need an emulator or device to run. To upgrade the PayTabs SDK that has been built in your android project using Native Android, specify it in your dependencies file with the new SDK version you wanted to upgrade to:
dependencies {
implementation 'com.PayTabs:payment-sdk:X.X.X'
}
Then after that, you will receive a notification message asking you if you want to synchronize the dependencies file as you just modified it. Kindly approve the "Sync Now" option as shown below:
That at this point you will be considered that you already applied the "Additional Steps" mentioned in the additional installation steps in case you are using Kotlin Coroutine or enabling the Proguard in your native Android project to avoid any dependency issues.
How to uninstall the SDK?β
Details
To uninstall the PayTabs SDK that has been built in your android project using Native Android, remove the line you already specified from your dependencies file:
dependencies {
implementation 'com.PayTabs:payment-sdk:X.X.X'
}
Then after that, you will receive a notification message asking you if you want to synchronize the dependencies file as you just modified it. Kindly approve the "Sync Now" option as shown below:
Additional Stepsβ
If you were already using Kotlin Coroutine or enabling the Proguard in your Android project, and performed the "Additional Steps" mentioned in above installation step. Only in this case, you will need to perform these additional steps to undo the installation steps completely as clarified below:
- Kotlin Coroutine
Remove the following lines from your application's Gradle file, which have been added in the installation/integration process before to avoid the "Duplicated class" dependency conflict issue with the coroutine API:
<project-root>/app/build.gradleconfigurations.all {
resolutionStrategy {
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
}
} - Proguard
Remove the following lines from your application's Proguard rules file, which have been added in the installation/integration process before:
<project-root>/app/proguard-rules.pro-keep public class com.payment.paymentsdk.**{*;}
Supported Payment Methodsβ
This SDK is supporting various types of payment methods as shown below:
CreditCard
American Express
mada
UnionPay
OmanNet Debit
UrPay
StcPay
Valu
Aman
Meeza (QR)
KnetPay (Debit)
KnetPay (Credit)
SamsungPay
Forsa
Halan
Tamara
Souhoola
Tabby
Tru (Shahry)
You should know that all the main payment methods which are (Credit Cards - SamsungPay) are managed (displayed and handled) in the SDK form itself. However, the rest of the payment methods mentioned above which are considered APMs (Alternative Payment Methods) will be displayed in a WebView using the Hosted Payment Page methodology instead to be managed on our side instead.
To know more about this, please check our Step 4 - Accepting the payment solution article.