ibnuhalimm/laravel-midtrans
Composer 安装命令:
composer require ibnuhalimm/laravel-midtrans
包简介
Laravel wrapper for Midtrans payment gateway
README 文档
README
Laravel wrapper for Midtrans payment gateway.
Contents
Requirements
- Sign Up for the Midtrans Account
Installation
You can install the package via composer:
composer require ibnuhalimm/laravel-midtrans
Optionally, you can publish the config file of this package with this command:
php artisan vendor:publish --tag="laravel-midtrans-config"
Setting up
Put some environment variable to .env file:
MIDTRANS_SERVER_KEY= MIDTRANS_CLIENT_KEY= MIDTRANS_MODE=
Usage
You can directly use the Midtrans Facade (the alias or class itself):
- Payment
Get Snap Token
use Ibnuhalimm\LaravelMidtrans\Facades\Midtrans; $transactionData = [ 'transaction_details' => [ 'order_id' => 'INV-0012', 'gross_amount' => 20000, ] ]; Midtrans::getSnapToken($transactionData);
- After Payment
Check Transaction Status
use Ibnuhalimm\LaravelMidtrans\Facades\Midtrans; $id = '9b5192c4-4da4-3b6d-945b-4bf5f853cb56'; Midtrans::transaction($id)->getDetails();
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email ibnuhalim@pm.me instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-11