Provider · Bank

CAC International Bank

Retail and corporate account debits. A single initiate call returns a redirect_to_url for bank-side authentication; we listen for the bank's callback and finalise the intent.

RedirectC2B + B2C

1 · Server: create the intent

bashbash
curl -X POST https://api.merashub.com/v1/payment_intents \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 250000,
    "currency": "DJF",
    "provider": "cac",
    "customer_account": "DJ12345678901234",
    "return_url": "https://yoursite.example/orders/42/return"
  }'

2 · Browser: redirect, then poll

tsts
const meras = MerasPay("pk_test_...");
const intent = await meras.retrievePaymentIntent(piId, clientSecret);
if (intent.next_action?.type === "redirect_to_url") {
  window.location.href = intent.next_action.redirect_url;
}
// On return, your return_url page polls:
const updated = await meras.retrievePaymentIntent(piId, clientSecret);
// status: "succeeded" or "canceled"

JWT cache + auto-retry

We cache upstream JWTs and retry once on 401 with a fresh token — your integration doesn't see CAC's token rotation.

Corporate vs retail

Corporate accounts may require dual approval at CAC's side; CAC surfaces this in their redirect. The intent stays requires_action until both signatures land.

Sandbox

  • Account DJ00000000000000 always succeeds
  • Account DJ00000000000001 always declines