Flutter SDK

Sections

Theme switcher

Getting Started - Egypt

Sign up for registering a new account


A guide to registering a new accept account.

Why do I have to? In order to deal with any of Accept's services, you have to register an account, this tutorial will be your guide to create one.

To create your account, follow these steps

  1. Navigate to Accept's home page

2. After that, you will enter your mobile number on which you will be receiving OTP for first-time verification.

3. As soon as you enter the OTP that you have received on your mobile number, you will get the below screen where you will be adding your name, and email details including your desired Password which you will be using for further logging.

4. Please note that after this screen you will get a login screen where you will be entering your registered mobile number without country code and your password which you have set in the previous screen.

5. As soon as you will log in, you will get the below screen to enter your business details.

After filling in this information, you will get a " Registration successful" message on the screen and you will be routed to your Paymob Dashboard as below :

Great-Now you have successfully made your Merchant portal dashboard 

Now you can go to the Sign-In page and start accepting online payments from your customers, Go check our use case guide and choose your perfect payment scenario!

👍Note!

The status of the created account will be marked as a "Test" account, this will allow you to test all of Accept's services. When you finish your testing phase, please contact your Account Manager or Contact Support team through email  support@paymob.com or you can also raise a ticket through a support widget in your Merchant portal Dashboard to change its status to be "Live".

Was this section helpful?

What made this section unhelpful for you?

Accept Dashboard

A detailed guide to your Accept dashboard

In order to deal with any of Accept's services, you have to create an Accept account.

In your Accept portal, you can find:

  • Profile.
  • Payment Integrations.
  • Orders.
  • Transactions.
  • Checkout Customization.

API Checkout Experience

Welcome to the API Checkout Experience documentation! In this guide, you will learn how to integrate and set up our API to provide a seamless and unified checkout experience. This includes everything you need to get started with setting up the API, generating your keys, and configuring both the Unified Intention API Checkout and Pixel Native Payment experiences.

We'll walk you through the basics of the API, including an overview of how it works, step-by-step instructions on how to get your environment set up, and how to use the various endpoints to facilitate secure and efficient transactions.

E-Commerce Plugins

Mobile SDKs

Was this section helpful?

What made this section unhelpful for you?

Mobile SDKs V2

Here you'll find our latest SDKs for both Android and IOS.

Was this section helpful?

What made this section unhelpful for you?

IOS SDK

Supported Payment Methods For IOS:

  • Wallets.
  • Cards

Requirements:

There are two installation methods available, and it is imperative to use only one of the following methods:

1.1: Cocoa Installation

PaymobSDK is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Paymob'

And in the general settings of your project, under libraried and frameworks change the library from "Do not embed" to "Embed and Sign"

1.2: Manual Installation

Step 1 - Download the SDK from this link and extract it on the local machine.

Step 2 - Drag and Drop the PaymobSDK.xcframework folder into Frameworks, Libraries, and Embedded Content Under the General Settings of Xcode.

Step 3 - In the general settings of your project, under libraries and frameworks, change the library from "Do not embed" to "Embed and Sign"

2: Usage

Step 1 - Import the framework

SWIFT
import PaymobSDK

Step 2 - Add the delegate to the class, and add the protocol stubs

