Bubble
Add the lomi. plugin to your Bubble.io app and accept hosted checkout payments, no code required.
Bubble
Connect your Bubble.io app to lomi. hosted checkout. Shoppers pay on a secure lomi. page (redirect or embedded modal); your Bubble Things update automatically when payment succeeds.
Who this guide is for
No-code makers: you only need a Bubble app, a lomi. account, and this page. Server actions pick the correct API host from your key, so there is no base URL to configure.
Related products
- API keys: Dashboard → Developers → API keys
- Webhooks: Dashboard webhooks — subscribe to
PAYMENT_SUCCEEDEDandREFUND_COMPLETED - Hosted checkout: Checkout, where shoppers pay after redirect
- Embed widget: Embed widget, alternative when you want a button on a Bubble page
Before you start
| Requirement | Details |
|---|---|
| Bubble app | Any paid plan that supports installed plugins |
| Plugin API version | 4 (set in the plugin Shared tab) |
| Store currency | XOF, USD, or EUR |
| lomi. account | Create one free |
| HTTPS | Bubble apps are HTTPS by default (required for webhooks and return URLs) |
Step 1, Get your lomi. API keys
- Sign in to dashboard.lomi.africa.
- Open Settings → Access tokens (or Developers → API keys).
- Copy your Test secret key (
lomi_sk_test_…); you will paste it into Bubble in step 3. - From Developers → Webhooks, you will also copy a signing secret (
whsec_…) in step 6.
Keep Test mode on while integrating. See API keys for details.
Step 2, Add the lomi. plugin in Bubble
- In the Bubble editor, open the Plugins tab → Add plugins.
- Install lomi. (or, for a private build, sync the
lomiafrica/bubblerepo from Plugins → Version → Synchronize with GitHub). - Open the plugin Shared tab and confirm Plugin API version is 4.
Step 3, Enter your keys
Open Plugins → lomi. in your app and fill the environment-specific fields:
| Field | Development (test) | Production (live) |
|---|---|---|
| API secret key | lomi_sk_test_… | lomi_sk_live_… |
| Webhook secret | whsec_… (test endpoint) | whsec_… (live endpoint) |
Server actions select sandbox.api.lomi.africa or api.lomi.africa from the key prefix automatically, there is no host to set.
Step 4, Build the checkout workflow
On your Pay button, run these actions in order:
- Create checkout session (server): set
amount(XOF whole francs; USD/EUR major units),currency_code, and yoursuccess_url/cancel_url. Setbubble_thing_typeandbubble_thing_idso the webhook can find the right Thing later. - Mark checkout redirect (client): call before redirecting (the lomi. Pay button element does this for you).
- Redirect to checkout (client) with the
checkout_urlreturned in step 1, or drop the lomi. Pay button element and bind its Checkout URL to that result.
Every session created this way is tagged with integration_source: bubble automatically.
Step 5, Complete or abandon on the success page
On your success_url page:
- Read
session_idfrom the page URL (Get data from page URL). - Run Complete if paid with that
session_id. - If
paidis yes, mark your Thing paid and show confirmation. - If
paidis no, run Abandon checkout. A browser back after redirect also fireslomi:checkout-abandon(handled out of the box), so no extra configuration is needed for cart recovery.
Step 6, Connect webhooks
Webhooks confirm payment even if the shopper closes the tab before returning.
- Expose a backend workflow as a POST API endpoint in Bubble.
- In that workflow, run Verify and parse webhook with the raw body and the
X-Lomi-Signatureheader. - Branch on
PAYMENT_SUCCEEDED→ mark the Thing paid (make it idempotent so a duplicate event is safe). - Branch on
REFUND_COMPLETED→ mark the Thing refunded. - In dashboard.lomi.africa → Developers → Webhooks, add your Bubble endpoint URL, enable
PAYMENT_SUCCEEDEDandREFUND_COMPLETED, and paste the signing secret back into Plugins → lomi..
Step 7, Run a test payment
- Preview your app and click the Pay button.
- You are sent to lomi. Checkout (sandbox while your test key is set).
- Pay with test card
4242 4242 4242 4242(any future expiry, any CVC). See Sandbox payments. - Confirm the success page shows
paid = yesand your Thing is marked paid. - If the Thing stays unpaid, check that the webhook secret matches and
PAYMENT_SUCCEEDEDis enabled on your dashboard endpoint.
Go live
When you are ready for real payments:
- Switch your app to its live version and use the Production key fields.
- Paste your Live secret key and Live webhook secret (create a live webhook endpoint in the dashboard pointing at your live Bubble URL).
- Run one small real payment and confirm the Thing completes.
See also Verify payments.
Refunds, embed mode, and reference
Refunds: issue from the dashboard; the REFUND_COMPLETED webhook updates your Thing.
Embed mode: set the lomi. Pay button (or Open checkout embed) to embed to keep shoppers in your app; listen for oncomplete or the lomi:checkout-complete window event. This reuses the embed widget.
Webhook headers: X-Lomi-Event, X-Lomi-Signature (HMAC-SHA256 hex of the raw body). Details: Handling webhooks and Webhooks.
For developers
GitHub, embed asset builds, and API internals are documented separately:
- E‑commerce hub, shared API contract
- bubble repository, plugin source and
docs/SETUP.md - Embed asset chain: build
@lomi./embedIIFE, then runscripts/build-assets.mjs(contributors only)