├── .gitignore ├── LICENSE.md ├── README.md ├── composer.json └── src ├── LaravelYandexKassa ├── Events │ ├── BeforeCancelOrderResponse.php │ ├── BeforeCheckOrderResponse.php │ ├── BeforePaymentAvisoResponse.php │ ├── BeforeResponse.php │ └── YandexKassaEvent.php ├── Exceptions │ ├── YandexKassaInvalidParameterException.php │ └── YandexKassaNoPaymentTypesProvidedException.php ├── Facades │ └── YandexKassa.php ├── Requests │ └── YandexKassaRequest.php ├── YandexKassa.php ├── YandexKassaController.php ├── YandexKassaServiceProvider.php └── helpers.php ├── config └── yandex_kassa.php ├── lang ├── en │ ├── form.php │ └── payment_types.php └── ru │ ├── form.php │ └── payment_types.php ├── routes.php └── views └── form.blade.php /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Artem Vozhzhov 4 | 5 | > Permission is hereby granted, free of charge, to any person obtaining a copy 6 | > of this software and associated documentation files (the "Software"), to deal 7 | > in the Software without restriction, including without limitation the rights 8 | > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | > copies of the Software, and to permit persons to whom the Software is 10 | > furnished to do so, subject to the following conditions: 11 | > 12 | > The above copyright notice and this permission notice shall be included in 13 | > all copies or substantial portions of the Software. 14 | > 15 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | > THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # \[NOT MAINTAINED\] Laravel Yandex Kassa 2 | 3 | Yandex Money integration with Laravel framework 4 | 5 | ## Introduction 6 | Laravel Yandex Kassa Package is kind of integration helper with Laravel Framework. 7 | 8 | ## Installation 9 | To install through composer, simply put the following in your `composer.json` file: 10 | 11 | ```json 12 | { 13 | "require": { 14 | "artem328/laravel-yandex-kassa": "~1.0.*" 15 | } 16 | } 17 | ``` 18 | 19 | And then run `composer install` from the terminal. 20 | 21 | ### Quick Installation 22 | 23 | Above installation can also be simplify by using the following command: 24 | 25 | composer require "artem328/laravel-yandex-kassa=~1.0.*" 26 | 27 | ## Usage 28 | 29 | ### Service Provider 30 | For using Laravel Yandex Kassa Package, you need to add service provider into `config/app.php` file: 31 | ```php 32 | [ 36 | //... 37 | Artem328\LaravelYandexKassa\YandexKassaServiceProvider::class, 38 | ], 39 | //... 40 | ]; 41 | ``` 42 | 43 | ### Alias 44 | For resolving `YandexKassa` class instance you can add such line into `config/app.php` file: 45 | ```php 46 | [ 50 | //... 51 | 'YandexKassa' => Artem328\LaravelYandexKassa\Facades\YandexKassa::class, 52 | ], 53 | //... 54 | ]; 55 | ``` 56 | and now call methods statically from `YandexKassa` class or you can use helper function `yandex_kassa()` 57 | 58 | ### Configs 59 | 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: 60 | 61 | php artisan vendor:publish --provider="Artem328\LaravelYandexKassa\YandexKassaServiceProvider" --tag="config" 62 | 63 | Now config file `yandex_kassa.php` will be placed at your application config directory. In your application .env file you can set some options: 64 | * `test_mode` as `YANDEX_KASSA_TEST_MODE` 65 | * `shop_id` as `YANDEX_KASSA_SHOP_ID` 66 | * `sc_id` as `YANDEX_KASSA_SC_ID` 67 | * `shop_password` as `YANDEX_KASSA_SHOP_PASSWORD` 68 | 69 | ### Views 70 | 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: 71 | 72 | php artisan vendor:publish --provider="Artem328\LaravelYandexKassa\YandexKassaServiceProvider" --tag="view" 73 | 74 | 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. 75 | 76 | ### Languages 77 | You can publish language files if you want customize payment names or form labels. Just run command: 78 | 79 | php artisan vendor:publish --provider="Artem328\LaravelYandexKassa\YandexKassaServiceProvider" --tag="lang" 80 | 81 | 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. 82 | 83 | #### Publish all resources 84 | If you want to publish config, views and languages, just run this command: 85 | 86 | php artisan vender:publish --provider="Artem328\LaravelYandexKassa\YandexKassaServiceProvider" 87 | 88 | ### Show payment form 89 | To show payment form in your layout just add this code: 90 | ```blade 91 | @include('yandex_kassa::form') 92 | ``` 93 | Of course you can [customize form](#views) or create your own one and include it. 94 | 95 | ### Callback links 96 | You can set callback links (checkOrder, paymentAviso etc) in config file at route section 97 | 98 | ### Payment Types 99 | 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. 100 | 101 | ### Events 102 | Yandex Kassa calls your application callbacks and waiting for response. You can customize response parameters by listening callback events. For example: 103 | ```php 104 | request->isValidHash()) { 121 | $order = Order::find($event->request->get('orderNumber')); 122 | $order->setStatus('packing'); 123 | $order->save(); 124 | } else { 125 | // Logic on non valid hash 126 | // You don't need to set response code to 1 127 | // YandexKassaRequest do it automatically 128 | } 129 | } 130 | } 131 | ``` 132 | 133 | ```php 134 | request->get('customField') != '1') { 152 | $event->responseParameters['code'] = 100; 153 | $event->responseParameters['message'] = 'Some checkbox was not checked'; 154 | // You must to return response parameters array, 155 | // for apply changes 156 | return $event->responseParameters; 157 | } 158 | 159 | // If there's no parameters changes 160 | // just return null or empty array 161 | return null; 162 | } 163 | } 164 | ``` 165 | 166 | To listen events you should add some code to `app/Providers/EventServiceProvider.php`: 167 | ```php 168 | [ 179 | 'App\Listeners\CheckOrderRequisites', 180 | // You can add more than one listener and every 181 | // listener can return own parameters. Incoming 182 | // parameters WILL NOT extend. But response 183 | // parameters WILL override in listeners order 184 | // 'App\Listeneres\AddCheckOrderRecord', 185 | ], 186 | 'Artem328\LaravelYandexKassa\Events\BeforePaymentAvisoResponse' => [ 187 | 'App\Listeners\ChangeOrderStatusWhenPaymentSuccessful', 188 | ] 189 | ]; 190 | //... 191 | } 192 | ``` 193 | 194 | ## Licence 195 | MIT. See the [LICENCE](https://github.com/artem328/laravel-yandex-kassa/blob/master/LICENSE.md) file 196 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "artem328/laravel-yandex-kassa", 3 | "type": "library", 4 | "description": "Yandex Kassa integration with Laravel framework", 5 | "keywords": [ 6 | "laravel", "yandex", "kassa", "money", 7 | "яндекс", "касса", "деньги" 8 | ], 9 | "homepage": "https://github.com/artem328/laravel-yandex-kassa", 10 | "license": "MIT", 11 | "authors": [ 12 | {"name": "Artem Vozhzhov", "email": "vojjov.artem@ya.ru", "role": "Developer"} 13 | ], 14 | "require": { 15 | "illuminate/support": "~5.1", 16 | "php" : "~5.5|~7.0" 17 | }, 18 | "autoload": { 19 | "psr-4": { 20 | "Artem328\\LaravelYandexKassa\\": "src/LaravelYandexKassa" 21 | }, 22 | "files": [ 23 | "src/LaravelYandexKassa/helpers.php" 24 | ] 25 | }, 26 | "extra": { 27 | "branch-alias": { 28 | "dev-master": "1.0-dev" 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/LaravelYandexKassa/Events/BeforeCancelOrderResponse.php: -------------------------------------------------------------------------------- 1 | request = $request; 27 | $this->responseParameters = $responseParameters; 28 | } 29 | } -------------------------------------------------------------------------------- /src/LaravelYandexKassa/Events/YandexKassaEvent.php: -------------------------------------------------------------------------------- 1 | hashIsValid === null) { 40 | $parameters = [ 41 | $this->get('action'), 42 | $this->get('orderSumAmount'), 43 | $this->get('orderSumCurrencyPaycash'), 44 | $this->get('orderSumBankPaycash'), 45 | $this->get('shopId'), 46 | $this->get('invoiceId'), 47 | $this->get('customerNumber'), 48 | config('yandex_kassa.shop_password') 49 | ]; 50 | 51 | $this->hashIsValid = strtolower(md5(implode(';', $parameters))) === strtolower($this->get('md5')); 52 | } 53 | 54 | return $this->hashIsValid; 55 | } 56 | } -------------------------------------------------------------------------------- /src/LaravelYandexKassa/YandexKassa.php: -------------------------------------------------------------------------------- 1 | testFormAction : $this->formAction; 61 | } 62 | 63 | /** 64 | * Get form method 65 | * 66 | * @return string 67 | */ 68 | public function getFormMethod() 69 | { 70 | return $this->formMethod; 71 | } 72 | 73 | /** 74 | * Get scId parameter 75 | * 76 | * @return string 77 | * @throws \Artem328\LaravelYandexKassa\Exceptions\YandexKassaInvalidParameterException 78 | */ 79 | public function getScId() 80 | { 81 | $scId = config('yandex_kassa.sc_id'); 82 | 83 | if (!$scId) { 84 | throw new YandexKassaInvalidParameterException('scId'); 85 | } 86 | 87 | return $scId; 88 | } 89 | 90 | /** 91 | * Get shopId parameter 92 | * 93 | * @return string 94 | * @throws \Artem328\LaravelYandexKassa\Exceptions\YandexKassaInvalidParameterException 95 | */ 96 | public function getShopId() 97 | { 98 | $shopId = config('yandex_kassa.shop_id'); 99 | 100 | if (!$shopId) { 101 | throw new YandexKassaInvalidParameterException('shopId'); 102 | } 103 | 104 | return $shopId; 105 | } 106 | 107 | /** 108 | * @return \Illuminate\Support\Collection 109 | * @throws \Artem328\LaravelYandexKassa\Exceptions\YandexKassaNoPaymentTypesProvidedException 110 | */ 111 | public function getPaymentTypes() 112 | { 113 | if ($this->paymentTypes === null) 114 | $this->paymentTypes = collect(config('yandex_kassa.payment_types', [])); 115 | 116 | if ($this->paymentTypes->isEmpty()) { 117 | throw new YandexKassaNoPaymentTypesProvidedException; 118 | } 119 | 120 | return $this->paymentTypes; 121 | } 122 | } -------------------------------------------------------------------------------- /src/LaravelYandexKassa/YandexKassaController.php: -------------------------------------------------------------------------------- 1 | getDefaultResponseParameters($request); 19 | 20 | /* 21 | * Before send response, passing request and response parameters 22 | * through listeners 23 | */ 24 | return $this->getXmlResponse('checkOrderResponse', $this->mergerResponseParameters( 25 | $responseParameters, 26 | event(new BeforeCheckOrderResponse($request, $responseParameters)) 27 | )); 28 | } 29 | 30 | /** 31 | * @param \Artem328\LaravelYandexKassa\Requests\YandexKassaRequest $request 32 | * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response 33 | */ 34 | public function cancelOrder(YandexKassaRequest $request) 35 | { 36 | $responseParameters = $this->getDefaultResponseParameters($request); 37 | 38 | /* 39 | * Before send response, passing request and response parameters 40 | * through listeners 41 | */ 42 | return $this->getXmlResponse('cancelOrderResponse', $this->mergerResponseParameters( 43 | $responseParameters, 44 | event(new BeforeCancelOrderResponse($request, $responseParameters)) 45 | )); 46 | } 47 | 48 | /** 49 | * @param \Artem328\LaravelYandexKassa\Requests\YandexKassaRequest $request 50 | * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response 51 | */ 52 | public function paymentAviso(YandexKassaRequest $request) 53 | { 54 | $responseParameters = $this->getDefaultResponseParameters($request); 55 | 56 | /* 57 | * Before send response, passing request and response parameters 58 | * through listeners 59 | */ 60 | return $this->getXmlResponse('paymentAvisoResponse', $this->mergerResponseParameters( 61 | $responseParameters, 62 | event(new BeforePaymentAvisoResponse($request, $responseParameters)) 63 | )); 64 | } 65 | 66 | /** 67 | * 68 | * @param \Artem328\LaravelYandexKassa\Requests\YandexKassaRequest $request 69 | * @return array 70 | */ 71 | protected function getDefaultResponseParameters(YandexKassaRequest $request) 72 | { 73 | return [ 74 | 'performedDatetime' => $request->get('requestDatetime'), 75 | 'code' => $request->isValidHash() ? 0 : 1, 76 | 'invoiceId' => $request->get('invoiceId'), 77 | 'shopId' => yandex_kassa_shop_id() 78 | ]; 79 | } 80 | 81 | /** 82 | * Merge response parameters after events processing 83 | * 84 | * @param array $responseParameters 85 | * @param array $responses 86 | * @return array 87 | */ 88 | protected function mergerResponseParameters($responseParameters, $responses) 89 | { 90 | foreach ($responses as $response) { 91 | if (! is_array($response)) { 92 | continue; 93 | } 94 | $responseParameters = array_merge($responseParameters, $response); 95 | } 96 | 97 | return $responseParameters; 98 | } 99 | 100 | /** 101 | * Generates XML output 102 | * 103 | * @param string $tagName 104 | * @param array $parameters 105 | * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response 106 | */ 107 | protected function getXmlResponse($tagName, $parameters) 108 | { 109 | $response = [ 110 | '', 111 | '<', 112 | $tagName, 113 | $this->getXmlAttributes($parameters), 114 | '/>' 115 | ]; 116 | 117 | return response(implode('', $response), 200, [ 118 | 'Content-type' => 'application/xml' 119 | ]); 120 | } 121 | 122 | /** 123 | * Generates xml attributes string from array 124 | * 125 | * @param $parameters 126 | * @return string 127 | */ 128 | protected function getXmlAttributes($parameters) 129 | { 130 | $attributes = []; 131 | 132 | foreach ($parameters as $name => $value) { 133 | if (is_string($name)) { 134 | $attributes[] = htmlspecialchars($name, ENT_XML1) . '="' . htmlspecialchars($value, ENT_XML1) . '"'; 135 | } 136 | } 137 | 138 | return !empty($attributes) ? ' ' . implode(' ', $attributes) : ''; 139 | } 140 | } -------------------------------------------------------------------------------- /src/LaravelYandexKassa/YandexKassaServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->routesAreCached()) { 19 | require __DIR__ . '/../routes.php'; 20 | } 21 | 22 | $this->loadTranslationsFrom(__DIR__ . '/../lang', 'yandex_kassa'); 23 | $this->loadViewsFrom(__DIR__ . '/../views', 'yandex_kassa'); 24 | 25 | $this->publishes([ 26 | __DIR__ . '/../config/yandex_kassa.php' => config_path('yandex_kassa.php') 27 | ], 'config'); 28 | 29 | $this->publishes([ 30 | __DIR__ . '/../lang' => resource_path('lang/vendor/yandex_kassa') 31 | ], 'lang'); 32 | 33 | $this->publishes([ 34 | __DIR__ . '/../views' => resource_path('views/vendor/yandex_kassa') 35 | ], 'view'); 36 | } 37 | 38 | /** 39 | * Register any package services. 40 | * 41 | * @return void 42 | */ 43 | public function register() 44 | { 45 | $this->mergeConfigFrom(__DIR__ . '/../config/yandex_kassa.php', 'yandex_kassa'); 46 | 47 | $this->app->singleton('yandexkassa', function() { 48 | return new YandexKassa(); 49 | }); 50 | } 51 | 52 | /** 53 | * Get the services provided by the provider. 54 | * 55 | * @return array 56 | */ 57 | public function provides() 58 | { 59 | return [ 60 | 'yandexkassa' 61 | ]; 62 | } 63 | 64 | 65 | } -------------------------------------------------------------------------------- /src/LaravelYandexKassa/helpers.php: -------------------------------------------------------------------------------- 1 | $uses, 18 | 'namespace' => $namespace 19 | ], 20 | $defaults 21 | ); 22 | } 23 | 24 | /** 25 | * Helper function for getting YandexKassa 26 | * class instance 27 | * 28 | * @return \Artem328\LaravelYandexKassa\YandexKassa 29 | */ 30 | function yandex_kassa() { 31 | return app('yandexkassa'); 32 | } 33 | 34 | /** 35 | * Helper function for getting form action 36 | * 37 | * @return string 38 | */ 39 | function yandex_kassa_form_action() 40 | { 41 | return yandex_kassa()->getFormAction(); 42 | } 43 | 44 | /** 45 | * Helper function for getting form method 46 | * 47 | * @return string 48 | */ 49 | function yandex_kassa_form_method() 50 | { 51 | return yandex_kassa()->getFormMethod(); 52 | } 53 | 54 | /** 55 | * Helper function for getting scId parameter 56 | * 57 | * @return string 58 | * @throws \Artem328\LaravelYandexKassa\Exceptions\YandexKassaInvalidParameterException 59 | */ 60 | function yandex_kassa_sc_id() 61 | { 62 | return yandex_kassa()->getScId(); 63 | } 64 | 65 | /** 66 | * Helper function for getting shopId parameter 67 | * 68 | * @return string 69 | * @throws \Artem328\LaravelYandexKassa\Exceptions\YandexKassaInvalidParameterException 70 | */ 71 | function yandex_kassa_shop_id() 72 | { 73 | return yandex_kassa()->getShopId(); 74 | } 75 | 76 | /** 77 | * Helper function for getting payment types 78 | * 79 | * @return \Illuminate\Support\Collection 80 | * @throws \Artem328\LaravelYandexKassa\Exceptions\YandexKassaNoPaymentTypesProvidedException 81 | */ 82 | function yandex_kassa_payment_types() 83 | { 84 | return yandex_kassa()->getPaymentTypes(); 85 | } -------------------------------------------------------------------------------- /src/config/yandex_kassa.php: -------------------------------------------------------------------------------- 1 | env('YANDEX_KASSA_TEST_MODE', true), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Yandex Money shop parameters 23 | | Параметры магазина Яндекс Деньги 24 | |-------------------------------------------------------------------------- 25 | | 26 | | In this section you should write yandex money requisites, 27 | | that you can get on Yandex Kassa official website, after 28 | | registering own shop 29 | | 30 | | Параметры, которые нужно заполнить ниже можно получить 31 | | в личном кабинете Яндекс Кассы, после регистрации 32 | | магазина 33 | | 34 | | @see https://money.yandex.ru/joinups 35 | | 36 | */ 37 | 'shop_id' => env('YANDEX_KASSA_SHOP_ID', null), 38 | 'sc_id' => env('YANDEX_KASSA_SC_ID', null), 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shop Password 43 | | Секретное слово магазина (shoppassword) 44 | |-------------------------------------------------------------------------- 45 | | 46 | | Secret word for generating md5-hash 47 | | 48 | | Секретное слово для формирования md5-хэша 49 | | 50 | | @see https://tech.yandex.com/money/doc/payment-solution/shop-config/parameters-docpage/ 51 | | 52 | */ 53 | 'shop_password' => env('YANDEX_KASSA_SHOP_PASSWORD', ''), 54 | 55 | /* 56 | |-------------------------------------------------------------------------- 57 | | Payment types 58 | | Способы оплаты 59 | |-------------------------------------------------------------------------- 60 | | 61 | | Payment types that will be given in payment form. 62 | | All available payment types you can find 63 | | in Yandex Kassa documentation 64 | | 65 | | Способы оплаты, которые будут предложены в форме 66 | | оплаты. Все доступные способы оплаты можно найти 67 | | в документации Яндекс Кассы 68 | | 69 | | @see https://tech.yandex.com/money/doc/payment-solution/reference/payment-type-codes-docpage/ 70 | | 71 | */ 72 | 'payment_types' => [ 73 | 'PC', 'AC', 'MC', 'GP', 74 | 'WM', 'SB', 'MP', 'AB', 75 | 'MA', 'PB', 'QW', 'KV', 76 | 'QP' 77 | ], 78 | 79 | /* 80 | |-------------------------------------------------------------------------- 81 | | Routes settings 82 | | Настройки путей 83 | |-------------------------------------------------------------------------- 84 | | 85 | */ 86 | 'route' => [ 87 | 'checkOrder' => [ 88 | 'url' => '/yandex_kassa/checkOrder', 89 | //'action' => [ 90 | // 'middleware' => 'web' 91 | //] 92 | ], 93 | 'cancelOrder' => [ 94 | 'url' => '/yandex_kassa/cancelOrder' 95 | ], 96 | 'paymentAviso' => [ 97 | 'url' => '/yandex_kassa/paymentAviso', 98 | ] 99 | ], 100 | ]; 101 | -------------------------------------------------------------------------------- /src/lang/en/form.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'sum' => 'Payment sum:', 6 | 'payment_type' => 'Payment type:', 7 | 'customer_number' => 'Customer:' 8 | ], 9 | 'button' => [ 10 | 'pay' => 'Pay' 11 | ] 12 | ]; -------------------------------------------------------------------------------- /src/lang/en/payment_types.php: -------------------------------------------------------------------------------- 1 | 'Payment from a Yandex.Money wallet', 5 | 'AC' => 'Payment from any bank card', 6 | 'MC' => 'Payment from a mobile phone account', 7 | 'GP' => 'Cash payment via kiosks and terminals', 8 | 'WM' => 'Payment from a WebMoney wallet', 9 | 'SB' => 'Payment via Sberbank: SMS message or Sberbank Online', 10 | 'MP' => 'Payment using a mobile terminal (mPOS)', 11 | 'AB' => 'Payment using Alfa-Click', 12 | 'MA' => 'Payment using MasterPass', 13 | 'PB' => 'Payment using Promsvyazbank online banking', 14 | 'QW' => 'Payment using QIWI Wallet', 15 | 'KV' => 'Payment using KupiVkredit (Tinkoff Bank)', 16 | 'QP' => 'Payment using a Promised Payment on QPPI.ru' 17 | ]; -------------------------------------------------------------------------------- /src/lang/ru/form.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'sum' => 'Сумма к оплате:', 6 | 'payment_type' => 'Способ оплаты:', 7 | 'customer_number' => 'Покупатель:' 8 | ], 9 | 'button' => [ 10 | 'pay' => 'Оплатить' 11 | ] 12 | ]; -------------------------------------------------------------------------------- /src/lang/ru/payment_types.php: -------------------------------------------------------------------------------- 1 | 'Оплата из кошелька в Яндекс.Деньгах', 5 | 'AC' => 'Оплата с произвольной банковской карты', 6 | 'MC' => 'Оплата со счета мобильного телефона', 7 | 'GP' => 'Оплата наличными через кассы и терминалы', 8 | 'WM' => 'Оплата из кошелька в системе WebMoney', 9 | 'SB' => 'Оплата через Сбербанк: по смс или Сбербанк Онлайн', 10 | 'MP' => 'Оплата через мобильный терминал (mPOS)', 11 | 'AB' => 'Оплата через Альфа-Клик', 12 | 'MA' => 'Оплата через MasterPass', 13 | 'PB' => 'Оплата через интернет-банк Промсвязьбанка', 14 | 'QW' => 'Оплата через QIWI Wallet', 15 | 'KV' => 'Оплата через КупиВкредит (Тинькофф Банк)', 16 | 'QP' => 'Оплата через Доверительный платеж на Куппи.ру' 17 | ]; -------------------------------------------------------------------------------- /src/routes.php: -------------------------------------------------------------------------------- 1 | group([ 4 | 'namespace' => 'Artem328\LaravelYandexKassa' 5 | ], function () { 6 | 7 | /** @var \Illuminate\Routing\Router $router */ 8 | $router = app('router'); 9 | 10 | $router->post( 11 | config('yandex_kassa.route.checkOrder.url'), 12 | yandex_kassa_route_action('YandexKassaController@checkOrder', config('yandex_kassa.route.checkOrder.action', [])) 13 | ); 14 | 15 | $router->post( 16 | config('yandex_kassa.route.cancelOrder.url'), 17 | yandex_kassa_route_action('YandexKassaController@cancelOrder', config('yandex_kassa.route.checkOrder.action', [])) 18 | ); 19 | 20 | $router->post( 21 | config('yandex_kassa.route.paymentAviso.url'), 22 | yandex_kassa_route_action('YandexKassaController@paymentAviso', config('yandex_kassa.route.paymentAviso.action', [])) 23 | ); 24 | }); -------------------------------------------------------------------------------- /src/views/form.blade.php: -------------------------------------------------------------------------------- 1 | {{-- 2 | -- For more information about form fields 3 | -- you can visit Yandex Kassa documentation page 4 | -- 5 | -- @see https://tech.yandex.com/money/doc/payment-solution/payment-form/payment-form-http-docpage/ 6 | --}} 7 |
8 | 9 | 10 |
11 | 12 |
13 | 14 |
15 |
16 |
17 | 18 |
19 | 20 |
21 |
22 |
23 | 24 |
25 | @foreach(yandex_kassa_payment_types() as $paymentTypeCode) 26 |
27 | 31 |
32 | @endforeach 33 |
34 |
35 |
36 |
37 | 38 |
39 |
40 | 41 |
--------------------------------------------------------------------------------