Payment Provider: Alfa Payment Gateway (Pakistan, PK)
by Expert IT Solutions https://expertpk.com$ 124.96
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
Discuss (mail)
|
Lines of code | 1231 |
Technical Name |
eis_gateway_alpha |
License | OPL-1 |
Website | https://expertpk.com |
Versions | 17.0 18.0 |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
Discuss (mail)
|
Lines of code | 1231 |
Technical Name |
eis_gateway_alpha |
License | OPL-1 |
Website | https://expertpk.com |
Versions | 17.0 18.0 |

Alfa Payment Gateway for Odoo
Your Ultimate Payment Solution for Pakistan
Introduction to Alfa Payment Gateway
A Seamless Integration with Bank Alfalah
Welcome to the Alfa Payment Gateway module for Odoo 17, a powerful tool designed to bring the convenience and reliability of Bank Alfalah’s Alfa merchant account to your e-commerce platform. Bank Alfalah, a leading private bank in Pakistan, offers one of the most innovative online payment processing solutions through its Alfa Payment Gateway (APG). With over 1.6 million active Alfa Wallet users and 1.7 million bank account holders, it’s the preferred choice for millions in Pakistan. This module integrates APG into Odoo, enabling you to accept payments securely and efficiently from customers across the country.
Setting up an Alfa merchant account is incredibly easy – you can register online in minutes at Bank Alfalah’s Merchant Signup. No lengthy paperwork, no branch visits – just a quick digital onboarding process. For businesses in Pakistan looking to sell products online, this module stands out as the best choice, especially since no other payment gateway tailored for Pakistan is currently available for Odoo.
Why Choose Alfa Payment Gateway?
Pakistan-Focused
Designed specifically for the Pakistani market, leveraging Bank Alfalah’s extensive user base.
Unique Odoo Integration
The only payment gateway for Odoo supporting Pakistani payment methods.
Easy Setup
Register online and start accepting payments instantly with minimal effort.
Supported Payment Methods
Flexible Options for Every Customer
Alfa Wallet
Enable customers to pay directly from their Alfa Wallet accounts. With 1.6 million active users, this method offers a fast and secure direct payment option, complete with OTP validation and a configurable timer for added security.
Alfalah Bank Account
Allow payments from any of the 1.7 million Bank Alfalah account holders. This method uses a secure direct flow with dual OTP (SMS and Email) verification, ensuring robust transaction safety.
Credit/Debit Card
Support Visa and Mastercard payments (local and international) via a redirect flow to Alfa Bank’s secure payment page, providing a familiar and trusted option for card users.
Key Features
Powerful Functionality for Your Business
Secure Transactions
Utilizes AES/CBC/PKCS7
encryption for all API requests, ensuring your customers’ data is
protected.
Configurable OTP Timer
Set a custom expiration time (default 2 minutes) for OTP validation, enhancing security and user experience.
Seamless Integration
Built for Odoo 17, integrating effortlessly with your existing payment workflows.
Wide Reach
Tap into millions of Alfa Wallet and Bank Alfalah account users in Pakistan.
Version Information
Built for Odoo 17
Current Version: 17.0.1.0.1
Released: February 2025
Compatibility: Odoo 17 Community and Enterprise editions
This module is actively maintained. Note that, it is not the official module.
Screenshots
Explore the Module in Action

Supported Payment Methods
Support all three payment methods provided by alpha.

Payment Option Selection
Customers choose from Alfa Wallet, Bank Account, or Credit/Debit Card at checkout.

OTP with Timer
Secure OTP entry with a visible countdown timer (e.g., 2 minutes).

Card Redirect Flow
Redirect to Alfa Bank’s secure page for Visa/Mastercard payments.

Payment Success
Confirmation page after a successful transaction.

Provider Settings
Configure APG credentials and OTP timer in Odoo settings.

Transaction Dashboard
Monitor all transactions with detailed status updates.
Support
We’re Here to Help
Need assistance? Contact our dedicated support team:

