An Automation Gateway in our system is designed to handle payments that rely on external data synchronization (like MFS SMS). These gateways provide users with step-by-step instructions and verify transactions based on specific sender keys.
Every gateway must follow a strict naming convention and folder structure.
Root Path: pp-content/pp-modules/pp-gateways/
Folder Name: Must be lowercase and no spaces (use hyphens).
Example: bkash-personal
Main File: Must be named class.php.
Assets: Place logos or icons in an assets/ subfolder.
pp-gateways/
└── bkash-personal/
├── class.php
└── assets/
└── logo.jpgThe class name must be the PascalCase version of the folder name + the word Gateway.
Folder: bkash-personal -> Class: BkashPersonalGateway
Folder: nagad-automation -> Class: NagadAutomationGateway
Method | Description |
| Defines gateway metadata (Type, Sender Key, etc.) |
| Defines the UI theme (Buttons, Backgrounds) |
| Configurable inputs shown in the Admin Panel |
| Returns an array of available languages |
| The actual translation strings for instructions |
| The logic for the step-by-step UI shown to users |
info() MethodThis is the most critical part for Automation.
public function info() {
return [
'title' => 'Bkash Personal',
'logo' => 'assets/logo.jpg',
'currency' => 'BDT',
'tab' => 'mfs', // Category in UI
'gateway_type' => 'automation', // MUST be automation
'sender_key' => 'bkash', // The SMS/Provider identifier
'sender_type' => 'Personal', // Personal, Agent, or Merchant
];
}The fields() method allows you to create settings that the Admin fills out (like Wallet Numbers or QR Codes).
instructions($data) MethodThis generates the user-facing payment page. It receives a $data array containing $data['options'] (Admin settings) and $data['transaction'] (Amount, Currency).
Step Logic:
text: Refers to the ID in lang_text().
copy: Set to true to show a copy button.
vars: Replaces placeholders in your text (e.g., {amount}).
action: Used for interactive elements like displaying a QR code.
<?php
class BkashPersonalGateway
{
public function info()
{
return [
'title' => 'Bkash Personal',
'logo' => 'assets/logo.jpg',
'currency' => 'BDT',
'tab' => 'mfs',
'gateway_type' => 'automation',
'sender_key' => 'bkash',
'sender_type' => 'Personal',
];
}
public function color()
{
return [
'primary_color' => '#D12053',
'text_color' => '#FFFFFF',
'btn_color' => '#D12053',
'btn_text_color' => '#FFFFFF',
];
}
public function fields()
{
return [
[
'name' => 'qr_code',
'label' => 'Qr Code',
'type' => 'image',
]
];
}
public function supported_languages()
{
return [
'en' => 'English',
'bn' => 'বাংলা',
];
}
public function lang_text()
{
return [
'1' => [
'en' => 'Go to your bKash Mobile App.',
'bn' => 'আপনার বিকাশ মোবাইল অ্যাপে যান।',
],
'2' => [
'en' => 'Choose "Send Money"',
'bn' => '“Send Money” নির্বাচন করুন',
],
'3' => [
'en' => 'Enter the Number: {mobile_number}',
'bn' => 'নম্বর লিখুন: {mobile_number}',
],
'4' => [
'en' => 'Or Scan the QR Code',
'bn' => 'অথবা কিউআর কোড স্ক্যান করুন',
],
'5' => [
'en' => 'Enter the Amount: {amount} {currency}',
'bn' => 'পরিমাণ লিখুন: {amount} {currency}',
],
'6' => [
'en' => 'Now enter your bKash PIN to confirm.',
'bn' => 'এখন নিশ্চিত করতে আপনার বিকাশ পিন লিখুন।',
],
'7' => [
'en' => 'Put the Transaction ID in the box below and press Verify',
'bn' => 'ট্রানজ্যাকশন আইডি নিচের বক্সে লিখুন এবং যাচাই করুন চাপুন।',
],
];
}
public function instructions($data)
{
return [
[
'icon' => '',
'text' => '1',
'copy' => false,
],
[
'icon' => '',
'text' => '2',
'copy' => false
],
[
'icon' => '',
'text' => '3',
'copy' => true,
'value' => $data['options']['mobile_number'] ?? '',
'vars' => [
'{mobile_number}' => $data['options']['mobile_number'] ?? ''
]
],
[
'icon' => '',
'text' => '4',
'action' => [
'type' => 'image',
'label' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-qrcode"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4" /><path d="M7 17l0 .01" /><path d="M14 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4" /><path d="M7 7l0 .01" /><path d="M4 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4" /><path d="M17 7l0 .01" /><path d="M14 14l3 0" /><path d="M20 14l0 .01" /><path d="M14 14l0 3" /><path d="M14 20l3 0" /><path d="M17 17l3 0" /><path d="M20 17l0 3" /></svg>',
'value' => $data['options']['qr_code'] ?? '',
]
],
[
'icon' => '',
'text' => '5',
'copy' => true,
'value' => $data['transaction']['local_net_amount'],
'vars' => [
'{amount}' => $data['transaction']['local_net_amount'],
'{currency}' => $data['transaction']['local_currency']
]
],
[
'icon' => '',
'text' => '6',
'copy' => false
],
[
'icon' => '',
'text' => '7',
'copy' => false
],
];
}
}Name | Currency | Value |
|---|---|---|
bKash | BDT | bkash |
Nagad | BDT | nagad |
Rocket | BDT | rocket |
Upay | BDT | upay |
Tap | USD | tap |
Cellfin | BDT | cellfin |
Ok Wallet | BDT | okwallet |
mCash | BDT | mcash |
Pathao Pay | BDT | pathaopay |
TeleCash | BDT | telecash |
Ipay | BDT | ipay |