Accept Magento 2 payments with lomi. hosted checkout in XOF, USD, and EUR.
Package: lomi/magento2-payments
Module: Lomi_Payments
Payment method code: lomi
The extension connects your Magento store to lomi. hosted checkout:
- Customer selects lomi. at checkout and places the order.
- Magento creates a checkout session via the lomi. API.
- Customer pays on
checkout.lomi.africa. - Magento confirms payment via webhook (
PAYMENT_SUCCEEDED) and/or return URL (/lomi/payment/callback). - Order moves to Processing.
- Magento 2.4.x (PHP 7.4+ / 8.x as supported by your Magento version)
- Store currency XOF, USD, or EUR
- HTTPS on production (required for webhooks and secure checkout return URLs)
- lomi. account, dashboard.lomi.africa
composer require lomi/magento2-payments
php bin/magento module:enable Lomi_Payments
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento cache:flushCopy this package to app/code/Lomi/Payments/, then run the same Magento commands above.
Stores → Configuration → Sales → Payment Methods → lomi.
| Setting | Description |
|---|---|
| Enabled | Show lomi. at checkout |
| Title | Label on checkout (empty = default branding card) |
| Test Mode | Yes = sandbox API; No = live API |
| Test API secret key | lomi_sk_test_… from dashboard |
| Test webhook signing secret | whsec_… from your test webhook endpoint |
| Live API secret key | lomi_sk_live_… (when Test Mode is No) |
| Live webhook signing secret | whsec_… from your live webhook endpoint |
| Webhook URL | Read-only hint, register this URL in the dashboard |
- In dashboard.lomi.africa → Developers → Webhooks, create an endpoint:
- URL:
https://your-store.example/lomi/payment/webhook - Events: at least
PAYMENT_SUCCEEDED
- URL:
- Copy the signing secret (
whsec_…) into Magento (test or live field matching Test Mode). - Send a test webhook from the dashboard, expect 200 with body
ignoredfor test events, orsuccessfor realPAYMENT_SUCCEEDED.
Important: Use the signing secret for that specific endpoint, not your API secret key. Test and live webhooks have different secrets.
When saving obscure (password) fields in admin, paste the full secret each time. If in doubt, set via CLI:
php bin/magento config:set payment/lomi/test_webhook_secret "whsec_..."
php bin/magento cache:flush| Currency | Amount sent to lomi. API |
|---|---|
| XOF | Whole francs (e.g. 505 → 505) |
| USD / EUR | Minor units / cents (e.g. 10.50 → 1050) |
Stores using other currencies will not see this method at checkout.
Checkout → Place order → Redirect to lomi. hosted checkout
→ Payment success
→ Webhook PAYMENT_SUCCEEDED → Order Processing
→ (and/or) Redirect to /lomi/payment/callback → Order Processing
Return URL pattern:
https://your-store.example/lomi/payment/callback?increment_id=…&key=…
Webhook headers: X-Lomi-Signature, X-Lomi-Event: see webhooks documentation.
- Enable Test Mode and enter test API key + test webhook secret.
- Create a webhook in dashboard test mode pointing to your store (use ngrok for local dev, see dev/README.md).
- Place a test order; pay with card
4242 4242 4242 4242(any future expiry, any CVC). - Confirm:
- Webhook log:
PAYMENT_SUCCEEDED→ 200 - Magento order: Processing
- Webhook log:
More test cards: Sandbox payments.
- Production store served over HTTPS
- Test Mode = No
- Live API secret key and live webhook signing secret configured
- Live webhook in dashboard with production URL and
PAYMENT_SUCCEEDED - Base URLs in Stores → Configuration → General → Web match your public domain
-
setup:di:compileand static content deploy run in production mode - End-to-end test with a small real payment (or live test card if available)
| Test Mode | API base |
|---|---|
| Yes | https://sandbox.api.lomi.africa |
| No | https://api.lomi.africa |
- Webhook secret mismatch (401
auth failed) - Webhook not subscribed to
PAYMENT_SUCCEEDED - Checkout session not
completedyet on lomi. API - Customer did not return to your store (webhook is the reliable path)
Process refunds from the lomi. dashboard. Automatic Magento refunds are not included in this release.
GET /rest/V1/lomi/verify/:checkoutSessionId: verifies payment for the checkout session’s last order (browser session context). Defined in etc/webapi.xml.
Run setup:upgrade after upgrading; a data patch migrates legacy config and payment method codes where applicable.
Local Docker environment: dev/README.md.
French merchant guide: docs/GUIDE.fr.md.
See CHANGELOG.md.
MIT, see LICENSE.