SoftPay: payment inside your page, in your colors
SoftPay displays the operator selection, the phone number, the confirmation code, the app link (Wave, Djamo) and the payment tracking directly inside your page, without going through the Cartflox page. The form is displayed in a secure frame served by Cartflox: your colors go through the theme option, your texts through labels. Only your public key is used in the browser.
The footer of the form always carries the “Powered by Cartflox” mention with a link to cartflox.com: it is part of the SoftPay terms of use and cannot be removed. Since version 2 (October 2, 2026), the form lives in the Cartflox frame and headless mode is discontinued.
Try it right now: SoftPay demo with your public key and your colors.
Integration
Section titled “Integration”<div id="paiement"></div><script src="https://cartflox.com/cartflox-softpay.js"></script><script> Cartflox.softpay.configure({ publicKey: "af_live_pub_YOUR_KEY" }); Cartflox.softpay.mount({ container: "#paiement", amount: 5000, currency: "XOF", country: "ci", // payment methods offered (ci, sn, bj, ml, bf, tg, cm...) description: "Order #1042", metadata: { order_id: "1042" }, merchant_name: "My Store", // optional: name shown on receipts and on the equivalent Cartflox page merchant_logo: "https://maboutique.com/logo.png", theme: { accent: "#1a1a1c", "accent-text": "#ffffff", radius: "0px", font: "Arial, sans-serif" }, onSuccess: function (r) { /* show a thank-you message; validate server-side */ }, onError: function (e) { console.error(e); } });</script>mount options
Section titled “mount options”| Option | Type | Required | Description |
|---|---|---|---|
container |
string or element | Yes | CSS selector or element that receives the form |
amount |
number | Yes | Amount, integer for CFA francs |
currency |
string | No | XOF by default |
country |
string | No | Country of the offered methods (ci, sn, bj, ml, bf, tg, cm, gn…). Without a value: all active operators |
description, customer_name, customer_email, customer_phone, metadata, success_url, cancel_url |
No | Same fields as POST /v1/checkout/sessions |
|
merchant_name, merchant_logo |
string | No | Name and logo (https address) shown on the equivalent Cartflox page and on receipts, instead of your workspace’s |
title |
string | No | Form title (“Payment” by default) |
theme |
object | No | CSS variables without the prefix: { accent, "accent-text", bg, text, muted, border, field, radius, font } |
labels |
object | No | Labels to replace (see Texts) |
autoRedirect |
boolean | No | false so that the customer is not sent to a hosted page automatically: you receive the URL in onRedirect and handle it yourself |
timeoutMs |
number | No | Maximum time to track a pending payment (180,000 ms by default) |
onSession, onStatus, onRedirect, onSuccess, onError |
function | No | See Events |
configure accepts publicKey (required), country (default country) and baseUrl (only if you serve the script from another domain).
Customize the style
Section titled “Customize the style”Pass your colors in the theme option of mount: each key becomes a --cf-* variable of the form. Your own stylesheet does not reach the Cartflox frame.
| Variable | Role |
|---|---|
--cf-accent |
Color of the Pay button and of the selection |
--cf-accent-text |
Button text color |
--cf-bg |
Form background |
--cf-text |
Main text |
--cf-muted |
Secondary text |
--cf-border |
Borders |
--cf-field |
Field background |
--cf-radius |
Overall border radius |
--cf-font |
Font (the system font by default; pick a font available everywhere, such as Arial or Georgia) |
All labels can be replaced with the labels option, for example labels: { payer: "Pay now", telephone: "Your Mobile Money number", succes: "Payment received!" }.
Events
Section titled “Events”| Event | When |
|---|---|
onSession(s) |
Session created: s.id, s.orderId, s.url (the equivalent Cartflox page) |
onStatus(r) |
On each payment or tracking response: r.status |
onRedirect(url) |
Hosted page (cards, some aggregators): the URL the customer is leaving for, autoRedirect: false to handle it yourself. Also called for an app link (Wave, Djamo): the widget then stays displayed with the “Open” button and tracks the payment. |
onSuccess(r) |
Payment confirmed: r.sessionId, r.orderId, r.amount, r.currency |
onError(e) |
Payment declined, timeout or network error: e.message |