PHPackages                             dammyammy/lara-pay-ng - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. dammyammy/lara-pay-ng

ActiveLibrary[Payment Processing](/categories/payments)

dammyammy/lara-pay-ng
=====================

Payment Solution For Laravel 5 (Nigerian Specific Providers eg. GTPay, SimplePay, CashEnvoy, VoguePay, WebPay)

5.1.x-dev(10y ago)41411[1 issues](https://github.com/dammyammy/lara-pay-ng/issues)MITPHPPHP &gt;=5.5.9

Since Dec 12Pushed 10y ago6 watchersCompare

[ Source](https://github.com/dammyammy/lara-pay-ng)[ Packagist](https://packagist.org/packages/dammyammy/lara-pay-ng)[ Docs](http://dami.ogunmoye.com)[ RSS](/packages/dammyammy-lara-pay-ng/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

*Supports Multiple Gateways with a single API approach, meaning Integration is the same across board in code.*

*Note:* Do Not Use In Production, Currently being developed to be compatible with the latest version of Laravel.

The Aim is to Integrate as many Payment Gateways As Possible.

Requirements
============

[](#requirements)

Currently Supported
===================

[](#currently-supported)

- VoguePay
- GTPay
- CashEnvoy
- SimplePay

Gateways Currently In development
=================================

[](#gateways-currently-in-development)

- WebPay

Installation
============

[](#installation)

Simply Run

```
    composer require dammyammy/lara-pay-ng
```

Next Add the Service Provider into your Providers Array in config/app.php

```
    'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
        'Illuminate\Foundation\Providers\ArtisanServiceProvider',
        'Illuminate\Auth\AuthServiceProvider',

        ....

        'LaraPayNG\Providers\LaraPayNGServiceProvider',
    ],
```

Next Publish All Package Files

```
php artisan vendor:publish
```

This Would create the following:

1. A *PaymentController* in *app/Http/Controllers/PaymentController.php*

- Note: This is a working Sample, you may need to change Namespace to match your Projects namespace

2. *Migrations* would be published to folder database/migrations
3. 4 Views, matching the Controller

- one with a simulated checkout out button
- one is the proceed to pay page (Pay Now Button)
- one is a success notification Url, Showing a Successful Transaction
- one is a failure notification Url, Showing a Failed Transaction

Next Add the following to your routes page in app/Http/routes.php and edit as you seem fit, But be sure specified values match Your Config file

```
    Route::get('orders',  [
        'as' => 'orders',
        'uses' => 'PaymentController@orders'
    ]);

    Route::get('checkout',  [
        'as' => 'checkout',
        'uses' => 'PaymentController@checkout'
    ]);

    $successUrl = config('lara-pay-ng.gateways.routes.success_route');
    $successName = config('lara-pay-ng.gateways.routes.success_route_name');

    $failureUrl = config('lara-pay-ng.gateways.routes.failure_route');
    $failureName = config('lara-pay-ng.gateways.routes.failure_route_name');

    Route::post('/' . $successUrl . '/{mert_id}', [
        'as' => $successName,
        'uses' => 'PaymentController@success'
    ]);

    Route::post('/' . $failureUrl . '/{mert_id}', [
        'as' => $failureName,
        'uses' => 'PaymentController@failed'
    ]);

    Route::post('/payment-notification/{mert_id}', [
        'as' => 'payment-notification',
        'uses' => 'PaymentController@notification'
    ]);
```

Remember to Disallow CSRF Token Verification for your payment routes
====================================================================

[](#remember-to-disallow-csrf-token-verification-for-your-payment-routes)

This is perhaps one of the use cases in which u need to absolutely do this. If this is not done, When a Transaction Id is been sent back your site would throw a TokenMismatchException, as the Gateway Provider is posting back, and doesn't have a token Generated from your app.

Use the appropriate route endpoints if you did change the default names and urls.

```
