camoo/camoo-pay

CamooPay 移动货币聚合插件

安装: 164

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

公开问题: 0

类型:camoo-plugin

1.0.0 2023-05-12 16:39 UTC

This package is auto-updated.

Last update: 2024-09-12 19:30:42 UTC


README

安装

您可以使用 composer 将此插件安装到您的 PHP 应用程序中。

安装 composer 包的推荐方法是

composer require camoo/camoo-pay

用法

use CamooPay\Exception\CamooPayCashoutException;
use CamooPay\Lib\CashOut;

$cashOut = new CashOut('token', 'secret', 'orange');
$phoneNumber = '690000000';
$amount = 850;
$customerEmail = 'end-customer@email.cm';
        try {
            $payment $cashOut->charge($phoneNumber, $amount, $customerEmail);

        } catch (CamooPayCashoutException $exception) {
            $message = $exception->getMessage();
            echo $message
        }
        
        var_dump($payment);

// Now verify the status
$transactionNumber = $payment['ptn'];
$checkPayment = new \CamooPay\Lib\CheckPayment('token', 'secret');
$verify = $checkPayment->check($transactionNumber);
var_dump($verify);