sepayvn / laravel-sepay
Laravel Package cho SePay - Giải pháp tự động hóa cho thanh toán chuyển khoản ngân hàng
v1.0.0
2023-11-28 10:05 UTC
Requires
- php: ^8.1
- illuminate/contracts: ^10.0
- spatie/laravel-data: ^3.9
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
This package is auto-updated.
Last update: 2024-04-29 10:35:09 UTC
README
Installation
You can install the package via composer:
composer require sepayvn/laravel-sepay
You can publish and run the migrations with:
php artisan vendor:publish --tag="sepay-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="sepay-config"
This is the contents of the published config file:
return [ 'webhook_token' => env('SEPAY_WEBHOOK_TOKEN'), 'pattern' => env('SEPAY_MATCH_PATTERN', 'SE'), ];
Optionally, you can publish the views using
php artisan vendor:publish --tag="sepay-views"
Usage
Tạo SePayWebhookListener
php artisan make:listener SePayWebhookListener
<?php namespace App\Listeners; use SePay\SePay\Events\SePayWebhookEvent; class SePayWebhookListener { /** * Create the event listener. */ public function __construct() { // } /** * Handle the event. */ public function handle(SePayWebhookEvent $event): void { // Xử lý nạp tiền / rút tiền } }
Đăng ký SePayWebhookListener vào app/Providers/EventServiceProvider.php
protected $listen = [ ... \SePay\SePay\Events\SePayWebhookEvent::class => [ \App\Listeners\SePayWebhookListener::class, ], ];
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.