itsfaqih/faspay
最新稳定版本:0.5.0
Composer 安装命令:
composer require itsfaqih/faspay
包简介
Unofficial Faspay SDK
关键字:
README 文档
README
Installation
You can install the package via composer:
composer require itsfaqih/faspay
Usage
Configure the credentials and the client.
use ItsFaqih\Faspay\Client; use ItsFaqih\Faspay\Entities\User; use ItsFaqih\Faspay\Enums\Environment; $user = new User('bot98765', 'p@ssw0rd', '98765', 'FASPAY'); $faspayClient = new Client($user, Environment::DEVELOPMENT());
Payment Channel Inquiry
$faspayClient->paymentChannelInquiry();
Post Data Transaction
use ItsFaqih\Faspay\Entities\Bill; use ItsFaqih\Faspay\Entities\BillItem; use ItsFaqih\Faspay\Entities\Customer; use ItsFaqih\Faspay\Entities\Payment; use ItsFaqih\Faspay\Enums\PaymentChannel; use ItsFaqih\Faspay\Enums\PaymentType; $bill = new Bill('TRX-123', new \DateTime(), (new \DateTime())->modify('+1 day'), 'Red Shoes with special price', '250000'); $payment = new Payment(PaymentChannel::LINKAJA(), PaymentType::FULL_SETTLEMENT()); $customer = new Customer('001', 'John Smith', '08123456789', 'john.smith@example.com'); $item = new BillItem('Red Shoes', 1, '250000'); $faspayClient->postDataTransaction($bill, $payment, $customer, [$item]);
Inquiry Payment Status
$trxId = '9876530200004184'; $billNo = 'TRX-123'; $faspayClient->inquiryPaymentStatus($trxId, $billNo);
Cancel Transaction
$trxId = '9876530200004184'; $billNo = 'TRX-123'; $reason = 'Wrong order'; $faspayClient->cancelTransaction($trxId, $billNo, $reason);
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 44
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-02