Connecting PayTabs to Mavibot

To connect PayTabs with Mavibot, you need to configure several settings in your PayTabs account.

1. Create an API Key

In your PayTabs dashboard, go to:

Developers → API Keys

Create a new API key.

After creating the API key, save the following details:

  • Server Key — required for setting up the integration.
  • Profile ID — also required for the connection setup.

2. Configure Payment Notifications

Go to:

Developers → Configuration

Enable payment notifications (callbacks).

Click "+" and add the following callback URL:

https://chatter.mavibot.ai/paytabs_callback/result

This URL is used to send payment status updates to Mavibot.

3. Configure PayTabs in Mavibot

In the Mavibot settings:

  1. Go to the Acquiring section
  2. Select PayTabs as the payment provider
  3. Enter the following details:
    • Profile ID
    • Server Key
  4. Select your PayTabs account region

Please note!
The selected region must match the region where your PayTabs account is registered.

Once the settings are saved, the integration setup will be completed.

To generate a payment link, use the following function:

get_paytabs_payment_url(amount, description, currency, customer_email, customer_phone, full_name, language)

Function Parameters

Parameter Description
! amount Payment amount. Required parameter
description Payment description. Optional parameter
currency Payment currency. Optional parameter
customer_email Customer email address. Optional parameter
customer_phone Customer phone number. Optional parameter
full_name Customer full name. Optional parameter
language Language of the payment page. Optional parameter

Available Currencies

The following currency codes are supported:

SAR, AED, BHD, EGP, EUR, GBP, HKD, IDR,INR, IQD, JOD, JPY, KWD, MAD, OMR,PKR, QAR, USD

Available Languages

en — Englishar — Arabicfr — French

The function returns a payment URL.

If the currency parameter is not provided, the currency will be automatically selected based on the configured region.

To send a payment button to a customer:

  1. Create a button with the Payment type
  2. Select PayTabs as the payment provider
  3. Specify:
    • payment description;
    • payment amount;
    • currency.

Payment Status Handling

After the customer opens the payment link and completes the payment, a callback event will be sent to the conversation.

Successful Payment

Example:

SDJ91MTKTT_success 100

Where:

  • SDJ91MTKTT — the first 10 characters of the Server Key
  • 100 — the payment amount

To create an action for a successful payment, go to Builder and create a block with a trigger (this can be a Start block or a Trigger block).

Then, in the Trigger field, enter:

  • the full callback value (if you want to trigger the action only for a specific payment amount), or
  • only the callback value before the payment amount (if you want to trigger the action for all successful payments).

Failed Payment

Example:

SDJ91MTKTT_fail 100

Failed payment handling is configured in the same way as successful payment handling.

Create a block with a trigger and enter the callback value in the Trigger field. This allows you to define actions that will be executed when a payment fails.

Variables Saved After a Successful Payment

After a successful payment, the following variables are automatically saved for the customer:

paytabs_callback_data
Contains the full webhook payload received from the payment system.

paytabs_payment_completed

Value:

True

Indicates that the payment has been successfully completed.