baffouradu/mazzuma

Mazzuma支付网关的库

0.0.6 2018-08-11 20:02 UTC

This package is auto-updated.

Last update: 2024-09-29 05:27:53 UTC


README

Latest Version on Packagist Software License Build Status Code Coverage Scrutinizer Code Quality Total Downloads

这是一个用于消耗Mazzuma支付API以在PHP应用程序中发送或接收移动货币的库。

安装

通过Composer

$ composer require baffouradu/mazzuma

用法

require "vendor/autoload.php";

use \BaffourAdu\Mazzuma\MazzumaPayment;

//Replace this with API key as obtained from https://dashboard.mazzuma.com/
$APIKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx";

$payment = new MazzumaPayment($APIKey);

try {
    $response = $payment->transfer('MTN_TO_MTN')
                ->amount(1) 
                ->from('05xxxxxx')
                ->to('02xxxxxx')
                ->send();

    if ($payment->isSuccessful()) {
        /* $response holds the original
        structure of Mazzuma's API Response */
        echo json_encode($response);
    } else {
        /* $response holds the original
        structure of Mazzuma's API Response */
        echo json_encode($response);
    }  
} catch (Exception $e) {
    echo 'Message: ' .$e->getMessage();
}

变更日志

有关最近更改的更多信息,请参阅变更日志

测试

$ composer test

贡献

有关详细信息,请参阅贡献指南行为准则

安全

如果您发现任何安全相关的问题,请通过电子邮件baffouraduboampong@gmail.com联系,而不是使用问题跟踪器。

致谢

许可证

MIT许可证(MIT)。有关更多信息,请参阅许可证文件