kkiapay / kkiapay-php
kkiapay支付网关的PHP SDK
dev-master
2023-05-02 14:35 UTC
Requires
- guzzlehttp/guzzle: ^7.0.1
This package is auto-updated.
Last update: 2024-08-31 00:25:54 UTC
README
原始文件
git clone https://github.com/kkiapay/php-sdk.git
安装
使用composer
composer require kkiapay/kkiapay-php
初始化
生产环境
$kkiapay = new \Kkiapay\Kkiapay($public_key, $private_key, $secret);
沙箱环境
$kkiapay = new \Kkiapay\Kkiapay($public_key, $private_key, $secret, $sandbox = true);
检索交易的请求
示例
$kkiapay->verifyTransaction($transaction_id);
撤销交易的请求
示例
$kkiapay->refundTransaction($transaction_id);
安排付款的请求
示例
// Example to schedule payout when amount reaches a ceiling $kkiapay->setupPayout(array( "algorithm" => "roof", "send_notification" => true, "destination_type" => "MOBILE_MONEY", "roof_amount" => "1000", "destination" => "22997000000" )); // Example to schedule payout by frequency $kkiapay->setupPayout(array( "algorithm" => "rate", "send_notification" => true, "destination_type" => "MOBILE_MONEY", "rate_frequency" => "1m", "destination" => "22997000000" ));