Configuration

All options passed to mount(selector, config).

Config options

OptionTypeRequiredDefaultDescription
amountnumberYes—Amount in major units (25.5 is 25.50). With clientSecret, the session’s amount.
currencystringYes—ISO 4217 code your business accepts (USD, ZWG, KES …). With clientSecret, the session’s currency.
referencestringYes—Your order or invoice reference
clientSecretstringNo—The client_secret of a checkout session your server created (POST /v1/checkout/sessions). Recommended: the server decides the amount.
paymentLinkSlugstringNo—Pay a payment link (its own amount and settings)
invoiceSlugstringNo—Pay an invoice (its balance decides what may be charged)
descriptionstringNo—Short description shown to the customer
tabs('card' | 'mobile_wallet' | 'zimswitch' | 'qr')[]NoEvery method your business offersLimit the payment methods shown
layout'inline' | 'split'NoCheckout Studio settingMethods above the form, or beside it on wide screens
themeWatengaThemeNoCheckout Studio designColours, border radius and font family
appearanceWatengaAppearanceConfigNoCheckout Studio designThe full Checkout Studio appearance, plus your own variables and element rules
brandingbooleanNoCheckout Studio settingfalse hides the “Powered by Watenga” footer
buttonLabelstringNoPayPay button text (the amount is added)
customerNamestringNo—Prefill the customer’s name
customerEmailstringNo—Prefill the customer’s email (receipts)
customerPhonestringNo—Prefill the mobile-money number
customFieldValuesRecord<string, string>No—Stored with the transaction; never sent to payment providers
attributionRecord<string, string>No—Campaign tags (utm_source …) recorded on payment-link payments
returnUrlstringNoThe current pageWhere the card step sends the customer back; the page gets watenga_payment and watenga_status
beforePayment() => booleanNo—Return false to stop a payment (for example, your form is invalid)
onReady() => voidNo—The checkout is on the page and ready (once per mount)
onSuccess(txn: WatengaTransaction) => voidYes—The payment is confirmed (confirm it on your server too: re-read the transaction or wait for the webhook)
onPending(pending) => voidNo—A payment is waiting on the customer (a mobile-money prompt on their phone)
onCancel(cancelled) => voidNo—The customer cancelled or declined; nothing was charged and the checkout stays open
onError(err: WatengaError) => voidYes—The payment failed or the checkout could not load
onClose() => voidNo—The customer closed the checkout (modal)