Skip to main content
All articles
Guide3 min read

Getting paid on WooCommerce in Morocco

Your WordPress store deserves better than cash on delivery — cards and cash in dirhams, signed webhooks, money available instantly.

WooCommerce powers a good share of Moroccan e-commerce: WordPress is already there, the store goes up in a weekend, hosting costs next to nothing. Then comes the payment box — and the choice narrows too fast to "cash on delivery" or "bank transfer plus a WhatsApp screenshot". Here are the two ways to plug ChariPay into your WooCommerce store, from the simplest to the most integrated.

WooCommerce notifies you of every order. All you need is to answer with a link:

  1. 1Keep "cash on delivery" or "bank transfer" as the checkout method — it is your collection point, not your actual payment.
  2. 2When the order arrives, create a payment link in the ChariPay portal for the exact amount, and send it to the customer by WhatsApp or e-mail.
  3. 3The customer pays by card (3-D Secure) or in cash: they receive a reference and deposit the amount at an agency of the Chari network — ChariPay is the only Moroccan gateway offering that choice.
  4. 4The webhook or the portal notification confirms the payment: you move the order to "Completed" in WooCommerce and ship already paid.

Zero extensions to install, zero WordPress maintenance, and cash stops riding along with your parcels.

With your developer: the gateway wired to the API

WooCommerce is built to accept a custom payment method: a PHP class that redirects to a payment page and listens for a confirmation. Your developer builds it on the ChariPay API with three bricks:

  • The payment session. On "Place order", your server calls POST /v1/payment-sessions with the amount and your return URLs, then redirects the customer to the hosted checkout — 3-D Secure included, with card data never touching your WordPress.
  • The signed webhook. The confirmation lands on your endpoint, HMAC-signed: it is what moves the order to "paid", never the browser return. If your shared hosting was down, replay happens from the portal.
  • Idempotency. A double-clicking customer, a plugin replaying a request: with Idempotency-Key, the payment is created exactly once.

The API docs give call examples in four languages, the Postman collection runs the full journey, and the self-serve sandbox lets you test the whole flow — test card included — before touching production.

Why it is worth the detour

  • The money is available instantly in your ChariPay payment account — a regulated account, with a RIB in your company's name — as soon as a payment succeeds.
  • Two methods, one reconciliation: cards and cash-at-agency land on the same statement, with accounting exports.
  • The payout to your bank runs automatically every night once a settlement account is configured, or by transfer on demand.

Where to start

Open a sandbox account — it is online, free and commitment-free — and take a test payment today. For production: a one-time MAD 6,000 activation fee (VAT included), a commission per successful payment set once your application has been reviewed, and the integration team stays with you until the first real payment.

Written by ChariPay team.

Read next

A question about your integration?

Our team supports merchants and developers alike, from the first test through to go-live.