PHPackages                             mehdirochdi/cmi-payment-php - 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. mehdirochdi/cmi-payment-php

ActiveLibrary[Payment Processing](/categories/payments)

mehdirochdi/cmi-payment-php
===========================

PHP package to communicate with the CMI payment plateform in Morocco

1.0.0(4y ago)833.2k↓50%31[8 issues](https://github.com/mehdirochdi/cmi-payment-php/issues)[1 PRs](https://github.com/mehdirochdi/cmi-payment-php/pulls)MITPHPPHP &gt;=5.6.0

Since Jun 14Pushed 2y ago6 watchersCompare

[ Source](https://github.com/mehdirochdi/cmi-payment-php)[ Packagist](https://packagist.org/packages/mehdirochdi/cmi-payment-php)[ RSS](/packages/mehdirochdi-cmi-payment-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

CMI PHP Payment bindings
========================

[](#cmi-php-payment-bindings)

CMI PHP PAYMENT is an open source **PHP payment handling** library. it provides an easier way to communicate with CMI PAYMENT PLATEFORM **[cmi.co.ma](https://www.cmi.co.ma/fr/solutions-paiement-carte-paiement-ligne/ecommerce)** in morocco.

The class is written OOP to make easier to communicate and understand how CMI work.

NB: The small library follows the FIG standard **PSR-4** .

System Requirements
-------------------

[](#system-requirements)

cmi-php requires the following components to work correctly

- PHP&gt;=8.1
- [cUrl](https://www.php.net/manual/en/book.curl.php) Extension
- [mbstring](https://www.php.net/manual/en/book.mbstring.php) Extension

Composer Installation
---------------------

[](#composer-installation)

You can install the bindings via [composer](https://getcomposer.org/). Run the following command:

```
composer require mehdirochdi/cmi-payment-php
```

To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading)

```
require_once('vendor/autoload.php');
```

Manual Installation
-------------------

[](#manual-installation)

If you do not wish to use Composer for some reason, you can usethe bindings, include the init.php file.

```
require_once('/path/to/cmi-php/init.php');
```

Getting Started
---------------

[](#getting-started)

Example amount text fields `example/formRequest.php`:

```
...
    Payment form CMI

    Amount
         DHS
        Buy

...
```

Keeping mind that `storekey` and `clientid` are given by CMI, you should contact them **[cmi.co.ma](https://www.cmi.co.ma/fr/solutions-paiement-carte-paiement-ligne/ecommerce)**

```

```

[![Payment page](https://camo.githubusercontent.com/15296e7b4f426953aff35b50fad0b5f3805c4f3d1cd7f5bf9b08aa2d2b54e49c/68747470733a2f2f6f736d656e74616c656e742e636f6d2f7061796d656e742d706167652e706e67)](https://camo.githubusercontent.com/15296e7b4f426953aff35b50fad0b5f3805c4f3d1cd7f5bf9b08aa2d2b54e49c/68747470733a2f2f6f736d656e74616c656e742e636f6d2f7061796d656e742d706167652e706e67)

Basic test card numbers
-----------------------

[](#basic-test-card-numbers)

Credit Card information cannot be used in test mode. instead, use any of the following test card numbers, a valid expiration date in the future, and any random CVC number, to create a successful payment.

Branch : `visa`, PAN: `4000000000000010`, Expired date: `make any date` CVC: `000`

Branch : `MasterCard`, PAN: `5453010000066100`, Expired date: `make any date` CVC: `000`

3D Secure test card numbers
---------------------------

[](#3d-secure-test-card-numbers)

The following card information try to tests local payments such as Strong Customer Authentication **SCA**

Branch : `MasterCard`, PAN: `5191630100004896`, Authentication code: `123` Expired date: `make any date` CVC: `000`

[![Payment page](https://camo.githubusercontent.com/13bddf6bd56ecd4c746ab4cc8634396ef1f8aeee46352370c557d81e4d006638/68747470733a2f2f6f736d656e74616c656e742e636f6d2f33647365637572652e706e67)](https://camo.githubusercontent.com/13bddf6bd56ecd4c746ab4cc8634396ef1f8aeee46352370c557d81e4d006638/68747470733a2f2f6f736d656e74616c656e742e636f6d2f33647365637572652e706e67)

Optional Params Example
-----------------------

[](#optional-params-example)

```
