Download the PHP package daaner/laravel-unitpay without Composer
On this page you can find all versions of the php package daaner/laravel-unitpay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download daaner/laravel-unitpay
More information about daaner/laravel-unitpay
Files in daaner/laravel-unitpay
Package laravel-unitpay
Short Description UnitPay payments for Laravel
License MIT
Homepage https://github.com/daaner/laravel-unitpay
Informations about the package laravel-unitpay
Laravel payment processor package for UnitPay gateway
Accept payments via UnitPay (unitpay.ru) using this Laravel framework package (Laravel).
Based on ActionM
- receive payments, adding just the two callbacks
- receive payment notifications via your email or Slack
You can accept payments with Unitpay via Yandex.Money, QIWI, WebMoney, PayPal, credit cards etc.
Laravel 5.5+, PHP >= 7.1+
Installation
You can install the package through Composer:
Add the service provider to the providers
array in config/app.php
:
Add the UnitPay
facade to your facades array:
Publish the configuration file and views
Publish only the configuration file
Publish only the views
Configuration
Once you have published the configuration files, please edit the config file in config/unitpay.php
.
- Create an account on unitpay.ru
- Add your project, copy the
PUBLIC KEY
andSECRET KEY
params and paste intoconfig/unitpay.php
- After the configuration has been published, edit
config/unitpay.php
- Set the callback static function for
searchOrderFilter
andpaidOrderFilter
- Set notification channels (email and/or Slack) and Slack
webhook_url
Usage
1) Generate an HTML payment form with enabled payment methods:
Customize the HTML payment form in the published view:
app/resources/views/vendor/unitpay/payment_form.blade.php
2) Process the request from UnitPay:
Important
You must define callbacks in config/unitpay.php
to search the order and save the paid order.
Example
The process scheme:
- The request comes from
unitpay.ru
GET
http://yourproject.com/unitpay/result
(with params). - The function
ExampleController@payOrderFromGate
runs the validation process (auto-validation request params). - The static function
searchOrderFilter
will be called (seeconfig/unitpay.php
searchOrderFilter
) to search the order by the unique id. - If the current order status is NOT
paid
in your database, the static functionpaidOrderFilter
will be called (seeconfig/unitpay.php
paidOrderFilter
).
Add the route to routes/web.php
:
Note: don't forget to save your full route url (e.g. http://example.com/unitpay/result ) for your project on unitpay.ru.
Create the following controller: /app/Http/Controllers/ExampleController.php
:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Testing
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.