cubepay / cubepay-api-library
CubePay API库,适用于PHP,是一个第三方加密货币支付网关。
0.0.1
2018-09-25 09:54 UTC
Requires
- php: >=5.4
This package is auto-updated.
Last update: 2024-09-04 16:49:00 UTC
README
第三方加密货币支付网关。
让接收加密货币变得简单!
更多信息请访问 https://cubepay.io。
API文档
安装
- Yii所需的最小PHP版本为PHP 5.4。
- 与PHP 7配合使用效果最佳。
$ php composer.phar require cubepay/cubepay-api-library
使用方法
初始化
use CubePay\CubePay;
$cubepay = new CubePay(CLIENT_ID, CLIENT_SECRET, URL);
获取可用的加密货币
您可以在支付API中使用这些货币进行接收/发送硬币。
$response = $cubepay->getCoin();
获取可用的法定货币。
您只能使用这些法定货币作为您产品的原始列表价格。我们将根据列表货币和实际支付货币之间的汇率进行价值转换。
$response = $cubepay->getFiat();
执行支付
渲染包含以下支付信息的页面
- 您的商店信息
- 商品名称
- 可支付硬币列表及对应价格。
$response = $cubepay->doPayment($sourceCoinId, $sourceAmount, $itemName, $merchantTransactionId, $other = null, $returnUrl = null, $ipnUrl = null, $sendCoinId = null, $sendAmount = null, $receiveAddress = null);
使用特定硬币初始化支付
使用特定硬币进行初始支付。支付将在6小时后过期。
$response = $cubepay->doPaymentByCoinId($coinId, $sourceCoinId, $sourceAmount, $itemName, $merchantTransactionId, $other = null, $returnUrl = null, $ipnUrl = null, $sendCoinId = null, $sendAmount = null, $receiveAddress = null);
查询支付信息
通过特定身份查询支付信息
$response = $cubepay->queryPayment($id = null, $merchantTransactionId = null);