SWIFT
class ViewController: UIViewController, PaymobSDKDelegate {

It should look like this.

Step 3 - Create a constant

SWIFT
let paymob = PaymobSDK()

Step 4 - Pass self to delegate

SWIFT
paymob.delegate = self

Step 5 - Create the variables

SWIFT
// Replace this string with your payment key
let client_secret = "" //Put Client Secret Here
let public_key = "" // Put Public Key Here
let savedCards = [] // Put Saved Cards Here

Public Key: You can retrieve the Public Key from your account on the Paymob dashboard, accessible through the settings page. This key remains consistent and will not change with each payment.

Client Secret: The Client Secret can be obtained from the response to the Creating Intention API request. It is important to note that this secret will change with each payment.

The merchant should configure the response callback for the integration ID in use to the following URL: https://accept.paymob.com/api/acceptance/post_pay.

For generating a save card token to be used within moto transaction later, please refer to this link for generating a save card token.

Step 6 - Call the function

SWIFT
do{
try paymob.presentPayVC(VC: self, PublicKey: public_key, ClientSecret: client_secret, SavedBankCards: savedCards)
} catch let error {
}

Step 7 - You can customize the UI of the SDK such as

SWIFT
// the extra UI Customization parameters are
//sets the title to be the image you want
appIcon
//sets the title to be the name you want
appName
//changes the color of the buttons throughout the SDK, the default is black
buttonBackgroundColor
//changes the color of the buttons Texts throughout the SDK, the default is white
buttonTextColor
//set save card checkbox initial value
saveCardDefault
//set whether or not should show save card checkbox
showSaveCard
//used like this
let paymob = PaymobSDK()
paymob.paymobSDKCustomization.appIcon = UIImage()
paymob.paymobSDKCustomization.appName = ""
paymob.paymobSDKCustomization.buttonBackgroundColor = UIColor.black
paymob.paymobSDKCustomization.buttonTextColor = UIColor.white
paymob.paymobSDKCustomization.showSaveCard = true
paymob.paymobSDKCustomization.saveCardDefault = false
try paymob.presentPayVC(VC: self, PublicKey: public_key, ClientSecret: client_secret, SavedBankCards: userCardsTest)
Was this section helpful?

What made this section unhelpful for you?

Android SDK

Supported Payment Methods For Android:

