stephencoduor / omnipay-mtn
为 Omnipay V2.0 支付处理库提供的 MTN CAM 移动货币网关驱动程序
v2.0.0
2021-01-03 07:47 UTC
Requires
- omnipay/common: ~2.0
Requires (Dev)
- omnipay/tests: ~2.0
This package is auto-updated.
Last update: 2024-09-09 02:01:23 UTC
README
为 Omnipay PHP 支付处理库提供的 MTN 移动货币驱动程序
Omnipay 是一个不依赖于框架的多网关支付处理库,适用于 PHP 5.3+。本软件包实现了 Omnipay 的 MTN 移动货币支持。
注意
此版本目前不稳定,但将在修复后很快在稳定分支上发布。如果您急需使用此软件包,请联系作者。
安装
Omnipay 通过 Composer 安装。要安装,请转到项目根目录并简单地运行
$ composer require stephencoduor/omnipay-mtn
然后运行 composer update
来获取它
基本用法
本软件包提供以下方法:
- 购买
use Omnipay\Omnipay;
$gateway = Omnipay::create('Momoc');
$config = [
'providerCallbackHost' =>'http://mycallback',
'amount' => 100.00, //amount the client should pay
'api_user' => '', //your provided profile apiuser
'api_key' => '', //your provided profile api key
'subscription_key' => '', //your provided subscription key
];
$gateway->authorize($config);
$response = $gateway->purchase($config)->send();
$transactionInfo = $response->getMessage();
//an array containing transaction data
if($response->isSuccessful()){
//save transaction to database and notify the user
}else{
//get error from the message and notify the user
//
}
支持
如果您在使用 Omnipay 时遇到一般问题,我们建议您在 Stack Overflow 上发布。请确保添加 omnipay 标签,以便更容易找到。
如果您想了解发布公告,讨论项目想法或提出更详细的问题,还有一个您可以订阅的 邮件列表。
如果您认为您已发现一个错误,请使用 GitHub 问题跟踪器 报告它,或者更好的是,分支库并提交一个 pull request。 "# omnipay-mtn-v2.0"