GithubHelp home page GithubHelp logo

gaurav112 / indipay Goto Github PK

View Code? Open in Web Editor NEW

This project forked from softon/indipay

0.0 1.0 0.0 49 KB

The Laravel 5 Package for Indian Payment Gateways. Currently Supported Gateway: CCAvenue, PayUMoney, EBS, CitrusPay, InstaMojo

Home Page: http://softon.github.io/indipay

License: MIT License

PHP 82.12% HTML 17.88%

indipay's Introduction

IndiPay

The Laravel 5 Package for Indian Payment Gateways. Currently supported gateway: CCAvenue, PayUMoney, EBS, CitrusPay

For Laravel 4.2 Package Click Here

Installation

Step 1: Install package using composer

    composer require softon/indipay

Step 2: Add the service provider to the config/app.php file in Laravel


    'Softon\Indipay\IndipayServiceProvider',

Step 3: Add an alias for the Facade to the config/app.php file in Laravel


    'Indipay' => 'Softon\Indipay\Facades\Indipay',

Step 4: Publish the config & Middleware by running in your terminal


    php artisan vendor:publish

Step 5: Modify the app\Http\Kernel.php to use the new Middleware. This is required so as to avoid CSRF verification on the Response Url from the payment gateways. You may adjust the routes in the config file config/indipay.php to disable CSRF on your gateways response routes.


    'App\Http\Middleware\VerifyCsrfToken',

to


    'App\Http\Middleware\VerifyCsrfMiddleware',

Usage

Edit the config/indipay.php. Set the appropriate Gateway and its parameters. Then in your code...

 use Softon\Indipay\Facades\Indipay;  

Initiate Purchase Request and Redirect using the default gateway:-

      /* All Required Parameters by your Gateway */
      
      $parameters = [
      
        'tid' => '1233221223322',
        
        'order_id' => '1232212',
        
        'amount' => '1200.00',
        
      ];
      
      $order = Indipay::prepare($parameters);
      return Indipay::process($order);

Initiate Purchase Request and Redirect using any of the configured gateway:-

      /* All Required Parameters by your Gateway */
      
      $parameters = [
      
        'tid' => '1233221223322',
        
        'order_id' => '1232212',
        
        'amount' => '1200.00',
        
      ];
      
      // gateway = CCAvenue / PayUMoney / EBS / Citrus / InstaMojo
      
      $order = Indipay::gateway('NameOfGateway')->prepare($parameters);
      return Indipay::process($order);

Get the Response from the Gateway (Add the Code to the Redirect Url Set in the config file. Also add the response route to the remove_csrf_check config item to remove CSRF check on these routes.):-

 
    public function response(Request $request)
    
    {
        // For default Gateway
        $response = Indipay::response($request);
        
        // For Otherthan Default Gateway
        $response = Indipay::gateway('NameOfGatewayUsedDuringRequest')->response($request);

        dd($response);
    
    }  

indipay's People

Contributors

softon avatar

Watchers

Gaurav Jagad LL avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.