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

Accept payments

Redirects & return URLs

Send the customer to the hosted checkout, then bring them back to your store. A redirect is a navigation event — never a payment or release confirmation.

Redirect to checkout#

Redirect the customer’s browser to checkout_url with an HTTP 303 See Other (or a full-page navigation). Do not embed the hosted checkout in an iframe — it refuses to be framed. Each session belongs to one customer; never share a checkout_url between customers.

Express
app.post('/checkout/pay-with-araf', async (req, res) => {
  const session = await createArafSession(req.user, req.session.cartId); // server-side call
  res.redirect(303, session.checkout_url);
});

Handling return_url#

When the customer leaves the hosted checkout they are sent to your return_url. Arriving there means only that the customer came back — the application may be eligible, under review, approved, declined or still in progress. Financing approval can take minutes to days.

Never treat a redirect as proof of payment

Query strings and redirects can be forged or replayed by anyone. On your return page, look up the order on your server and call GET /api/v1/applications/{reference}. Release goods only after verifying the release authorisation.
Return page (server)
export default async function OrderReturnPage({ params }: { params: { order: string } }) {
  const order = await db.orders.find(params.order);              // your own record
  const app = await araf.get(`/applications/${order.arafReference}`); // authoritative status
  return <OrderStatus status={app.status} />;                      // e.g. "Under review"
}

Show the customer an honest status, for example:

  • SUBMITTED — “Your financing application is with The Alternative Bank. It is not yet approved.”
  • APPROVED … VENDOR_PAYMENT_CONFIRMED — “Financing approved. We will prepare your order once the Bank authorises release.”
  • READY_FOR_RELEASE — prepare the order, after verifying the release.
  • DECLINED — “Pay with ARAF could not finance this purchase.” Offer other payment methods. Do not speculate about reasons; none are shared with merchants.

Handling cancel_url#

The customer chose to leave without completing. Keep the cart, and offer to resume (redirect to the same checkout_url while the session is active) or to choose another payment method. If they change the cart, create a revised session.

What the customer sees#

The hosted checkout guides the customer through identity verification (BVN and date of birth), a preliminary eligibility check, account selection or opening, statement sharing, an indicative offer, the Murabaha documents and the repayment mandate.