wunapay/Developers · Plugins & SDKsDéveloppeurs · Plugins & SDK

Plugins and libraries.Plugins et bibliothèques.

Add Mobile Money to WooCommerce, PrestaShop, WHMCS or Odoo, or use our small Node.js and PHP libraries in your own code. All of them retry safely for you.Ajoutez le Mobile Money à WooCommerce, PrestaShop, WHMCS ou Odoo, ou utilisez nos petites bibliothèques Node.js et PHP dans votre propre code. Tous réessaient sans risque pour vous.

Last updated: November 2026 (0.9.16)Dernière mise à jour : novembre 2026 (0.9.16)

WooCommerce

WunaPay for WooCommerce 1.3.0

WordPress 6.0+, WooCommerce 7.0+, PHP 7.4+. Shop currency must be FCFA (XAF).

Download plugin
  1. In WordPress, go to Plugins → Add New → Upload Plugin, choose wunapay-woocommerce.zip, then Install and Activate. Updating? Upload the new zip and choose Replace current with uploaded: your settings are kept.
  2. Check WooCommerce → Settings → General: currency must be Central African CFA franc.
  3. Open WooCommerce → Settings → Payments → WunaPay and paste your secret key from the WunaPay dashboard (Developers).
  4. Copy the webhook URL shown in the plugin settings and paste it in the WunaPay dashboard under Developers → Webhooks: under Test webhook with an sk_test_ key, under Live webhook with an sk_live_ key. Copy that address’s whsec_ signing secret back into the plugin.
  5. Tick Enable, save, and place a test order with 237670000000.

Your customer chooses “MTN MoMo / Orange Money” at checkout, pays on the WunaPay page and returns to your shop. The plugin confirms the payment with WunaPay’s API (on return and by webhook) and updates the order. Full guide: How to add Mobile Money to WooCommerce.

Since version 1.2.0What it means for you
Refunds from WordPress (1.3.0)Orders → Refund → “Refund via WunaPay” sends the money back to the number that paid, safely retried. A refund that fails later is added as an order note.
Test orders on holdWith an sk_test_ key, payments are simulated: orders are put On hold with the note “TEST payment – no money received”, and a red TEST MODE notice shows at checkout and in the settings. Only tick “Test mode (orders from test payments are marked paid)” on a private test shop.
No double sessionsCheckout sessions are created with an Idempotency-Key (order + amount), with one automatic retry on a network error. “Place order” again reuses the open session.
Test and live kept apartWebhook events must be in the same mode as your key: a live shop ignores test events, and a live key never accepts a test payment for an order.

PrestaShop, WHMCS and Odoo

New in 0.9.16: WunaPay also works with PrestaShop 8, WHMCS 8 and Odoo 17. Your customer chooses MTN MoMo / Orange Money, pays on the secure WunaPay page by confirming on their phone, and comes back to you. The order or invoice is confirmed automatically, and you can refund from your shop admin: the money goes back to the number that paid.

WunaPay for PrestaShop 1.0.0

PrestaShop 8. Shop currency must be FCFA (XAF). README with the install steps included.

Download module
WunaPay for WHMCS 1.0.0

WHMCS 8. README with the install steps included.

Download module
WunaPay for Odoo 1.0.0

Odoo 17 (payment provider). README with the install steps included.

Download module
  • PrestaShop: Modules → Upload a module, choose wunapay-prestashop.zip, then Configure: paste your secret key, copy the webhook URL into WunaPay → Developers → Webhooks, and paste the signing secret back.
  • WHMCS: unzip wunapay-whmcs.zip, upload the modules folder into your WHMCS folder, then Payment Gateways → WunaPay: paste the key, the webhook address and the secret.
  • Odoo: copy payment_wunapay into your addons folder, activate the module, then Payment Providers → WunaPay: paste the key, the webhook address and the secret.

With an sk_test_ key nothing is real: a red TEST MODE notice shows, and test orders are never marked as real sales (“do not ship”). These three modules are new: if something doesn’t work on your shop, write to support@wunapay.com.

