SANDBOX — simulated integrations, synthetic data, no real money moves · Docs describe the sandbox build
Skip to content

Accept payments

Embedded checkout — shoppers never leave your site

Offer “Buy Now Pay Later with AltBank” on any website. The Bank-hosted checkout opens in a secure panel on your own payment page and closes back to it — no redirect.

How it works#

  1. 1Shopper picks Buy Now Pay Later with AltBank on Your website’s payment screen.
  2. 2Your website’s server creates a checkout session with its secret key.
  3. 3The Bank’s secure checkout opens in a panel on Your website’s page — no redirect.
  4. 4The shopper closes the panel and is still on Your website. Your website confirms the status server-side.
Buy Now Pay Later with AltBank

Add the button#

Load the SDK from the Bank’s checkout origin, create the session on your server, then open the panel with the returned checkout_url.

Your payment page (HTML)
<!-- 1. On your payment page -->
<script src="https://checkout.pay.araf.ng/v1/araf.js"></script>
<div id="altbank-bnpl"></div>
<script>
  ArafCheckout.button('#altbank-bnpl', {
    // Label: "Buy Now Pay Later with AltBank"
    onClick: async () => {
      // 2. Your SERVER creates the session (never put your secret key in the browser)
      const res = await fetch('/checkout/araf-session', { method: 'POST' });
      const { checkout_url } = await res.json();
      // 3. The Bank's checkout opens in a panel on THIS page — no redirect
      ArafCheckout.open({
        checkoutUrl: checkout_url,
        onClose: () => location.reload(), // 4. then re-read the order status from your server
      });
    },
  });
</script>
Your server
# Your server (secret key stays here)
curl -X POST https://pay-with-araf.onrender.com/api/v1/checkout/sessions \
  -H "Authorization: Bearer $ARAF_SECRET_KEY" \
  -H "Idempotency-Key: order-<your order ref>" \
  -H "Content-Type: application/json" \
  -d '{ "merchant_order_reference": "<your order ref>", "currency": "NGN", "amount": 64500000,
        "items": [ ... ], "customer": { "email": "..." },
        "return_url": "https://your-site/orders/<ref>", "cancel_url": "https://your-site/cart" }'
# → { "checkout_url": "…/c/cs_test_…" }  pass checkout_url to ArafCheckout.open()
checkoutUrl
stringrequired
The checkout_url from POST /checkout/sessions. Must be on the SDK’s own origin.
onClose
({ reason }) => voidoptional
Panel closed: customer, escape, return, cancel, equity (customer must pay equity to you) or complete.
onComplete
({ outcome, application_reference }) => voidoptional
SUBMITTED, DECLINED, CANCELLED, EXPIRED or DELIVERED. A hint for your UI only.
onEvent
(event) => voidoptional
Every event, including araf:status { stage, label }.

Events#

EventWhen
araf:readyCheckout loaded inside your page
araf:statusProgress changed (stage and customer-facing label, no personal or credit data)
araf:completeA terminal or milestone outcome was reached
araf:closeThe checkout asked to return the shopper to your page (reason: return, cancel, equity)
araf:closedThe panel closed (sent by the SDK)

Security#

Events are hints — never proof

Before fulfilling, confirm status with GET /api/v1/orders/{ref} or signed webhooks, and release goods only after goods.release_authorized.

The checkout can only be framed by websites the Bank approved for your account (Content-Security-Policy frame-ancestors); any other site sees a blank frame. The iframe is sandboxed so it can never navigate or script your page, messages are only accepted from the checkout origin, and in production the customer session cookie is SameSite=None; Secure; Partitioned so it works inside your page without third-party tracking. Steps that need a provider page (Remita mandate, Mono bank connection) stay inside the panel in the sandbox; production adapters that a provider will not allow inside a frame open in a pop-up and return to the panel.

Slow networks and refreshes#

SituationWhat happens
Shopper double-clicks or your page retries session creationUse your order reference as the Idempotency-Key: the same session is returned, never a second application.
Connection drops while the customer submits a stepThe checkout retries with the same idempotency key; if the first attempt succeeded the stored result is replayed, so nothing is applied twice.
Retries are exhaustedThe checkout re-reads the authoritative state from the Bank and tells the customer whether the step went through.
Customer refreshes or closes the panelProgress is saved server-side. Re-open the panel with the same checkout_url to continue; a new browser requires a one-time code.
Customer goes offlineAn offline notice is shown; the checkout re-reads the state when the connection returns.