Odoo
Odoo — Merchant installation and setup
Overview
The MyPay modules for Odoo 18 connect your Odoo database to the MyPay payment platform (mypay.ly) so you can accept Libyan Dinar (LYD) payments through MyPay hosted checkout.
| Module | Technical name | Purpose |
|---|---|---|
| MyPay | payment_mypay |
Invoices, eCommerce / portal checkout, staff pay-on-behalf |
| POS MyPay | pos_mypay |
Point of Sale online payment (QR / hosted link) |
Guide version: 1.4.4 (aligned with module version 18.0.1.4.4).
Apps listing: MyPay on Odoo Apps (18.0)
Source: github.com/BlueTech-ly/mypay-odoo (branch 18.0)
Requirements
| Requirement | Detail |
|---|---|
| Odoo | 18.0 (Community or Enterprise) |
| Hosting | On Premise or Odoo.sh (not Odoo Online) |
| Currency | Company / journal currency LYD |
| Dependencies | payment, account_payment (pos_online_payment for POS) |
| MyPay merchant account | Active, with API access enabled |
[!NOTE] Odoo Online (SaaS) does not support third-party modules such as
payment_mypay. Use Odoo.sh or on-premise.
What you need from the MyPay dashboard
- Client ID and Secret ID (Developer / API credentials).
- (Optional) Webhook Secret if you want inbound signed webhooks.
- Enable the payment gateways you want to offer in MyPay.
Installation
1) From Odoo Apps Store
- Open MyPay for Odoo 18.
- Download the ZIP or use Deploy on Odoo.sh.
- On Premise: extract so the folder
payment_mypayis on youraddons_path. - In Odoo: Apps → Update Apps List → search MyPay → Install.
- If you use Point of Sale, install POS MyPay as well (or enable POS so
pos_mypayauto-installs when dependencies are met).
2) From Git (developers)
ssh://git@github.com/BlueTech-ly/mypay-odoo#18.0
Add the repository root to addons_path (it contains payment_mypay and pos_mypay), update the apps list, and install.
Configuration
- Go to Invoicing / Accounting → Configuration → Payment Providers → MyPay.
- Enter Client ID and Secret ID.
- Set the provider state:
| State | MyPay API base |
|---|---|
| Test | https://mypay.ly/pay/sandbox/api/v1 |
| Enabled | https://mypay.ly/pay/api/v1 |
- (Optional) Paste Webhook Secret and copy the shown Webhook URL into the MyPay merchant dashboard when you have public HTTPS.
- Publish / enable the provider and assign a payment journal if prompted.
Enabled does not require public HTTPS. Payment confirmation still works via Payment Status, return/cancel URLs, and the scheduled sync job. Webhooks are optional for faster inbound updates.
Portal / online invoice payment
Enable portal online payments in Accounting settings (account_payment.enable_portal_payment) so customers (and staff flows that rely on portal checkout) can pay open invoices online.
Staff pay on behalf of a customer
On a posted customer invoice with a residual amount:
- Click Pay via MyPay.
- Select a payment method.
- Enter a Libyan mobile number (
09xxxxxxxx). - Click Open MyPay.
Sending name + email + phone with a specific payment method enables MyPay Auto-Submit, which can skip the all-gateways selection page. Without a valid Libyan phone, MyPay may still show every gateway.
How payments are confirmed
The Odoo module is designed to work without public inbound HTTPS:
| Path | Direction | Public HTTPS on Odoo? |
|---|---|---|
| Payment Status enquiry | Odoo → MyPay | No |
| Return / cancel URL | Browser → Odoo | Reachable by the shopper |
| Scheduled action (cron) | Odoo → MyPay | No |
| Signed webhook | MyPay → Odoo | Yes (optional) |
- On browser return/cancel, Odoo calls
GET /payment/status(Basic Auth) and marks the transaction Done when status issuccess. - Cron MyPay: sync pending payment status re-checks pending (and recently canceled) transactions if the browser was closed, including Cancel→Success races.
- If configured, a signed webhook (
X-MyPay-Signature) can also confirm payment.
See Payments → Payment Status and Webhooks.
Point of Sale
- Install Point of Sale (and POS MyPay if not auto-installed).
- Publish MyPay (Test or Enabled).
- Point of Sale → Configuration → Payment Methods → MyPay — allow the MyPay provider.
- Add MyPay to your shop’s payment methods, close any open session, open a new one.
- At payment, choose MyPay — customer pays via QR / hosted link.
Company currency must be LYD.
Limits
- LYD only
- No refund API — refund manually in Odoo and in the MyPay dashboard
- No tokenization / saved cards
Troubleshooting
| Issue | What to check |
|---|---|
| Provider will not enable | Client ID / Secret ID filled; state Test or Enabled |
| No online pay on invoice | Portal online payment enabled; invoice posted with residual; currency LYD |
| MyPay shows all gateways | Select a specific payment method and send a Libyan 09xxxxxxxx phone |
| Paid on MyPay but Odoo still pending | Cron active; or complete return URL; or configure webhook + HTTPS |
| Sandbox vs production errors | Provider Test vs Enabled matches sandbox vs live credentials |
| Odoo Online | Not supported — use Odoo.sh or on-premise |
Related docs
- Authentication
- Payments
- Webhooks
- Test Data
- Flutter Package — Native in-app checkout