Download the PHP package artem328/laravel-yandex-kassa without Composer
On this page you can find all versions of the php package artem328/laravel-yandex-kassa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-yandex-kassa
[NOT MAINTAINED] Laravel Yandex Kassa
Yandex Money integration with Laravel framework
Introduction
Laravel Yandex Kassa Package is kind of integration helper with Laravel Framework.
Installation
To install through composer, simply put the following in your composer.json
file:
And then run composer install
from the terminal.
Quick Installation
Above installation can also be simplify by using the following command:
composer require "artem328/laravel-yandex-kassa=~1.0.*"
Usage
Service Provider
For using Laravel Yandex Kassa Package, you need to add service provider into config/app.php
file:
Alias
For resolving YandexKassa
class instance you can add such line into config/app.php
file:
and now call methods statically from YandexKassa
class or you can use helper function yandex_kassa()
Configs
Also you need to publish configs, and fill some required data as sc_id
, shop_id
and shop_password
. To publish configs, run this command:
php artisan vendor:publish --provider="Artem328\LaravelYandexKassa\YandexKassaServiceProvider" --tag="config"
Now config file yandex_kassa.php
will be placed at your application config directory. In your application .env file you can set some options:
test_mode
asYANDEX_KASSA_TEST_MODE
shop_id
asYANDEX_KASSA_SHOP_ID
sc_id
asYANDEX_KASSA_SC_ID
shop_password
asYANDEX_KASSA_SHOP_PASSWORD
Views
As default this package use bootstrap 3 form layout that should be included into your page. You can customize this form by publishing views. To do this, run this command:
php artisan vendor:publish --provider="Artem328\LaravelYandexKassa\YandexKassaServiceProvider" --tag="view"
and default layouts will be placed at your resource directory under views/vendor/yandex_kassa
. You can customize layouts now. Pay attention at form layout that should contain all required fields for Yandex Kassa work correctly.
Languages
You can publish language files if you want customize payment names or form labels. Just run command:
php artisan vendor:publish --provider="Artem328\LaravelYandexKassa\YandexKassaServiceProvider" --tag="lang"
Localization files will be placed to resource directory lang/vendor/yandex_kassa
. If you need to add new locale files just create directory with locale name inside and copy files structure from existing locale folder, then change translation values.
Publish all resources
If you want to publish config, views and languages, just run this command:
php artisan vender:publish --provider="Artem328\LaravelYandexKassa\YandexKassaServiceProvider"
Show payment form
To show payment form in your layout just add this code:
Of course you can customize form or create your own one and include it.
Callback links
You can set callback links (checkOrder, paymentAviso etc) in config file at route section
Payment Types
Payments types can be set in config file at payment types section. There is a link to documentation page with full list of payment types.
Events
Yandex Kassa calls your application callbacks and waiting for response. You can customize response parameters by listening callback events. For example:
To listen events you should add some code to app/Providers/EventServiceProvider.php
:
Licence
MIT. See the LICENCE file