Integrating CMI in WooCommerce for Seamless Online Payments in Morocco
What Is CMI and Why Use It for Moroccan E-Commerce?
CMI (Centre Monétique Interbancaire) is Morocco's national interbank payment network. It processes the vast majority of online card transactions in Morocco, including Visa, Mastercard, and Moroccan bank-issued debit cards. If you run a WooCommerce store targeting Moroccan customers, CMI integration is not optional — it is the primary way your clients will pay online.
CMI Integration Requirements
To integrate CMI with WooCommerce, you will need:
- A Moroccan commercial bank account with an e-commerce merchant agreement
- A valid Moroccan trade registration (RC) and ICE number
- CMI merchant credentials (Merchant ID, store key, client ID) provided by your bank
- A website with a valid SSL certificate (HTTPS mandatory)
- A dedicated IP address or domain approved by CMI
Step-by-Step WooCommerce CMI Integration
1. Install the CMI WooCommerce Plugin
Several CMI plugins are available for WooCommerce. The most reliable are provided directly by partner banks (Attijariwafa, BMCE, CIH) or by certified Moroccan developers. Install via Plugins → Add New or upload the ZIP file directly.
2. Configure Plugin Settings
In WooCommerce → Settings → Payments → CMI, enter your Merchant ID, store key, and the redirect URLs for success and failure. Set the currency to MAD and configure the payment mode (test vs. production).
3. Configure IPN (Instant Payment Notification)
CMI uses a server-to-server callback to confirm payment. Configure the IPN URL in your CMI merchant portal to point to your WooCommerce endpoint. This is critical — without IPN, orders will not be automatically marked as paid.
4. Test in Sandbox Mode
CMI provides a test environment with dummy card numbers. Run at least 10 test transactions covering: successful payment, card declined, session timeout, and 3D Secure challenge. Verify that orders update correctly in WooCommerce.
5. Go Live
Switch the plugin to production mode, update the CMI portal with your production domain and IPN URL, and run one real transaction to confirm end-to-end operation.
Common CMI Integration Issues and Solutions
- IPN not received: Check server firewall rules and ensure CMI IP ranges are whitelisted
- Currency mismatch error: CMI requires amounts in centimes (1 MAD = 100 centimes) — verify your plugin handles the conversion
- SSL certificate not recognized: Ensure you are using a certificate from a CA trusted by CMI (avoid self-signed)
- Order stuck in "Pending" status: IPN URL incorrect or blocked by hosting firewall
Need CMI Integration Help?
Amine Aziz has integrated CMI payment gateways for multiple Moroccan WooCommerce stores. Contact us for professional e-commerce development with CMI payment support.