MyFatoorah Payment Gateway
The ECOSIRE MyFatoorah Payment Gateway module connects Odoo's native payment framework to MyFatoorah, the leading Kuwait/GCC payment aggregator. Customers can pay via KNET, SADAD, BENEFIT, NAPS, Mada, Apple Pay, Samsung Pay, STC Pay, and international Visa/Mastercard cards through a hosted redirect checkout -- no PCI scope falls on the Odoo server. After the customer completes payment, Odoo performs a server-side status re-fetch before marking the transaction done; the redirect body is never trusted on its own.
Compatibility: Odoo 17 / 18 / 19 Price: $249 (one-time) License: LGPL-3 -- up to 3 domain activations
Key Features
- Native
payment.providerintegration -- works in eCommerce, customer portal, invoicing, and subscription payment flows - Hosted redirect checkout (MyFatoorah-managed payment page -- no PCI scope on your server)
- Payment methods: KNET (Kuwait), SADAD + Mada (Saudi Arabia), BENEFIT (Bahrain), NAPS (Qatar/Oman), Visa/Mastercard (all GCC + international), Apple Pay, Samsung Pay, STC Pay (where enabled by your merchant account)
- Server-side status polling via
GetPaymentStatus-- redirect body is never trusted alone - Refunds processed directly from the Odoo refund flow via
MakeRefund - Separate test and live API tokens -- sandbox hits
apitest.myfatoorah.com, production hitsapi.myfatoorah.com - Optional callback shared-token guard (defence-in-depth anti-CSRF)
- Correct currency precision: KWD/BHD/OMR/JOD at 3 decimals; SAR/AED/QAR/EGP/USD at 2 decimals
- Supported currencies: KWD, SAR, AED, BHD, QAR, OMR, EGP, USD, JOD
- ECOSIRE license enforcement via
ecosire_license_client
Prerequisites
- Odoo 17, 18, or 19 (Community or Enterprise edition)
- An active ECOSIRE license for this module (
ecosire_license_clientmust be installed) - A live MyFatoorah merchant account to accept real payments -- sign up at portal.myfatoorah.com
- A separate MyFatoorah test account/token for sandbox testing (credentials are not shared between environments)
JazzCash and EasyPaisa are not part of the verified MyFatoorah v2 API surface available to standard merchants. If your merchant account has integrator-gated access to these wallets, contact ECOSIRE support -- the connector will raise a clear error rather than silently calling unverified endpoints.
Installation
- Download the module ZIP from your ECOSIRE Dashboard
- Extract to your Odoo addons directory:
unzip ecosire-payment-myfatoorah-*.zip -d /opt/odoo/addons/ - Restart the Odoo service:
sudo systemctl restart odoo - Navigate to Apps, click Update Apps List
- Search for "ECOSIRE Payment MyFatoorah" and click Install
- Activate your ECOSIRE license when prompted (Settings > ECOSIRE License)
Configuration
Step 1: Obtain Your MyFatoorah API Tokens
- Log in to the MyFatoorah merchant portal
- Navigate to Settings > API Key
- Copy your Live API Token -- this is used when the provider is set to Enabled (production)
- Switch to your test account (or use the MyFatoorah demo portal at
apitest.myfatoorah.com) and copy the Test API Token -- this is a separate credential; never reuse the live token in test mode - Note which payment methods your merchant account has enabled (KNET, SADAD, BENEFIT, etc. -- available methods depend on your country setting and merchant agreement)
Step 2: Enable the Provider in Odoo
- Navigate to Accounting > Configuration > Payment Providers (or Website > Configuration > Payment Providers for eCommerce)
- Click Create or find the MyFatoorah entry that was seeded on install
- On the Credentials tab, enter:
| Field | Description |
|---|---|
myfatoorah_api_key -- Live API Token | Bearer token from the MyFatoorah portal for production use |
myfatoorah_test_api_key -- Test API Token | Separate sandbox token; used when provider state is Test |
myfatoorah_payment_method_id -- Default Payment Method Id | Set to 0 to show the MyFatoorah hosted page with all enabled methods (recommended). Use a specific integer to pre-select a single method (e.g. KNET only). |
myfatoorah_callback_token -- Callback Shared Token (optional) | If set, this token is appended to the callback URL as cb_token=... and verified on inbound callbacks. The authoritative check is always a server-side GetPaymentStatus re-fetch; this is a defence-in-depth guard only. |
- Set the State to Test while verifying your integration, then switch to Enabled for live payments
- Confirm your Supported Currencies match what your MyFatoorah merchant account allows (KWD, SAR, AED, BHD, QAR, OMR, EGP, USD, JOD are supported by the connector)
Step 3: Webhook and Return URLs
Odoo registers two inbound routes automatically on install -- you do not need to configure these manually in most setups:
| Route | Purpose |
|---|---|
/payment/myfatoorah/return | Customer redirect-back URL after payment on the hosted page. MyFatoorah appends ?paymentId=... here. Odoo calls GetPaymentStatus server-side before updating the transaction. |
/payment/myfatoorah/webhook | Optional server-to-server notification endpoint (JSON POST). Uses the same GetPaymentStatus re-fetch for authentication -- no inbound HMAC signature is relied upon because MyFatoorah's signature scheme is not reliably documented. |
If your Odoo instance is behind a reverse proxy, ensure both routes are reachable from the public internet. In the MyFatoorah portal you may optionally register your webhook URL under Settings > Webhooks / Notifications, pointing to https://your-odoo-domain.com/payment/myfatoorah/webhook.
MyFatoorah does not publish a reliable inbound HMAC/signature header scheme. The connector authenticates all inbound callbacks by calling GetPaymentStatus server-side with the paymentId from the callback payload. This is the recommended approach per the MyFatoorah integration documentation and is more robust than a signature header.
Usage
Checkout Flow
- Customer adds items to cart and proceeds to checkout
- Odoo calls
InitiatePaymentto discover available payment methods for the transaction currency, then callsExecutePaymentto create the payment session - Odoo stores the returned
InvoiceIdas the transaction reference (provider_reference) and redirects the customer to the MyFatoorah hosted page - Customer selects their payment method (KNET, Visa, Apple Pay, etc.) and completes payment on the MyFatoorah-managed page
- MyFatoorah redirects the customer back to
/payment/myfatoorah/return; Odoo immediately callsGetPaymentStatusserver-side - The transaction is marked Done (InvoiceStatus = Paid), Pending, Error (Failed), or Cancelled (Expired) based on the server-confirmed status
Refunds
- Open the paid customer invoice in Odoo and click Credit Note
- Odoo calls
MakeRefundvia the MyFatoorah API - The refund is credited back to the customer's original payment method
Partial refunds may not be supported for KNET payments (Kuwait national debit network). Full refunds are always supported. If a partial refund is required on a KNET transaction, contact your MyFatoorah merchant support directly.
Test Mode
Set the provider state to Test and use your Test API Token to run end-to-end test transactions without real charges. The connector hits https://apitest.myfatoorah.com in test mode. MyFatoorah provides test card numbers on their developer portal for simulating Paid, Failed, and Pending outcomes.
API Details
| Field | Value |
|---|---|
| Auth method | Bearer token (Authorization: Bearer {api_token}) |
| Live base URL | https://api.myfatoorah.com |
| Test base URL | https://apitest.myfatoorah.com (source-verified) |
| Implemented endpoints | InitiatePayment, ExecutePayment, GetPaymentStatus, MakeRefund |
| Gated endpoints | DirectPayment, ExecuteRecurringPayment, split payments (Suppliers array) -- raise a clear UserError until merchant-level enablement is confirmed |
| Key config fields | myfatoorah_api_key, myfatoorah_test_api_key, myfatoorah_payment_method_id, myfatoorah_callback_token |
| Return URL | /payment/myfatoorah/return |
| Webhook URL | /payment/myfatoorah/webhook |
| Supported currencies | KWD, SAR, AED, BHD, QAR, OMR, EGP, USD, JOD |
Troubleshooting
| Issue | Solution |
|---|---|
| "No MyFatoorah API token configured" | Add the correct token on the provider's Credentials tab. Test mode requires the Test API Token; live mode requires the Live API Token. |
| Payment status stays Pending after redirect | Odoo's GetPaymentStatus call may be failing. Check Odoo server logs for network errors reaching api.myfatoorah.com. Verify the paymentId query param is included in the return URL. |
| "MyFatoorah error: ..." in checkout | The IsSuccess=false message from MyFatoorah is surfaced directly. Common causes: invalid token, unsupported currency for your merchant account, or expired payment session. |
| Callback token mismatch warning | The cb_token in the inbound callback does not match the Callback Shared Token on the provider. Either clear the field (disable this optional guard) or ensure the value in the portal matches exactly. |
| Currency not available at checkout | The currency is not in the connector's supported list (KWD, SAR, AED, BHD, QAR, OMR, EGP, USD, JOD) or your merchant account does not have that currency enabled. Check your MyFatoorah merchant settings. |
| Refund fails on KNET transaction | KNET may only support full refunds. Process the full refund instead of a partial one, or contact MyFatoorah merchant support. |
| "License not active" error | Activate your ECOSIRE license at Settings > ECOSIRE License. API calls are blocked until the license is confirmed. |
| Direct payment / recurring billing not available | DirectPayment and ExecuteRecurringPayment require PCI/tokenization enablement on your merchant account. These endpoints are intentionally gated; contact ECOSIRE support if you have confirmed merchant-level access. |
| Test payments going to live | Confirm the provider State is set to Test (not Enabled). In test mode the connector uses your Test API Token and hits apitest.myfatoorah.com. |