mirmuxsin / laravel-midtrans
Laravel Midtrans - Midtrans 包的包装器
1.0.1
2022-10-18 09:37 UTC
Requires
- php: ^7.1|^8.0
- guzzlehttp/guzzle: ^7.4
- sawirricardo/midtrans-api: ^1.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^5.10
- nunomaduro/larastan: ^1.0
- orchestra/testbench: ^6.22
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
README
需要在您的 Laravel 应用中使用 Midtrans?请使用此包。
支持我们
我们投入了大量资源创建最优秀的开源包。您可以通过捐赠来支持:
- Paypal
- 钱包 0x3F20d326E5DA8ab6D27d9b2DdD350baB1e589d87
- BCA 8330123584
如果您愿意,可以在 Twitter 上与我联系
安装
您可以通过 composer 安装此包
composer require sawirricardo/laravel-midtrans
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="laravel-midtrans-config"
这是发布配置文件的内容
return [ 'server_key' => env('MIDTRANS_SERVER_KEY'), 'client_key' => env('MIDTRANS_CLIENT_KEY'), 'sandbox_server_key' => env('MIDTRANS_SB_SERVER_KEY'), 'sandbox_client_key' => env('MIDTRANS_SB_CLIENT_KEY'), 'is_production' => env('MIDTRANS_IS_PRODUCTION', false), 'is_sanitized' => true, 'is_3ds' => true, 'append_notif_url' => null, 'overrideNotifUrl' => null, 'payment_idempotency_key' => null, 'curl_options' => null, ];
使用方法
use Sawirricardo\Midtrans\Laravel\Facades\Midtrans; $transactionToken = Midtrans::client()->snap()->create(new TransactionDto()); echo $transactionToken->token; echo $transactionToken->redirect_url; //checkout.blade.php // if you use Snap, you can include Midtrans snap script @midtransSnapScript // if you use Core API, you will most likely need to include this. @midtransCardScript
有关如何使用 Midtrans 的更多信息,请参阅 Midtrans 文档
测试
composer test
变更日志
有关最近更改的更多信息,请参阅 CHANGELOG
贡献
有关详细信息,请参阅 CONTRIBUTING
安全漏洞
请查看 我们的安全策略,了解如何报告安全漏洞。
鸣谢
许可
MIT 许可证 (MIT)。有关更多信息,请参阅 许可文件