tarsoft/toyyibpay
最新稳定版本:v0.3.0
Composer 安装命令:
composer require tarsoft/toyyibpay
包简介
Laravel Package for ToyyibPay API
README 文档
README
For complete API usage, some endpoints need User Secret Key. For staging/testing purposes, please register an account at ToyyibPay Staging Portal. Here you can create dummy bills and make test payments via Bank Simulators.
Notification! We will not accept responsibility for loss of money due to improper use of the toyyibPay API and this package.
Installation
To install the package within your laravel project use the following composer command:
composer require tarsoft/toyyibpay
Publish ToyyibPay Config File
php artisan vendor:publish --provider="Tarsoft\Toyyibpay\ToyyibpayServiceProvider"
Environment Credential Setup
TOYYIBPAY_USER_SECRET_KEY=ADD-TOYYIBPAY_USER_SECRET_KEY
TOYYIBPAY_REDIRECT_URI=ADD-TOYYIBPAY_REDIRECT_URI
TOYYIBPAY_SANDBOX=ADD-TOYYIBPAY_SANDBOX-MODE
Usage
Use Toyyibpay Facade
use Toyyibpay; class MyController extends Controller { // Controller functions here... }
Get Bank
Toyyibpay::getBanks();
Get Bank FPX
Toyyibpay::getBanksFPX();
Get Package
Toyyibpay::getPackages();
Create Category
Toyyibpay::createCategory($name, $description);
Get Category
Toyyibpay::getCategory($category_code);
Create Bill
Toyyibpay::createBill($category_code, [ 'billName' => $request->bill_name, 'billDescription' => $request->bill_description, ... ]);
Let's say you have an array of data that you want to convert into an object before passing it to Toyyibpay::createBill($category_code, $array). You can use the stdClass class, which is a built-in class in PHP for creating objects on-the-fly. Here's how you can do it:
Toyyibpay::createBill($category_code, (object)$array)
Get Bill Payment Link
Toyyibpay::billPaymentLink($bill_code);
Opening an Issue
Before opening an issue there are a couple of considerations:
- You are all cute and geek!
- Check that the issue is not specific to your development environment setup.
- Provide duplication steps.
- Need a coach or assistance, I can do my best on Telegram: https://t.me/tarmizisanusi
- Please be considerate that this is an open source project that I provide to the community for FREE.
License
Laravel Toyyibpay(the package) is licensed under the MIT license. Enjoy!
统计信息
- 总下载量: 6.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 36
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-02-21