  • Wallets.
  • Cards

Manual Installation

Step 1: Download the SDK from this link and unzip the “Sdk package” folder.

Step 2: Copy the “Sdk package” folder to your libs in your Android Project Root Folder as follows:

Step 3: Add required local Repositories as follows:

KOTLIN
repositories {
maven {
url = rootProject.projectDir.toURI().resolve("libs") }
maven {
url = uri("https://jitpack.io")
}
}

Step 4: Add the sdk Dependency:

KOTLIN
implementation("com.paymob.sdk:Paymob-SDK:1.3.0")//Please change this version number to match the version number of the downloaded sdk

Step 5: Add your dataBinding feature in BaseAppModuleExtensions as follows:

KOTLIN
android {
buildFeatures { dataBinding = true } }

Step 6: Sync your project.

Usage imports

KOTLIN
import com.paymob.paymob_sdk.PaymobSdk import com.paymob.paymob_sdk.domain.model.CreditCard import com.paymob.paymob_sdk.domain.model.SavedCard import com.paymob.paymob_sdk.ui.PaymobSdkListener

Implement PaymobSdkListener Interface

KOTLIN
class MainActivity : AppCompatActivity(), PaymobSdkListener { override fun onCreate(savedInstanceState: Bundle?) {} override fun onSuccess() { //If the Payment is successful } override fun onFailure() { //If The Payment is declined } override fun onPending() { //If The Payment is pending } }

Create a PaymobSdk instance using PaymobSdk.Builder()

KOTLIN
val savedCard = SavedCard( maskedPan =**** **** **** 1234, savedCardToken =****************************, creditCard = CreditCard.VISA or CreditCard.MASTERCARD or CreditCard.AMERICAN_EXPRESS or CreditCard.MEEZA or CreditCard.JCB or CreditCard.MAESTRO or CreditCard.OMAN_NET ) val paymobsdk = PaymobSdk.Builder( context = this@MainActivity, clientSecret = “CLIENT_SECRET”,//Place Client Secret here publicKey = “PUBLIC_KEY”,//Place Public Key here paymobSdkListener = this, savedCard = savedCard//Optional Field if you have a saved card ) .build()

Public Key: You can retrieve the Public Key from your account on the Paymob dashboard, accessible through the settings page. This key remains consistent and will not change with each payment.

Client Secret: The Client Secret can be obtained from the response to the Creating Intention API request. It is important to note that this secret will change with each payment.

The merchant should configure the response callback for the integration ID in use to the following URL: https://accept.paymob.com/api/acceptance/post_pay.

For generating a save card token to be used within moto transaction later, please refer to this link for generating a save card token.

You can set the sdk buttons color and buttons text color using this builder object for example:

KOTLIN
val savedCard = SavedCard(
maskedPan =**** **** **** 1234,
savedCardToken =**********************************,
creditCard = CreditCard.VISA or CreditCard.MASTERCARD or
CreditCard.AMERICAN_EXPRESS or CreditCard.MEEZA or
CreditCard.JCB or CreditCard.MAESTRO or CreditCard.OMAN_NET
)
val paymobsdk = PaymobSdk.Builder(
context = this@MainActivity,
clientSecret = “CLIENT_SECRET”,//Place Client Secret here
publicKey = “PUBLIC_KEY”,//Place Public Key here
paymobSdkListener = this,
savedCard = savedCard//Optional Field if you have a saved card
)
.setButtonBackgroundColor(Color.BLACK)//changes the color of button backgrounds throughout the SDK, and set by default to black
.setButtonTextColor(Color.WHITE)//changes the color of button texts throughout the SDK, and set by default to white
.isAbleToSaveCard(true) //changes the ability for the sdk to save the card info or no
.isSavedCardCheckBoxCheckedByDefault(true) //changes the ability for the sdk if the save card checkbox is checked ot not
.build()

Then you can start the sdk by calling

KOTLIN
sdk.start()
Was this section helpful?

What made this section unhelpful for you?

Flutter SDK

PaymobSDK_FlutterBridge

A bridge code to show how to use native PaymobSDKs in your Flutter project

Flutter SDK supports minimum Android SDK version 23 and compile SDK version 33.

Usage

Dart Section

Create a new class for Saved Cards if you plan on saving cards used in Cards Payment Integrations and add the following code in it.

Dart
enum CardType{OmanNet, JCB, Meeza, Maestro, Amex, Visa, MasterCard}
class SavedBankCard {
final String token;
final String maskedPanNumber;
final String cardType;
SavedBankCard({required this.token, required this.maskedPanNumber, required this.cardType});
// Convert the custom CardType class to a Map (which can be serialized to JSON)
Map<String, dynamic> toMap() {
return {
'token': token,
'maskedPanNumber': maskedPanNumber,
'cardType': cardType,
};
}
}

Redirect into your dart file. import the following dependency.

Dart
import 'package:flutter/services.dart';

Then add the following code to the same file.

This is the function that you will call in your dart file when you need to call the sdk.

You need to pass the public and client secret keys to this function, These two parameters are required. The other Parameters are optional.

Dart
static const methodChannel = MethodChannel('paymob_sdk_flutter');
// Method to call native PaymobSDKs
Future<void> _payWithPaymob(
String pk,
String csk,
{ SavedBankCard? savedCard,
String? appName,
Color? buttonBackgroundColor,
Color? buttonTextColor,
bool? saveCardDefault,
bool? showSaveCard} ) async {
try {
final String result = await methodChannel.invokeMethod('payWithPaymob', {
"publicKey": pk,
"clientSecret": csk,
"savedBankCard": savedCard?.toMap(),
"appName": appName,
"buttonBackgroundColor": buttonBackgroundColor?.value,
"buttonTextColor": buttonTextColor?.value,
"saveCardDefault": saveCardDefault,
"showSaveCard": showSaveCard
});
print('Native result: $result');
switch (result) {
case 'Successfull':
print('Transaction Successfull');
// Do something for accepted
break;
case 'Rejected':
print('Transaction Rejected');
// Do something for rejected
break;
case 'Pending':
print('Transaction Pending');
// Do something for pending
break;
default:
print('Unknown response');
// Handle unknown response
}
} on PlatformException catch (e) {
print("Failed to call native SDK: '${e.message}'.");
}
}

The following are optional Parameters that are used to customize the SDK

Dart
// the extra UI Customization parameters are
//sets the header to be the name you want
appName
//changes the color of the buttons throughout the SDK, the default is black
buttonBackgroundColor
//changes the color of the buttons Texts throughout the SDK, the default is white
buttonTextColor
//set save card checkbox initial value
saveCardDefault
//set whether or not should show save card checkbox
showSaveCard

IOS Section

Redirect into your IOS Folder.

Place the IOS native sdk in this folder In your project's Settings, scroll down to 'Frameworks, Libraries, and Embedded Content' and add the xcframework file there.

Then in your AppDelegate file. Add the following import

Swift
import PaymobSDK

Then create a global variable

Swift
var SDKResult: FlutterResult?

Then add the following code to handle receiving a call from the dart file

Swift
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
let nativeChannel = FlutterMethodChannel(name: "paymob_sdk_flutter",
binaryMessenger: controller.binaryMessenger)
nativeChannel.setMethodCallHandler { (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
if call.method == "payWithPaymob",
let args = call.arguments as? [String: Any]{
self.SDKResult = result
self.callNativeSDK(arguments: args, VC: controller)
} else {
result(FlutterMethodNotImplemented)
}
}

Then add the following code to handle calling the native PaymobSDK

Swift
// Function to call native PaymobSDK
private func callNativeSDK(arguments: [String: Any], VC: FlutterViewController) {
// Initialize Paymob SDK
let paymob = PaymobSDK()
var savedCards:[SavedBankCard] = []
paymob.delegate = self
//customize the SDK
if let appName = arguments["appName"] as? String{
paymob.paymobSDKCustomization.appName = appName
}
if let buttonBackgroundColor = arguments["buttonBackgroundColor"] as? NSNumber{
let colorInt = buttonBackgroundColor.intValue
let alpha = CGFloat((colorInt >> 24) & 0xFF) / 255.0
let red = CGFloat((colorInt >> 16) & 0xFF) / 255.0
let green = CGFloat((colorInt >> 8) & 0xFF) / 255.0
let blue = CGFloat(colorInt & 0xFF) / 255.0
let color = UIColor(red: red, green: green, blue: blue, alpha: alpha)
paymob.paymobSDKCustomization.buttonBackgroundColor = color
}
if let buttonTextColor = arguments["buttonTextColor"] as? NSNumber{
let colorInt = buttonTextColor.intValue
let alpha = CGFloat((colorInt >> 24) & 0xFF) / 255.0
let red = CGFloat((colorInt >> 16) & 0xFF) / 255.0
let green = CGFloat((colorInt >> 8) & 0xFF) / 255.0
let blue = CGFloat(colorInt & 0xFF) / 255.0
let color = UIColor(red: red, green: green, blue: blue, alpha: alpha)
paymob.paymobSDKCustomization.buttonTextColor = color
}
if let saveCardDefault = arguments["saveCardDefault"] as? Bool{
paymob.paymobSDKCustomization.saveCardDefault = saveCardDefault
}
if let showSaveCard = arguments["showSaveCard"] as? Bool{
paymob.paymobSDKCustomization.showSaveCard = showSaveCard
}
if let savedCardData = arguments["savedBankCard"] as? [String: String],
let token = savedCardData["token"],
let maskedPanNumber = savedCardData["maskedPanNumber"],
let cardType = savedCardData["cardType"] {
// Now you can create a custom class in Swift
let savedcard = SavedBankCard(token: token, maskedPanNumber: maskedPanNumber, cardType: CardType(rawValue: cardType) ?? CardType.Unknown)
savedCards.append(savedcard)
}
// Call Paymob SDK with publicKey and clientSecret
if let publicKey = arguments["publicKey"] as? String,
let clientSecret = arguments["clientSecret"] as? String{
do{
try paymob.presentPayVC(VC: VC, PublicKey: publicKey, ClientSecret: clientSecret, SavedBankCards: savedCards)
} catch let error {
print(error.localizedDescription)
}
return
}
}

Then add the following at the bottom to handle the result of the SDK

Swift
extension AppDelegate: PaymobSDKDelegate{
public func transactionRejected() {
self.SDKResult?("Rejected")
}
public func transactionAccepted() {
self.SDKResult?("Successfull")
}
public func transactionPending() {
self.SDKResult?("Pending")
}
}

Android Section

Redirect into the Android directory.

Then create a new directory there called 'libs' and place the Android SDK there

Inside the root Android directory, open the build.gradle, then add the following code inside

Kotlin
allprojects {
repositories {
...
maven {
url = rootProject.projectDir.toURI().resolve("libs")
}
maven {
url = uri("https://jitpack.io")
}
}
}

should look like this.

Then open the settings.gradle, then add the following code

Kotlin
pluginManagement {
repositories {
...
maven {
url = rootProject.projectDir.toURI().resolve("libs")
}
maven {
url = uri("https://jitpack.io")
}

should look like this

Inside the app directory, open the build.gradle file and add the following

Kotlin
dependencies {
implementation("com.paymob.sdk:Paymob-SDK:1.3.0")//Please change this version number to match the version number of the downloaded sdk
}
android {
...
buildFeatures { dataBinding = true }
}

should look like this

Then in the MainActivity add the following:

Kotlin
import android.graphics.Color
import android.util.Log
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import io.flutter.embedding.android.FlutterActivity
import android.os.Bundle
import android.widget.Toast
import com.paymob.paymob_sdk.PaymobSdk
import com.paymob.paymob_sdk.domain.model.CreditCard
import com.paymob.paymob_sdk.domain.model.SavedCard
import com.paymob.paymob_sdk.ui.PaymobSdkListener
class MainActivity: FlutterActivity(), MethodCallHandler, PaymobSdkListener {
private val CHANNEL = "paymob_sdk_flutter"
private var SDKResult: MethodChannel.Result? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
flutterEngine?.dartExecutor?.binaryMessenger?.let {
MethodChannel(it, CHANNEL).setMethodCallHandler { call, result ->
if (call.method == "payWithPaymob") {
SDKResult = result
callNativeSDK(call)
} else {
result.notImplemented()
}
}
}
}
// Function to call native PaymobSDK
private fun callNativeSDK(call: MethodCall) {
val arguments = call.arguments as? Map<String, Any>
val publicKey = call.argument<String>("publicKey")
val clientSecret = call.argument<String>("clientSecret")
val savedBankCard = arguments?.get("savedBankCard") as? Map<String, Any>
var savedCard: SavedCard? = null
var buttonBackgroundColor: Int? = null
var buttonTextColor: Int? = null
val appName = call.argument<String>("appName")
val buttonBackgroundColorData = call.argument<Number>("buttonBackgroundColor")?.toInt() ?: 0
val buttonTextColorData = call.argument<Number>("buttonTextColor")?.toInt() ?: 0
val saveCardDefault = call.argument<Boolean>("saveCardDefault") ?: false
val showSaveCard = call.argument<Boolean>("showSaveCard") ?: true
//get saved card data
if (savedBankCard != null) {
val maskedPan = savedBankCard["maskedPanNumber"] as? String ?: ""
val token = savedBankCard["token"] as? String ?: ""
val cardType = savedBankCard["cardType"] as? String ?: ""
val creditCard = CreditCard.valueOf(cardType.uppercase())
savedCard = SavedCard(maskedPan = "**** **** **** " + maskedPan, savedCardToken = token, creditCard = creditCard )
}
if (buttonTextColorData != null){
buttonTextColor = Color.argb(
(buttonTextColorData shr 24) and 0xFF, // Alpha
(buttonTextColorData shr 16) and 0xFF, // Red
(buttonTextColorData shr 8) and 0xFF, // Green
buttonTextColorData and 0xFF // Blue
)
}
Log.d("color", buttonTextColor.toString())
if (buttonBackgroundColorData != null){
buttonBackgroundColor = Color.argb(
(buttonBackgroundColorData shr 24) and 0xFF, // Alpha
(buttonBackgroundColorData shr 16) and 0xFF, // Red
(buttonBackgroundColorData shr 8) and 0xFF, // Green
buttonBackgroundColorData and 0xFF // Blue
)
}
val paymobsdk = PaymobSdk.Builder(
context = this@MainActivity,
clientSecret = clientSecret.toString(),
publicKey = publicKey.toString(),
paymobSdkListener = this,
savedCard = savedCard//Optional Field if you have a saved card
).setButtonBackgroundColor(buttonBackgroundColor ?: Color.BLACK)
.setButtonTextColor(buttonTextColor ?: Color.WHITE)
.setAppName(appName)
.isAbleToSaveCard(showSaveCard ?: true)
.isSavedCardCheckBoxCheckedByDefault(saveCardDefault ?: false)
.build()
paymobsdk.start()
return
}
//PaymobSDK Return Values
override fun onSuccess() {
//If The Payment is Accepted
SDKResult?.success("Successfull")
}
override fun onFailure() {
//If The Payment is declined
SDKResult?.success("Rejected")
}
override fun onPending() {
//If The Payment is pending
SDKResult?.success("Pending")
}
override fun onMethodCall(call: MethodCall, result: Result) {
}
}

Was this section helpful?

What made this section unhelpful for you?

React Native SDK

Installation Steps for React Native SDK

To get started with the paymob-reactnative package, follow these steps:

  • Open your terminal, navigate to your React Native project directory, and install the paymob-reactnative package using yarn:

yarn add paymob-reactnative@https://github.com/PaymobAccept/paymob-reactnative-sdk.git


iOS

Install CocoaPods for iOS

  • If you are developing for iOS, you will need to install CocoaPods to manage your project's dependencies. Run the following commands:
PLAINTEXT
cd ios
pod install 
cd .. 

This step ensures that the necessary native modules are linked correctly in your iOS project.

Important Notice: If you encounter an issue with the native iOS SDK, you may need to create a new blank Swift file in Xcode. After creating the blank file, be sure to click on Create Bridging Header when prompted.


Android

  • Append the following snippet to your project-level build.gradlefile.
Java
allprojects {
repositories {
maven {
url = rootProject.projectDir.toURI().resolve("../node_modules/paymob-reactnative/android/libs")
}
maven {
url = uri("https://jitpack.io")
}
}
}
  • Add the following snippet to your app-level build.gradlefile.
Java
android {
buildFeatures { dataBinding = true }
}

Using Paymob

To begin using the Paymob SDK in your React Native application, start by importing the module in your component:

JAVASCRIPT
import Paymob, { PaymentResult, CreditCardType } from 'paymob-reactnative';

SDK Customization

You can customize the Paymob SDK to match your app's branding and user experience by calling the following functions:

JAVASCRIPT
Paymob.setAppIcon(base64Image); // Set your merchant logo using a base64 encoded image
Paymob.setAppName('Paymob SDK'); // Customize merchant app name displayed in the Paymob interface
Paymob.setButtonTextColor('#FFFFFF'); // Set the text color of buttons in the SDK
Paymob.setButtonBackgroundColor('#000000'); // Set the background color of buttons in the SDK
Paymob.setShowSaveCard(true); // Enable the option for users to save their cards
Paymob.setSaveCardDefault(true); // Set saved card option as default for transactions

These customization options allow you to tailor the Paymob SDK interface to align with your brand identity.

Important Notice

Please ensure that all SDK customizations are completed before calling Paymob.presentPayVC(). Failing to do so may result in the payment interface not reflecting your desired branding and settings.

Adding a Listener

To handle payment results effectively, you can add a listener that will respond to different transaction statuses. This is crucial for providing feedback to users about their payment transactions:

JAVASCRIPT
Paymob.setSdkListener((status: PaymentResult) => {
switch (status) {
case PaymentResult.SUCCESS:
// Handle successful payment
break;
case PaymentResult.FAIL:
// Handle failed payment
break;
case PaymentResult.PENDING:
// Handle pending payment status
break;
}
});

This listener will allow you to implement logic based on the result of the payment process, enhancing the user experience.

Invoking the SDK

After configuring the SDK, you can invoke the Paymob payment interface with the following code:

JAVASCRIPT
const savedBankCards = [
{
maskedPan: '1234', // The masked card number displayed to the user
savedCardToken: 'CARD_TOKEN', // The token representing the saved card
creditCard: CreditCardType.MASTERCARD, // The type of the credit card (e.g., Mastercard)
},
];
Paymob.presentPayVC('CLIENT_SECRET', 'PUBLIC_KEY', savedBankCards);

Note: The savedBankCards parameter is optional. If you do not have saved bank cards to provide, you can simply call the presentPayVC method without it.

This function call opens the Paymob payment interface, allowing users to complete their transactions securely. Make sure to replace 'CLIENT_SECRET' and 'PUBLIC_KEY' with your actual credentials.

Here’s the updated explanation with a revised first sentence and the inclusion of the repository cloning step:

Example App

To explore the SDK or test its features, you can clone the repository and run the example app by following these steps:

  1. Clone the RepositoryClone the repository to your local machine.

yarn

2. Run the Example App

You can run the example app for both iOS and Android platforms:

  • To run the app on iOS, use the following command:

yarn example ios

  • To run the app on Android, use this command:

yarn example android

By following these steps, you can explore the functionality of the SDK in the example app.

Documentation

Please refer to our comprehensive Documentation for more detailed information about the supported APIs, usage guidelines, and advanced features.

Was this section helpful?

What made this section unhelpful for you?

Subscriptions

Overview

Paymob provides a comprehensive subscription module designed to help merchants efficiently manage their subscriptions on a variety of billing cycles, including weekly, bi-weekly, monthly, quarterly, semi-annual, and annual plans. This module is tailored to meet the specific needs of each merchant, enabling them to create, manage, and control their subscriptions independently through our APIs.

For any guidance or assistance, please reach out to your account manager. Alternatively, you can contact our support team via email at support@paymob.com. When reaching out, please include details regarding your subscription, such as your Subscription ID and Transaction ID, to help us assist you more efficiently.


Integration Requirements

To successfully set up your subscription plan, you will need two integration IDs:

  • Online 3DS Integration ID: This ID will be used for creating subscriptions.
  • Moto Integration ID: Utilize this ID when creating the subscription plan itself.

Ensure you have both integration IDs ready to streamline the setup process.

If you wish to verify the card user details (provide a free trial for X days period) instead of deducting the amount while creating the subscription then you can ask our support team at support@paymob.com to create a 3DS verification integration ID. Noting this amount will be an auto reversal and you need to set the  "use_transaction_amount": false  to avoid any override with the Subscription plan amount

For further assistance or detailed API guidance, please refer to the subsequent sections of this documentation.

Payment Types

Paymob provides a comprehensive range of payment options to suit various business needs, enhancing the flexibility and security of online transactions. The following are the four primary payment types supported by Paymob:

1. 3D Secure (3DS)

3D Secure (3DS) is a security protocol designed to reduce the risk of fraudulent online transactions by adding an additional layer of authentication. When a cardholder makes a purchase online, 3DS prompts the customer to authenticate their identity with the card issuer during the final stage of the checkout process. This step typically involves entering a one-time password (OTP) or biometric verification, depending on the card issuer’s requirements.

2. Auth and Capture

The Auth and Capture payment method is a two-step process where the transaction is initially authorized, but the funds are not immediately captured. First, the payment gateway authorizes the transaction by confirming that the customer has sufficient funds available, but the actual transaction amount will be captured later. If the transaction is not captured within 07 days, it will be automatically voided.

3. Card Verification

Card Verification Function is a functionality provided by the Network to authenticate a card transaction without actually deducting the transaction amount from the customer’s card.

4. Pay with Saved Card Token

The Pay with Saved Card Token method allows customers to store their card details securely for future transactions. Once a customer has completed a transaction, the payment system stores a unique token that represents their payment method. In subsequent transactions, customers can opt to pay using this saved token without having to re-enter their card details, simplifying the checkout process.


Payment Links

Payment Actions

This section contains the following topics:

  1. Refund Transaction through the Dashboard.
  2. Refund Transaction through API.
  3. Void Transaction through the Dashboard.
  4. Void Transaction through API.
  5. Auth/Capture Transaction through the Dashboard.
  6. Auth/Capture Transaction through API.

Payment Methods

Paymob provides a wide range of payment methods in Egypt, enabling businesses to offer seamless and secure transactions for their customers. Whether through cards, digital wallets, or installment plans, Paymob ensures a smooth payment experience tailored to diverse customer needs. Below is a list of supported payment methods:

  • Card Payments
  • Digital Wallets
  • Apple Pay
  • ValU
  • Bank Installments
  • Souhoola V3
  • Aman V3
  • Forsa
  • Premium
  • Contact
  • HALAN
  • SYMPL
  • Kiosk
  • InstaPay (Coming Soon)

This extensive payment network allows businesses to expand their customer reach and simplify transactions through flexible and accessible solutions.

Test Credentials

Here are the test credentials for the online card payment method:

Mastercard:

Card

Mastercard

Card number

5123456789012346

Cardholder Name

Test Account

Expiry Month

12

Expiry Year

25

CVV

123


Wallet Test Credentials :

Here are the test credentials for Wallets;

Wallet Number

01010101010

MPin Code

123456

OTP

123456

MasterCard For Simulation:

Card

Mastercard

Card number

5123450000000008

Cardholder Name

TEST CARD

Expiry Month

01

Expiry Year

39

CVV

123

VISA Card for Simulation:

Card

VISA

Card number

4111111111111111

Cardholder Name

Test Account

Expiry Month

12

Expiry Year

25

CVV

123

You will simulate both successful and all failed cases outlined below using the VISA card credentials provided above.

Successful Response:

Failed Response:


Was this section helpful?

What made this section unhelpful for you?

Transaction Inquiry API

Retrieve A Transaction allows you to obtain the details and status of a transaction-whether it is successful or failed, using one of the following methods:

  1. Retrieve Transaction with Order ID Use the Order ID to access transaction details.
  2. Retrieve Transaction with Transaction ID Use the Transaction ID to obtain the relevant transaction information.
  3. Retrieve Transaction with Merchant Order ID(Special Reference Number) Access transaction details using the Merchant Order ID (Special Reference Number).

Manage Callback

Welcome to the Manage Callback documentation! In this section, we'll guide you through the different types of transaction callbacks that are essential for handling payment processing and ensuring a seamless integration with your system. Specifically, we'll cover transaction processed callbacks, transaction response callbacks, and how to calculate HMAC for processed callbacks, redirection callbacks, and saved card token objects.

You will learn how to configure and manage these callbacks, understand their role in transaction flow, and ensure that your system securely processes and responds to different events during payment transactions. Whether you're dealing with successful payments, handling failures, or managing tokenized card data, this guide will provide you with the necessary tools and knowledge to handle callbacks efficiently and securely.

Let's dive into understanding each callback type and how to calculate and implement HMAC to ensure the integrity and security of your transactions.

Error Codes

You can find the Risk error codes and other Acquirer response code descriptions in this section to know more about your declines, and detailed reasons.

Bills Portal API

Payouts

Frequently Asked Questions (FAQs)

The Frequently Asked Questions (FAQ) section is a comprehensive resource designed to address common inquiries about our services and features. Here, you will find detailed answers to questions regarding payment methods, transaction processes, technical requirements, and security measures. Whether you're a new user seeking guidance or an experienced merchant looking for specific information, this section aims to provide clarity and support. For any additional questions not covered here, please feel free to reach out to our customer support team at support@paymob.com.