Libraries 0.5.0

What changed in each version: SDK and plugin changelog.

  • Safe retries, automatically. Every POST gets an Idempotency-Key (a new one per call, or yours). On a network error, a 5xx or 409 idempotency_in_progress, the library tries again (2 times by default, after a short wait) with the same key, so a retry never charges or pays twice.
  • New methods: payments list, refunds, payouts list with before cursor, escrow retrieve / deliver / cancel / confirm, events list and catch-up.
  • Webhooks: constant-time signature check, and requireLive to refuse test events.
  • Errors carry code (e.g. insufficient_balance), the HTTP status and the full answer. After all retries a network failure gives network_error with the key used, so you can retry later and get the first result.

Node.js library

wunapay.js 0.5.0

One file, no dependencies. Node.js 18 or newer. README included.

Download
const WunaPay = require("./wunapay");                 // the file from wunapay-node.zip (0.4.0)
const wunapay = new WunaPay(process.env.WUNAPAY_SECRET_KEY);   // sk_test_… (or sk_live_… once you are live)

const payment = await wunapay.payments.create({
  amount: 25000, method: "mtn_momo", phone: "+2376XXXXXXXX", reference: "order_1042",
});                                                     // Idempotency-Key added for you
const session = await wunapay.checkout.sessions.create({
  amount: 15000, reference: "order_1043", return_url: "https://yourshop.cm/thanks",
}, { idempotencyKey: "order_1043_checkout" });          // or your own key
const payout  = await wunapay.payouts.create({
  amount: 50000, method: "orange_money", phone: "+2376XXXXXXXX", reference: "supplier_17",
});
const balance = await wunapay.balance.retrieve();

// New in 0.3.0
await wunapay.payments.list({ status: "succeeded", limit: 50 });
const refund = await wunapay.refunds.create({ payment: payment.id, amount: 5000, reason: "Out of stock" });
const page = await wunapay.payouts.list({ kind: "payout", status: "failed" });   // page.has_more → { before: lastId }
await wunapay.escrows.deliver("esc_…", { note: "Delivered" });
await wunapay.escrows.cancel("esc_…", { reason: "Order cancelled" });
const missed = await wunapay.events.catchUp(lastEventId);                      // oldest first

// Webhooks: throws if the signature is wrong; requireLive refuses test events on your real shop
const event = WunaPay.verifyWebhook(rawBody, req.get("WunaPay-Signature"), process.env.WUNAPAY_WEBHOOK_SECRET, { requireLive: true });

try {
  await wunapay.payouts.create({ amount: 999999, method: "mtn_momo", phone: "+2376XXXXXXXX" });
} catch (e) {
  console.log(e.code, e.status);                       // "insufficient_balance" 400
}

Options: new WunaPay(key, { timeoutMs: 30000, maxRetries: 2 }).

PHP library

WunaPay.php 0.5.0

One file, no dependencies (curl extension). PHP 7.4 or newer. README included.

Download
<?php
require 'WunaPay.php';                                  // the file from wunapay-php.zip (0.4.0)
$wunapay = new WunaPay\Client(getenv('WUNAPAY_SECRET_KEY'));

$payment = $wunapay->createPayment(['amount' => 25000, 'method' => 'mtn_momo',
                                    'phone' => '+2376XXXXXXXX', 'reference' => 'order_1042']);
$session = $wunapay->createCheckoutSession(['amount' => 15000, 'return_url' => 'https://yourshop.cm/thanks'],
                                           'order_1043_checkout');   // last argument: your own Idempotency-Key
$payout  = $wunapay->createPayout(['amount' => 50000, 'method' => 'orange_money', 'phone' => '+2376XXXXXXXX']);
$balance = $wunapay->retrieveBalance();

