LaravelPackages.net
Acme Inc.
Toggle sidebar
isurindu/webxpay-laravel

Webxpay laravel package

161
6
v1.4
About isurindu/webxpay-laravel

isurindu/webxpay-laravel is a Laravel package for webxpay laravel package. It currently has 6 GitHub stars and 161 downloads on Packagist (latest version v1.4). Install it with composer require isurindu/webxpay-laravel. Discover more Laravel packages by isurindu or browse all Laravel packages to compare alternatives.

Last updated

Webxpay Laravel

Latest Stable Version Total Downloads License

Installation

You can install the package via composer:

composer require isurindu/webxpay-laravel

In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider in config/app.php file:

'providers' => [
    // ...
    Isurindu\WebxpayLaravel\WebxpayServiceProvider::class,
];

You can publish config and views

php artisan vendor:publish --provider="Isurindu\WebxpayLaravel\WebxpayServiceProvider"

Usage

in route

Route::get('payment/{ORDER_ID}', 'PaymentController@index');
Route::post('payment/verify', 'PaymentController@verify');

in App/Http/Middleware/VerifyCsrfToken.php

<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;

class VerifyCsrfToken extends Middleware
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
        'payment/verify'
    ];
}

in controller

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Isurindu\WebxpayLaravel\Facades\Webxpay;

class PaymentController extends Controller
{

    public function store(Request $request)
    {

            return Webxpay::redirect([
                'order_id'=>'102',
                'price'=>'100',
                'first_name'=>'isurindu',
                'last_name'=>'prabashwara',
                'email'=>'[email protected]',
                'contact_number'=>'',
                'address_line_one'=>'',
                'cms'=>'laravel',
                'process_currency'=>'LKR',
                'custom_fields'=>'',
                'city'=>'',
                'state'=>'',
                'postal_code'=>'',
                'country'=>'',
            ]);

    }
    public function verify(Request $request)
    {
        return dd(Webxpay::verify());
    }
}

Star History Chart