Download the PHP package actionm/laravel-webmoney-merchant without Composer
On this page you can find all versions of the php package actionm/laravel-webmoney-merchant. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download actionm/laravel-webmoney-merchant
More information about actionm/laravel-webmoney-merchant
Files in actionm/laravel-webmoney-merchant
Package laravel-webmoney-merchant
Short Description WebMoneyMerchant payments for Laravel
License MIT
Homepage https://github.com/actionm/laravel-webmoney-merchant
Informations about the package laravel-webmoney-merchant
Laravel payment processor package for WebMoney Merchant
Accept payments via WebMoney Merchant (merchant.webmoney.ru) using this Laravel framework package (Laravel).
- receive payments, adding just the two callbacks
- receive payment notifications via your email or Slack
You can accept payments with WebMoney Merchant via WebMoney, credit cards etc.
Laravel 5.3, 5.4, PHP >= 5.6.4
Installation
You can install the package through Composer:
Add the service provider to the providers
array in config/app.php
:
Add the WebMoneyMerchant
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/webmoney-merchant.php
.
- Create an account on merchant.webmoney.ru
-
Set your project settings:
- Merchant name;
- Secret Key;
- Secret Key X20;
- Result URL;
- Control sign forming method =
SHA256
; - Necessarily require signature payment form =
ON
; - Process payments with unique only lmi_payment_no =
ON
;
- After the configuration has been published, edit
config/webmoney-merchant.php
- Copy the
Secret Key X20
andSecret Key
params and paste intoconfig/webmoney-merchant.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/webmoney-merchant/payment_form.blade.php
2) Process the request from WebMoneyMerchant:
Important
You must define callbacks in config/webmoney-merchant.php
to search the order and save the paid order.
Example
The process scheme:
- The request comes from
merchant.webmoney.ru
GET
http://yourproject.com/webmoney/result
to check if your website is available. - The request comes from
merchant.webmoney.ru
POST
http://yourproject.com/webmoney/result
(with params). - The function
ExampleController@payOrderFromGate
runs the validation process (auto-validation request params). - The static function
searchOrderFilter
will be called (seeconfig/webmoney-merchant.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/webmoney-merchant.php
paidOrderFilter
).
Add the route to routes/web.php
:
Note: don't forget to save your full route url (e.g. http://example.com/webmoney/result ) for your project on merchant.webmoney.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.
Security
If you discover any security related issues, please send me an email at [email protected] instead of using the issue tracker.
Credits
- ActionM
- All Contributors
License
The MIT License (MIT). Please see License File for more information.