// New in 0.3.0
$wunapay->listPayments(['status' => 'succeeded', 'limit' => 50]);
$refund = $wunapay->createRefund(['payment' => $payment['id'], 'amount' => 5000, 'reason' => 'Out of stock']);
$wunapay->listPayouts(['kind' => 'payout', 'status' => 'failed']);
$wunapay->deliverEscrow('esc_…', 'Delivered');
$wunapay->cancelEscrow('esc_…', 'Order cancelled');
foreach ($wunapay->eventsSince($lastEventId) as $event) { /* oldest first */ }

try {
    $wunapay->createPayout(['amount' => 999999, 'method' => 'mtn_momo', 'phone' => '+2376XXXXXXXX']);
} catch (WunaPay\Error $e) {
    echo $e->errorCode;                                 // "insufficient_balance"
}

// Webhooks (requireLive: refuse test events on your real shop)
$event = WunaPay\Webhook::verify(file_get_contents('php://input'),
                                 $_SERVER['HTTP_WUNAPAY_SIGNATURE'] ?? '', getenv('WUNAPAY_WEBHOOK_SECRET'), ['requireLive' => true]);

Options: new WunaPay\Client($key, 'https://app.wunapay.com', 30, 2) (base URL, timeout in seconds, retries).

Other platforms

PlatformStatus
Any website or app (Laravel, Django, Express, mobile backend…)Available via the REST API or hosted checkout
WooCommerceAvailable (above)
ShopifyPlanned — Shopify only allows approved payment partners
PrestaShop, WHMCS, OdooAvailable (above, new in 0.9.16)

The plugin and libraries are young. If something doesn’t work on your setup, write to support@wunapay.com — we answer in English and French.

WooCommerce

WunaPay pour WooCommerce 1.3.0

WordPress 6.0+, WooCommerce 7.0+, PHP 7.4+. La devise de la boutique doit être le FCFA (XAF).

Télécharger le plugin
  1. Dans WordPress, allez dans Extensions → Ajouter → Téléverser une extension, choisissez wunapay-woocommerce.zip, puis Installer et Activer. Mise à jour ? Téléversez le nouveau zip et choisissez Remplacer la version actuelle : vos réglages sont conservés.
  2. Vérifiez WooCommerce → Réglages → Général : la devise doit être le Franc CFA (BEAC).
  3. Ouvrez WooCommerce → Réglages → Paiements → WunaPay et collez votre clé secrète du tableau de bord WunaPay (Développeurs).
  4. Copiez l’URL de webhook affichée dans les réglages du plugin et collez-la dans le tableau de bord WunaPay sous Développeurs → Webhooks : sous Webhook de test avec une clé sk_test_, sous Webhook réel avec une clé sk_live_. Recopiez le secret de signature whsec_ de cette adresse dans le plugin.
  5. Cochez Activer, enregistrez, et passez une commande test avec 237670000000.

Votre client choisit « MTN MoMo / Orange Money » au moment de payer, paie sur la page WunaPay et revient sur votre boutique. Le plugin confirme le paiement auprès de l’API WunaPay (au retour et par webhook) et met la commande à jour. Guide complet : Ajouter le Mobile Money à WooCommerce.

Depuis la version 1.2.0Ce que cela change pour vous
Remboursements depuis WordPress (1.3.0)Commandes → Rembourser → « Rembourser via WunaPay » renvoie l’argent au numéro qui a payé, avec nouvel essai sans risque. Un remboursement qui échoue plus tard est ajouté en note de commande.
Commandes de test en attenteAvec une clé sk_test_, les paiements sont simulés : les commandes passent En attente avec la note « TEST payment – no money received », et un avis rouge TEST MODE s’affiche au paiement et dans les réglages. Ne cochez « Test mode (orders from test payments are marked paid) » que sur une boutique de test privée.
Pas de double sessionLes sessions sont créées avec une Idempotency-Key (commande + montant), avec un nouvel essai automatique en cas d’erreur réseau. « Commander » à nouveau réutilise la session ouverte.
Test et réel séparésLes événements webhook doivent être dans le même mode que votre clé : une boutique réelle ignore les événements de test, et une clé réelle n’accepte jamais un paiement de test pour une commande.

