How to add Mobile Money payments to a Base44 app in Ghana
A Base44 app can take Mobile Money in Ghana in two ways. Ask the Base44 builder to add a button that opens a berrapay payment link, which works immediately. Or have it call the berrapay API from a backend function, with your key saved in the app's secrets, so each order gets its own checkout and is marked paid automatically. berrapay itself is built on Base44.
Last updated 29 November 2026.
Step by step
- 1
Open a berrapay account
Create a free berrapay account at berrapay.com as a freelancer or a business, confirm your phone number, and add your Ghana Card details. berrapay reviews every account, and collecting unlocks once yours is approved.
- 2
Quick route
Create a payment link in berrapay and ask the builder to add a button that opens it.
- 3
Save your key as a secret
Create a test key in berrapay, then in your Base44 dashboard open Secrets and add it as BERRAPAY_KEY. Add your webhook secret as BERRAPAY_WEBHOOK_SECRET. Secrets are read on the server and never reach the browser.
- 4
Ask for a backend function
Tell the builder to create a backend function that creates a berrapay checkout for an order and returns its address. The prompt in the guide to AI-built websites works as written.
- 5
Ask for a webhook function
A second backend function receives berrapay's message, checks its signature and marks the order as paid. A deployed function has its own address on your app's domain, ending in /functions/ and its name, which is what you give berrapay as the webhook address.
- 6
Test, then go live
Use the test key until both a successful and a failed payment behave correctly, then switch to a live key.
What the backend function does
// Inside a backend function: the key comes from the app's secrets, never from the page
const res = await fetch("https://berrapay.com/api/v1/checkouts", {
method: "POST",
headers: {
Authorization: "Bearer " + BERRAPAY_KEY, // read from secrets
"Content-Type": "application/json",
"Idempotency-Key": "order-" + order.id,
},
body: JSON.stringify({ amount: order.total, description: order.title, reference: String(order.id), return_url: siteUrl + "/thanks" }),
});
const checkout = await res.json();
return { url: checkout.url }; // send the customer here to payAt a glance
- Quick route
- A payment link button
- Full route
- Backend functions and secrets
- Key storage
- Base44 secrets
- Result
- Orders marked paid automatically
- berrapay
- Built on Base44 itself
Common questions
Can I put the key in the front end to keep it simple?
No. Anything in the front end can be read by visitors. Keep it in secrets and call berrapay from a backend function.
Does this work for subscriptions?
Yes. Create a plan in berrapay and link to it, or create plans through the API.
Why not Base44's built-in payments?
Base44's own payments feature is offered in a short list of countries that doesn't include Ghana, and its Stripe integration needs a Stripe account. Neither takes Mobile Money.
What does it cost?
Payments are in Ghana cedis (GHS). The payer is charged 1% when they pay by Mobile Money, never more than GHS 25 on one payment, or 1.95% when they pay by card. It is added to what they pay, so you receive the full amount. There is no setup or monthly fee, and topping up and withdrawing are free. The full list is at berrapay.com/fees.
Sources
Ask an AI assistant about this
Opens the assistant in a new tab with a question about this page already typed. You can change it before sending.