myagmarsurensedjav / simple-payment
A simple Qpay implementation for Laravel applications.
v0.6.0
2024-05-18 00:14 UTC
Requires
- php: ^8.1
- endroid/qr-code: ^5.0
- illuminate/console: ^10.0|^11.0
- illuminate/contracts: ^10.0|^11.0
- spatie/laravel-package-tools: ^1.16.0
Requires (Dev)
- laravel/pint: ^1.15.3
- nunomaduro/collision: ^8.1
- nunomaduro/larastan: ^2.9.6
- orchestra/testbench: ^9.0.4
- pestphp/pest: ^2.34.7
- pestphp/pest-plugin-arch: ^2.7.0
- pestphp/pest-plugin-laravel: ^2.4.0
- pestphp/pest-plugin-mock: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
README
Installation
You can install the package via composer:
composer require myagmarsurensedjav/simple-payment
And run the following installer command
php artisan simple-payment:install
You can publish the config file with:
php artisan vendor:publish --tag="simple-payment-config"
This is the contents of the published config file:
<?php // config for MyagmarsurenSedjav/SimplePayment return [ 'default' => env('SIMPLE_PAYMENT_DEFAULT', 'qpay'), 'drivers' => [ 'qpay' => [ 'env' => env('QPAY_ENV', 'fake'), 'username' => env('QPAY_USERNAME'), 'password' => env('QPAY_PASSWORD'), 'invoice_code' => env('QPAY_INVOICE_CODE'), ], 'golomt' => [ 'env' => env('GOLOMT_ENV', 'fake'), 'access_token' => env('GOLOMT_ACCESS_TOKEN'), 'hash_key' => env('GOLOMT_HASH_KEY'), ], ], 'user_model' => 'App\Models\User', 'notification_middleware' => [ // 'api' ], 'return_middlewares' => [ // 'web' ], ];
Optionally, you can publish the views using
php artisan vendor:publish --tag="simple-payment-views"
Usage
MyagmarsurenSedjav\SimplePayment\Contracts\Payable
interface should be implemented by the model that will be paid.
use MyagmarsurenSedjav\SimplePayment\Facades\SimplePayment; Route::get('/invoices/{invoice}/payment', function (Invoice $invoice) { return SimplePayment::create($invoice); });
If you need specific driver, you can use driver
method.
SimplePayment::driver('socialpay')->create($invoice);
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.