Magento 2
Lomi_Payments module, hosted checkout via checkout sessions, callback route, signed webhooks, optional REST verify.
Magento 2
Extension Lomi_Payments for Magento Open Source / Adobe Commerce. Payment method code: lomi.
Related products
- API keys: Dashboard → Developers → API keys
- Webhooks: Dashboard webhooks — subscribe to
PAYMENT_SUCCEEDEDandREFUND_COMPLETED - Hosted checkout: Checkout, where shoppers pay after redirect
- Subscriptions: Subscriptions, recurring products via checkout
Requirements
- Magento 2.4.x, PHP as required by your Magento version (7.4+ / 8.x)
- lomi. account and keys from dashboard.lomi.africa
Installation
lomi/magento2-payments is not published on Packagist. Register the GitHub repository, then install with Composer:
composer config repositories.lomi-magento vcs https://github.com/lomiafrica/magento
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 -f
php bin/magento cache:flushManual install
- Clone or download lomiafrica/magento.
- Copy the package to
app/code/Lomi/Payments/on your Magento root (the directory that containsregistration.php). - Run the same
module:enable,setup:upgrade,setup:di:compile, andcache:flushcommands as above.
Full instructions: Magento plugin README
Step 1, Get your lomi. API keys
- Sign in to dashboard.lomi.africa.
- Open Developers → API keys.
- Copy your Test secret key (
lomi_sk_test_…).
See API keys.
Step 2, Install the module
Use Composer or manual install above, then enable Lomi_Payments and flush cache.
Step 3, Configure lomi. in Magento
Stores → Configuration → Sales → Payment Methods → lomi.
- Enable the method.
- Turn Test mode on while integrating.
- Paste Test secret key and Test webhook secret.
- Save config.
Step 4, Check Setup health
The Setup health panel should show:
- API secret key: Configured
- API connection:
GET /mesucceeded - Test mode: Sandbox API active
Fix any Action required row before continuing.
Step 5, Connect webhooks
- Copy the webhook URL shown in admin (
https://your-store.example/lomi/payment/webhook). - In dashboard.lomi.africa → Webhooks, add the endpoint.
- Enable
PAYMENT_SUCCEEDEDandREFUND_COMPLETED. - Paste the signing secret into Magento (Test webhook secret).
Step 6, Run a test payment
- Place an order and select lomi. as payment.
- Pay on hosted checkout (sandbox while test mode is on).
- Confirm the Magento order is paid.
Go live
Turn Test mode off, paste live secret key + live webhook secret, and run one small real payment.
Customer flow
- Customer selects lomi. and places the order.
- Magento creates a checkout session and redirects to lomi. Checkout.
- Return URL:
lomi/payment/callback: verifies session vs order. - Webhook
PAYMENT_SUCCEEDEDwithX-Lomi-Signature/X-Lomi-Event.
Ifmetadata.magento_increment_idis missing, the module can still resolve the order usingcheckout_session_idand the stored payment fieldlomi_checkout_session_id.
Optional REST verification
GET /rest/V1/lomi/verify/{checkoutSessionId}, verifies the checkout session for the checkout session’s last real order; path segment must match lomi_checkout_session_id on that order.
Defined in etc/webapi.xml.
Webhooks
Same contract as other PHP plugins: HMAC-SHA256 hex on raw JSON body; subscribe to payment-success handling via dashboard webhooks.