waarie / waarie-php
Official PHP SDK for Waarie Payment Gateway (Mobile Money MTN, Wave, Orange, Moov & Cards in UEMOA/CEMAC)
v1.0.0
2026-09-13 11:06 UTC
Requires
- php: >=8.0
- ext-curl: *
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ^9.5 || ^10.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Official PHP client library for Waarie — The Pan-African Unified Mobile Money & Card Payment Infrastructure (UEMOA / CEMAC).
Accept Wave, MTN MoMo, Orange Money, Moov Africa, and Credit Cards across Côte d'Ivoire, Senegal, Benin, Togo, Mali, Burkina Faso, and Niger with minimal code.
📦 Installation
Via Composer:
composer require waarie/waarie-php
Or download the zip package directly from your Waarie Merchant Console under Paramètres > Clés API & SDKs.
🚀 Quickstart
1. Initialize Client
use Waarie\WaarieClient; $waarie = new WaarieClient('sk_live_948f...', [ 'sandbox' => false // Set true for sandbox testing ]);
2. Initiate Payment Checkout
$payment = $waarie->payments->create([ 'amount' => 5000, 'currency' => 'XOF', 'merchant_reference' => 'CMD-'.time(), 'operator' => 'wave', // 'wave', 'mtn', 'orange', 'moov', or 'cards' 'customer_phone' => '+22177000000', 'customer_name' => 'Fatou Faye', 'customer_email' => 'client@example.com', 'return_url' => 'https://votreboutique.com/orders/success', 'cancel_url' => 'https://votreboutique.com/orders/cancel', 'metadata' => [ 'order_id' => 1024, 'cart_summary' => 'Panier Bio Dakar' ] ]); // Redirect customer to hosted checkout or USSD payment session header('Location: ' . $payment['payment']['checkout_url']); exit;
3. Verify Webhook Signature
use Waarie\Webhook; $payloadRaw = file_get_contents('php://input'); $signature = $_SERVER['HTTP_X_WAARIE_SIGNATURE'] ?? ''; $webhookSecret = 'whsec_...'; if (! Webhook::verifyHeader($payloadRaw, $signature, $webhookSecret)) { http_response_code(401); echo json_encode(['error' => 'Invalid signature']); exit; } $event = json_decode($payloadRaw, true); if ($event['event'] === 'payment.successful') { $paymentData = $event['data']['payment']; // Deliver order / activate customer subscription } http_response_code(200); echo json_encode(['received' => true]);
🛡️ License
MIT License — Waarie Technologies Inc.