PHPackages                             cmiecom/cmi-pay-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. cmiecom/cmi-pay-bundle

ActiveSymfony-bundle[Payment Processing](/categories/payments)

cmiecom/cmi-pay-bundle
======================

CMI gateway payment library

v1.0(7y ago)23975MITPHPPHP ^7.1.3

Since Apr 10Pushed 7y agoCompare

[ Source](https://github.com/CmiEcom/CmiPayBundle)[ Packagist](https://packagist.org/packages/cmiecom/cmi-pay-bundle)[ RSS](/packages/cmiecom-cmi-pay-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

CMI payment Bundle
==================

[](#cmi-payment-bundle)

Straight forward integration of [CMI](http://www.cmi.co.ma/) payment module into Symfony applications.

- How CMI payment process works?\*

    A client fills the form on your side and then submits the form. Then the client will be redirected to CMI payment page to complete the payment. Once the payment has been completed the client has the option to return back to your website and at the same time a callback is send from Cmi to your callback url.

Setup
=====

[](#setup)

This bundle allows you to add cmi payment process with minimum changes to your code. These instructions will also guide you through the installation of that bundle.

Installation
------------

[](#installation)

Install with composer:

```
composer require cmiecom/cmi-pay-bundle

```

Include `routes.xml` in your routing file :

```
// config/routes.yaml

_cmi_pay:
    resource: '@CmiPayBundle/Resources/config/routes.xml'
```

Usage
=====

[](#usage)

Rendering the form and redirect client to CMI page payment
----------------------------------------------------------

[](#rendering-the-form-and-redirect-client-to-cmi-page-payment)

The default route configured in:

```
// src/Resources/config/routes.xml

```

And a controller action to render the form:

```
namespace CmiPayBundle\Controller;

......

class CmiPayController extends AbstractController
{
    public function requestPay(Request $request)
    {
        $params = new CmiPay();
        // Setup new payment parameters
        $okUrl = $this->generateUrl('cmi_pay_okFail', [], UrlGeneratorInterface::ABSOLUTE_URL);
        $shopUrl = $baseurl = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath();
        $failUrl = $this->generateUrl('cmi_pay_okFail', [], UrlGeneratorInterface::ABSOLUTE_URL);
        $callbackUrl = $this->generateUrl('cmi_pay_callback', [], UrlGeneratorInterface::ABSOLUTE_URL);
        $rnd = microtime();
	//Sample Order Data:
        $params->setGatewayurl('https://....')// Provided by CMI
            ->setclientid('600000000')// Provided by CMI
            ->setTel('05000000')
            ->setEmail('email@domaine.ma')
            ->setBillToName('BillToName')
            ->setBillToCompany('BillToCompany')
            ->setBillToStreet1('BillToStreet1')
            ->setBillToStateProv('BillToStateProv')
            ->setBillToPostalCode('BillToPostalCode')
	//.................
        ;
	//.................
    }
}
```

The twig template:

```
// src/Resources/views/payrequest.html.twig
{% extends 'base.html.twig' %}

{% block title %}Hello {% endblock %}

{% block body %}

        {% for name, value in data %}

        {% endfor %}

{% endblock %}
............
```

Callback
--------

[](#callback)

The default route configured in:

```
// src/Resources/config/routes.xml

```

And a controller action : Callback:

```
namespace CmiPayBundle\Controller;

......

class CmiPayController extends AbstractController
{
..........
    public function callback(Request $request)
    {
        .......
    }
}
```

The twig template:

```
// src/Resources/views/callback.html.twig
{{response}}
```

OK / FAIL URL
-------------

[](#ok--fail-url)

The default route configured in:

```
// src/Resources/config/routes.xml

```

And a controller action : okFail:

```
namespace CmiPayBundle\Controller;

......

class CmiPayController extends AbstractController
{
..........
    public function okFail(Request $request)
    {
        ........
    }
}
```

The twig template:

```
// src/Resources/views/okFail.html.twig
{{response}}
```

Calculate Hash value
--------------------

[](#calculate-hash-value)

Controller action : hashValue:

```
namespace CmiPayBundle\Controller;

......

class CmiPayController extends AbstractController
{
..........
   public function hashValue($data)
    {
        $params = new CmiPay();
        $params->setSecretKey('TEST1234');//Secret key generated from CMI Backoffice
        ..........
        return $hash;
    }
}
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2637d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0136283a8d24beb826d525b6763472e51ea45e334abf71c66133f3b8a7601225?d=identicon)[iaziz@cmi.co.ma](/maintainers/iaziz@cmi.co.ma)

---

Top Contributors

[![CmiEcom](https://avatars.githubusercontent.com/u/48797471?v=4)](https://github.com/CmiEcom "CmiEcom (37 commits)")

### Embed Badge

![Health badge](/badges/cmiecom-cmi-pay-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/cmiecom-cmi-pay-bundle/health.svg)](https://phpackages.com/packages/cmiecom-cmi-pay-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k50.1M314](/packages/api-platform-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M524](/packages/shopware-core)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M464](/packages/pimcore-pimcore)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