Send Messege on WhatsApp!
Alfa Payment Gateway
Overview
The Alfa Payment Gateway module integrates Alfa Bank’s payment solutions into Odoo 17, enabling seamless transactions via Alfa Wallet, Alfalah Bank Account, and Credit/Debit Card methods. It supports secure payment processing with OTP validation, a configurable timer, and robust error handling.
Features
- Multiple Payment Methods: Supports wallet, bank account, and card payments with distinct flows.
- OTP Validation: Secure one-time password verification with a configurable expiration timer (default 2 minutes).
- Encryption: Uses AES/CBC/PKCS7 padding for secure API requests.
- User-Friendly: Intuitive interface with countdown timer and error feedback.
Installation
Note: You need to install pycryptodome. Run this command in your python environment pip install pycryptodome.
- Download the Module: Obtain the module from the repository or marketplace.
- Extract: Unzip the module into your Odoo addons directory (e.g., /path/to/odoo/addons/eis_gateway_alpha).
- Update Modules List: In Odoo, go to Apps > Update Apps List.
- Install: Search for "Alfa Payment Gateway" and click Install.
Configuration
Prerequisites
- Odoo 17 installed and running.
- Alfa Bank merchant credentials (Merchant ID, Store ID, Hash, Username, Password, Key1, Key2).
- Access to Alfa Bank’s sandbox or production API endpoints.
Steps
Configure Payment Provider: - Navigate to Settings > Payments > Payment Providers. - Click Edit for an existing provider. - Set:
- Name: Alfa Payment Gateway
- Code: apg
- State: Test (for sandbox) or Enabled (for production)
- Merchant ID: Your Alfa Bank Merchant ID (e.g., 12345)
- Store ID: Your Alfa Bank Store ID (e.g., 012343)
- Merchant Hash: Provided by Alfa Bank (e.g., oubasf...)
- Merchant Username: Your username (e.g., providedbyalfa)
- Merchant Password: Your password (e.g., providedbyalfa...)
- Key1: Encryption key 1 (provided by alfa)
- Key2: Encryption key 2 (provided by alfa)
- OTP Expiry Time (seconds): Set to 120 (2 minutes) or your preferred value.
- Save the configuration.
Set Up Payment Methods: - Go to Payments > Payment Methods. - Ensure alfa_wallet, alfa_bank, and alfa_card are linked to the APG provider.
Test Transactions: - In test mode, use sandbox credentials to simulate payments. - Verify wallet/bank account flows with OTP and card flows with redirect.
Usage
Customer Payment Flow: - On the checkout page, select "Alfa Payment Gateway" as the payment option. - Choose a method (wallet, bank account, or card). - For wallet/bank:
- Enter the wallet number / account number and submit.
- Receive an OTP for wallet or otp and email otp for account, enter it within the timer (e.g., 2 minutes), and confirm.
- For card: - Redirect to Alfa Bank’s payment page, complete the transaction, and return to Odoo.
Admin Monitoring: - Check transaction statuses in Payments > Transactions. - View logs for debugging (e.g., handshake, OTP responses).
Technical Details
Architecture
- Models: - payment.provider: Extended with otp_expiry_seconds and APG-specific fields. - payment.transaction: Handles transaction states and gateway data (e.g., apg_gateway_reference).
- Controllers: - /payment/apg/initiate: Initiates wallet/bank transactions. - /payment/apg/process_otp: Validates OTP submissions. - /payment/apg/callback: Handles card payment callbacks.
Security
- Uses AES encryption with merchant-provided keys for API requests.
- OTP timer enhances security by limiting validation windows.
Customization
- Timer Adjustment: Modify otp_expiry_seconds in the provider settings.
Troubleshooting
- OTP Validation Fails: Verify merchant credentials and API connectivity.
- Logs: Enable debug mode (--log-level=debug) to trace issues.
Support
For assistance, contact: - Email: support@expertpk.com - WhatsApp: +92 300 7888 120
Note
Ensure Alfa Bank API credentials are correctly configured for sandbox or production use.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module