Moyasar Payments (mada and Cards)
Take mada and card payments in Odoo through Moyasar's hosted payment page: server-side verification, signed webhooks and refunds, with no card data on your server.
What it does
Adds Moyasar as an Odoo payment provider. When a customer pays an order, invoice or payment link, Odoo creates a Moyasar invoice and sends the customer to Moyasar's hosted payment page; the card details are entered there, never in Odoo.
The return page, Moyasar's invoice callback and the webhooks are only signals: Odoo reads the invoice back from Moyasar and checks its reference, currency and amount (in halalas) before the payment is confirmed. Payment links expire after 24 hours, so an old link cannot be paid later.
Full and partial refunds from Odoo, checked against Moyasar's refunded total so nothing is refunded twice.
Demo video
The video loads from YouTube (privacy-enhanced mode) when you press play. Watch on YouTube
Features
| Feature | What it does |
|---|---|
| Hosted payment page | A Moyasar invoice per attempt (amount in the smallest unit, your reference in its metadata, 24-hour expiry); no card data in Odoo. |
| Verified payments | Return page, invoice callback and webhooks trigger a read of the invoice; id, reference, currency, amount and a matching paid payment are required. |
| Signed webhooks | Moyasar sends the shared secret Odoo registered; webhooks without it, or from the other mode (live/test), are refused. |
| Refunds | Full and partial, compared with Moyasar's refunded total before each one. |
| Key check | A live key on a provider in Test Mode, or a test key on an enabled one, is refused. |
| Scheduled check | Reads open invoices again for customers who closed the browser before coming back. |
| History | One row per Moyasar call and webhook, refused ones included; keys visible to administrators only and never logged. |
Setup
- Install the module. In Odoo: Invoicing/Accounting or Website > Configuration > Payment Providers > Moyasar.
- Enter the Secret Key from the Moyasar dashboard: sk_test_... with the provider in Test Mode, sk_live_... when enabled. Click Test Connection.
- Make sure web.base.url is the public https address of your Odoo, then click Register Webhook. If Moyasar asks to verify the webhook, Odoo answers the verification code by itself.
- Publish the provider.
Requirements
- Odoo 17, 18, 19 or 20, Community edition
- Odoo apps: Payment
- Python requests on the Odoo server
What it does not do
- Moyasar's embedded JavaScript card form, saved cards (tokens), payment intents and SADAD bills.
- Manual capture and void (Moyasar captures invoice payments).
- Apple Pay, Samsung Pay or STC Pay sessions in your own checkout page (the hosted page offers what your Moyasar account enables).
Tests
| Odoo | Tests passed | Last run |
|---|---|---|
| 17 | 66 | |
| 18 | 66 | |
| 19 | 66 | |
| 20 | 66 |
The tests ship with the module source, so you can run them on your own server.
Questions
Does Odoo see card numbers?
No. The customer pays on Moyasar's hosted page; Odoo only receives the invoice and payment status from the Moyasar API.
Which key do I use?
The secret key: sk_test_... in Test Mode, sk_live_... when the provider is enabled. A key of the wrong mode is refused before any call.
Can someone fake a Moyasar webhook?
A webhook without the shared secret is refused. One with it still changes nothing by itself: Odoo reads the invoice from Moyasar and follows that.
What if a customer opens an old payment link?
Links expire after 24 hours; an expired invoice cancels the Odoo transaction.
Selling in Saudi Arabia?
The ZATCA readiness review checks your Odoo setup against ZATCA Phase 2 e-invoicing for SAR 4,500, credited to the integration project.