selyakovadim / paykassa
用于Paykassa SCI & API的包
1.0.2
2021-07-07 08:25 UTC
Requires
This package is not auto-updated.
Last update: 2024-09-26 00:14:38 UTC
README
安装
composer require selyakovadim/paykassa
初始化
从 https://paykassa.pro 获取您的Marchant和API凭证
PHP
$api = new Paykassa\PaykassaApi($api_id, $api_key); $sci = new Paykassa\PaykassaSci($sci_id, $sci_key);
Laravel
.env
PAYKASSA_SCI_ID=
PAYKASSA_SCI_KEY=
PAYKASSA_API_ID=
PAYKASSA_API_KEY=
$api = new Paykassa\PaykassaApi(); $sci = new Paykassa\PaykassaSci();
用法
获取余额(API)
$balance = $api->getBalance($shop_id)
发起支付(API)
$response = $api->makePayment([ 'shop' => 999, 'system' => 1, 'number' => 'P123456', 'amount' => 100, 'currency' => 'USD', 'comment' => 'Payment #654', ]);
获取加密货币地址(SCI)
$address = $sci->getAddress([ 'system' => 11, 'currency' => 'BTC', 'order_id' => 100500, 'comment' => 'Invoice #100500', 'amount' => 100 ]);
获取发票(SCI)
$invoice = $sci->getInvoice([ 'system' => 1, 'currency' => 'USD', 'order_id' => 100500, 'comment' => 'Invoice #100500', 'amount' => 100 ]);
检查支付(SCI)
$response = $sci->checkPayment($payment_hash);