PrestaShop, WHMCS et Odoo

Nouveau en 0.9.16 : WunaPay fonctionne aussi avec PrestaShop 8, WHMCS 8 et Odoo 17. Votre client choisit MTN MoMo / Orange Money, paie sur la page WunaPay sécurisée en confirmant sur son téléphone, puis revient chez vous. La commande ou la facture est confirmée automatiquement, et vous pouvez rembourser depuis l’administration de votre boutique : l’argent revient sur le numéro qui a payé.

WunaPay pour PrestaShop 1.0.0

PrestaShop 8. La devise de la boutique doit être le FCFA (XAF). README avec les étapes d’installation inclus.

Télécharger le module
WunaPay pour WHMCS 1.0.0

WHMCS 8. README avec les étapes d’installation inclus.

Télécharger le module
WunaPay pour Odoo 1.0.0

Odoo 17 (fournisseur de paiement). README avec les étapes d’installation inclus.

Télécharger le module
  • PrestaShop : Modules → Installer un module, choisissez wunapay-prestashop.zip, puis Configurer : collez votre clé secrète, copiez l’adresse du webhook dans WunaPay → Développeurs → Webhooks, puis collez le secret de signature.
  • WHMCS : décompressez wunapay-whmcs.zip, envoyez le dossier modules dans votre dossier WHMCS, puis Passerelles de paiement → WunaPay : collez la clé, l’adresse du webhook et le secret.
  • Odoo : copiez payment_wunapay dans votre dossier addons, activez le module, puis Fournisseurs de paiement → WunaPay : collez la clé, l’adresse du webhook et le secret.

Avec une clé sk_test_, rien n’est réel : un avertissement rouge MODE TEST s’affiche et les commandes de test ne sont jamais comptées comme de vraies ventes (« ne pas expédier »). Ces trois modules sont nouveaux : si quelque chose ne fonctionne pas chez vous, écrivez à support@wunapay.com.

Bibliothèques 0.5.0

Ce qui a changé à chaque version : historique des SDK et du plugin.

  • Nouveaux essais sûrs, automatiquement. Chaque POST reçoit une Idempotency-Key (une nouvelle par appel, ou la vôtre). En cas d’erreur réseau, de 5xx ou de 409 idempotency_in_progress, la bibliothèque réessaie (2 fois par défaut, après une courte attente) avec la même clé : un nouvel essai ne débite ni ne paie jamais deux fois.
  • Nouvelles méthodes : liste des paiements, remboursements, liste des transferts avec curseur before, séquestre (lire / livrer / annuler / confirmer), liste et rattrapage des événements.
  • Webhooks : vérification de la signature à temps constant, et requireLive pour refuser les événements de test.
  • Les erreurs portent code (ex. insufficient_balance), le statut HTTP et la réponse complète. Après tous les essais, une panne réseau donne network_error avec la clé utilisée : réessayez plus tard et vous obtenez le premier résultat.

Bibliothèque Node.js

wunapay.js 0.5.0

Un seul fichier, sans dépendance. Node.js 18 ou plus récent. README inclus.

Télécharger
const WunaPay = require("./wunapay");                 // the file from wunapay-node.zip (0.4.0)
const wunapay = new WunaPay(process.env.WUNAPAY_SECRET_KEY);   // sk_test_… (or sk_live_… once you are live)

const payment = await wunapay.payments.create({
  amount: 25000, method: "mtn_momo", phone: "+2376XXXXXXXX", reference: "order_1042",
});                                                     // Idempotency-Key added for you
const session = await wunapay.checkout.sessions.create({
  amount: 15000, reference: "order_1043", return_url: "https://yourshop.cm/thanks",
}, { idempotencyKey: "order_1043_checkout" });          // or your own key
const payout  = await wunapay.payouts.create({
  amount: 50000, method: "orange_money", phone: "+2376XXXXXXXX", reference: "supplier_17",
});
const balance = await wunapay.balance.retrieve();

