Docs → Direct integration
Embed payment UI in your own site or app instead of redirecting customers to the MerasPay hosted checkout. You collect customer info in your own UX, we tokenise and process using the Meras JS SDK + PaymentIntents API, built for Djibouti rails.
POST /v1/payment_intents with the amount, currency, and provider. It receives a client_secret and passes only that to your browser/app.https://js.merashub.com/v1/meras.js (or @meraspay/sdk-js from npm) and initialise with your publishable key.Element for the field you need (card, OTP, MSISDN). The iframe lives on js.merashub.com, so sensitive data never enters your origin.meras.confirmPayment(piId, { client_secret }) finalises the payment. The intent transitions to succeeded and a webhook fires.# 1) Server: create the PaymentIntent
curl -X POST https://api.merashub.com/v1/payment_intents \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"amount": 50000,
"currency": "DJF",
"provider": "waafi",
"customer_msisdn": "+25377xxxxxxx"
}'
# → { "id": "pi_...", "client_secret": "pi_..._secret_...", "status": "requires_action", ... }
# 2) Browser: confirm with the client_secret
<script src="https://js.merashub.com/v1/meras.js"></script>
<script>
const meras = MerasPay.default("pk_test_...");
const intent = await meras.confirmPayment("pi_...", {
client_secret: "pi_..._secret_...",
otp: "123456",
});
if (intent.status === "succeeded") alert("paid");
</script>Mobile money + Visa/Mastercard (cards via the hosted page). Djibouti.
Bank account / card — corporate + retail. Bank-side authentication redirect.
PayMe + Fund Transfer (Saba African Bank). USSD PIN push.
Djibouti Telecom mobile money — RSA-PSS signed requests handled server-side.
Bank rail — account number debit + authentication redirect.
Visa/Mastercard via the Waafi hosted page (redirect). Cybersource CNP as the international alternate.
Ethiopia (ETB) — Telebirr, CBE & more via hosted redirect or direct charge. Also B2C payout.
Server-side calls use sk_live_… or sk_test_… — these have full scope and must stay on your backend. Browser-side calls use pk_live_… / pk_test_…, which are safe to embed: they can only confirm a PaymentIntent the bearer also holds a matching client_secret for, and create PaymentMethods. They cannot read merchant data, refund, list, or initiate charges on their own.