Download the PHP package allanvb/laravel-walletone without Composer
On this page you can find all versions of the php package allanvb/laravel-walletone. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download allanvb/laravel-walletone
More information about allanvb/laravel-walletone
Files in allanvb/laravel-walletone
Package laravel-walletone
Short Description Laravel integration of walletone.com payment gateway
License MIT
Informations about the package laravel-walletone
Laravel package for integrating WalletOne payment gateway into laravel app
Package that integrates WalletOne API into your Laravel app.
Install
Via Composer
If you're using Laravel 5.5 or above, the package will automatically register provider and facade.
Laravel 5.4 and below
Add Allanvb\LaravelWalletOne\Providers\WalletoneServiceProvider
to the providers
array in your config/app.php
:
Add an alias in your config/app.php
:
Or you can use
the facade class when needed:
Configuration
You can use php artisan vendor:publish
to copy the configuration file to your app's config directory:
Then update config/wallet-one.php
with your credentials. Also you can update your .env
file with the following:
Usage:
To use the WalletOne Library you can access the facade, or request the instance from the service container:
Or
Parameters:
$orderID
- (string) ID of user order on your e-commerce (required).$amount
- (float) Amount of money the user has to pay (required).$description
- (string) Payment description (required).$options
- (array) Any other options you want to save on WalletOne service, or get back in response.
In order to create payment form for user, you have to get all post params by using getParams()
method.
Then send this params to your view and create form.
As form action use WalletOne::API_URL
.
In order to get response from WalletOne service, you have to define a post
route inside your web.php
.
This route should use \Allanvb\LaravelWalletOne\Http\Middleware\WalletonePay::class
middleware.
You can add this middleware to your Kernel.php
inside App\Http
folder.
Then you can use it as following:
NOTE:
- Your controller should return
WalletOne::response()
method ! - Don't forget to add your route into
$except
param ofVerifyCsrfToken
middleware !
Each request to your route will generate a SuccessPayment
or FailedPayment
event,
so all you have to do is to define a event listener for each of them.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
This package is actually a continuity of pdazcom/laravel-walletone whose author is Konstantin A.
License
The MIT License (MIT). Please see License File for more information.