mehdirochdi/cmi-payment-php
Composer 安装命令:
composer require mehdirochdi/cmi-payment-php
包简介
PHP package to communicate with the CMI payment plateform in Morocco
关键字:
README 文档
README
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 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
cmi-php requires the following components to work correctly
Composer Installation
You can install the bindings via composer. Run the following command:
composer require mehdirochdi/cmi-payment-php
To use the bindings, use Composer's autoload
require_once('vendor/autoload.php');
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
Example amount text fields example/formRequest.php:
... <h1>Payment form CMI</h1> <form method="post" action="/example/process.php"> <label for="amount">Amount</label> <input type="text" name="amount" class="input-control" placeholder="put amount here 10.65" value="10.60"> DHS<br/> <button type="submit">Buy</button> </form> ...
Keeping mind that storekey and clientid are given by CMI, you should contact them cmi.co.ma
<?php // REQUIRED PARAMS $client = new Mehdirochdi\CMI\CmiClient([ 'storekey' => '', // STOREKEY 'clientid' => '', // CLIENTID 'oid' => '135ABC', // COMMAND ID IT MUST BE UNIQUE 'shopurl' => 'YOUR_DOMAIN_HERE', // SHOP URL FOR REDIRECTION 'okUrl' => 'YOUR_DOMAIN_HERE/okFail.php', // REDIRECTION AFTER SUCCEFFUL PAYMENT 'failUrl' => 'YOUR_DOMAIN_HERE/okFail.php', // REDIRECTION AFTER FAILED PAYMENT 'email' => 'mehdi.rochdi@gmail.com', // YOUR EMAIL APPEAR IN CMI PLATEFORM 'BillToName' => 'mehdi rochdi', // YOUR NAME APPEAR IN CMI PLATEFORM 'BillToCompany' => 'company name', // YOUR COMPANY NAME APPEAR IN CMI PLATEFORM 'amount' => $_POST['amount'], // RETRIEVE AMOUNT WITH METHOD POST 'CallbackURL' => 'YOUR_DOMAIN_HERE/callback.php', // CALLBACK ]); $client->redirect_post(); // CREATE INPUTS HIDDEN, GENERATE A VALID HASH AND MAKE REDIRECT POST TO CMI ?>
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
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
Optional Params Example
<?php // REQUIRED PARAMS $client = new Mehdirochdi\CMI\CmiClient([ ... 'AutoRedirect' => 'true', ]); OR $client->AutoRedirect = 'true'; // REDIRECT THE CUSTOMER AUTOMATICALY BACK TO THE MERCHANT's WEB SITE WHEN TRANSACION IS ACCEPTED $client->redirect_post(); // CREATE INPUTS HIDDEN, GENERATE A VALID HASH AND MAKE REDIRECT POST TO CMI
mehdirochdi/cmi-payment-php 适用场景与选型建议
mehdirochdi/cmi-payment-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.84k 次下载、GitHub Stars 达 85, 最近一次更新时间为 2021 年 06 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment processing」 「cmi」 「morocco payment」 「cmi payment」 「payment in morocco」 「paiement en ligne cmi」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mehdirochdi/cmi-payment-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mehdirochdi/cmi-payment-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mehdirochdi/cmi-payment-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
paywant api php client
Convert and operate with FIPS codes for states, counties, etc.
Image processing for PHP 5.3
Sylius plugin to integrate CMI as payment method to sylius shop.
PHP client for the PAYMENNT api
This repository contains Saaspose.SDK for PHP source code. This SDK allows you to work with Saaspose REST API in your PHP applications quickly and easily.
统计信息
- 总下载量: 3.84k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 85
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-06-17