This gateway integrates WooCommerce with the Mada BNPL payment platform:
POST /engine/merchant/online/orders with your X-Merchant-Api-Key and redirects the shopper to Mada’s hosted checkout portal.ORDER webhook (X-Signature: <hex>).This plugin connects to external services operated by Mada BNPL to process Buy Now Pay Later payment sessions, render promotional installment breakdown widgets, and verify order statuses.
https://api.mada-bnpl.com, https://api.sandbox.mada-bnpl.com, https://cdn.mada-bnpl.com)This plugin includes complete, unminified, human-readable source files for its WooCommerce integration code:
https://cdn.mada-bnpl.com for the selected environment.assets/js/blocks.js.npm ci, then run npm run build:bundle. The generated CDN bundle is dist/bundle.js.The webhook eventStatus maps to WooCommerce as:
Mada eventStatus
WooCommerce Result
SUCCESS
payment_complete (paid)
SETTLED
payment_complete (paid)
PENDING
on-hold
CANCELLED
cancelled
EXPIRED
failed
REJECTED
failed
Each WooCommerce order is sent to Mada with reference_id = mg_{orderId}_{timestamp}, which Mada BNPL stores and echoes back in the ORDER webhook. The plugin resolves an incoming webhook to a WooCommerce order in this order:
reference_id (mg_{id}_{timestamp}) -> WC order.orderId.orderReference.checkoutId.The webhook is the source of truth, but confirmation never depends on it alone:
GET /engine/merchant/orders/{id} and confirms the order if payment status is completed.mada_bnpl_reconcile_cron) reconciles any pending Mada orders from the last 24h via their stored order IDs.The payment method renders as the Mada badge (logo + title + description) on both classic and Blocks checkout, matching the Mada design system. Styling lives in assets/css/checkout.css; the logo is loaded from the environment CDN.