// New in 0.3.0
await wunapay.payments.list({ status: "succeeded", limit: 50 });
const refund = await wunapay.refunds.create({ payment: payment.id, amount: 5000, reason: "Out of stock" });
const page = await wunapay.payouts.list({ kind: "payout", status: "failed" });   // page.has_more → { before: lastId }
await wunapay.escrows.deliver("esc_…", { note: "Delivered" });
await wunapay.escrows.cancel("esc_…", { reason: "Order cancelled" });
const missed = await wunapay.events.catchUp(lastEventId);                      // oldest first

// Webhooks: throws if the signature is wrong; requireLive refuses test events on your real shop
const event = WunaPay.verifyWebhook(rawBody, req.get("WunaPay-Signature"), process.env.WUNAPAY_WEBHOOK_SECRET, { requireLive: true });

try {
  await wunapay.payouts.create({ amount: 999999, method: "mtn_momo", phone: "+2376XXXXXXXX" });
} catch (e) {
  console.log(e.code, e.status);                       // "insufficient_balance" 400
}

Options : new WunaPay(key, { timeoutMs: 30000, maxRetries: 2 }).

Bibliothèque PHP

WunaPay.php 0.5.0

Un seul fichier, sans dépendance (extension curl). PHP 7.4 ou plus récent. README inclus.

Télécharger
<?php
require 'WunaPay.php';                                  // the file from wunapay-php.zip (0.4.0)
$wunapay = new WunaPay\Client(getenv('WUNAPAY_SECRET_KEY'));

$payment = $wunapay->createPayment(['amount' => 25000, 'method' => 'mtn_momo',
                                    'phone' => '+2376XXXXXXXX', 'reference' => 'order_1042']);
$session = $wunapay->createCheckoutSession(['amount' => 15000, 'return_url' => 'https://yourshop.cm/thanks'],
                                           'order_1043_checkout');   // last argument: your own Idempotency-Key
$payout  = $wunapay->createPayout(['amount' => 50000, 'method' => 'orange_money', 'phone' => '+2376XXXXXXXX']);
$balance = $wunapay->retrieveBalance();

// New in 0.3.0
$wunapay->listPayments(['status' => 'succeeded', 'limit' => 50]);
$refund = $wunapay->createRefund(['payment' => $payment['id'], 'amount' => 5000, 'reason' => 'Out of stock']);
$wunapay->listPayouts(['kind' => 'payout', 'status' => 'failed']);
$wunapay->deliverEscrow('esc_…', 'Delivered');
$wunapay->cancelEscrow('esc_…', 'Order cancelled');
foreach ($wunapay->eventsSince($lastEventId) as $event) { /* oldest first */ }

try {
    $wunapay->createPayout(['amount' => 999999, 'method' => 'mtn_momo', 'phone' => '+2376XXXXXXXX']);
} catch (WunaPay\Error $e) {
    echo $e->errorCode;                                 // "insufficient_balance"
}

// Webhooks (requireLive: refuse test events on your real shop)
$event = WunaPay\Webhook::verify(file_get_contents('php://input'),
                                 $_SERVER['HTTP_WUNAPAY_SIGNATURE'] ?? '', getenv('WUNAPAY_WEBHOOK_SECRET'), ['requireLive' => true]);

Options : new WunaPay\Client($key, 'https://app.wunapay.com', 30, 2) (URL de base, délai en secondes, nouveaux essais).

Autres plateformes

PlateformeStatut
Tout site ou application (Laravel, Django, Express, backend mobile…)Disponible via l’API REST ou le paiement hébergé
WooCommerceDisponible (ci-dessus)
ShopifyPrévu — Shopify n’accepte que des partenaires de paiement agréés
PrestaShop, WHMCS, OdooDisponible (ci-dessus, nouveau en 0.9.16)

Le plugin et les bibliothèques sont jeunes. Si quelque chose ne fonctionne pas chez vous, écrivez à support@wunapay.com — nous répondons en français et en anglais.