Git Product home page Git Product logo

ipay's Introduction

iPay Package

Build Status downloads Issues Release


About

uisits/ipay is package for ipay payment gateway. Please refer to the inter departmental iPay reference guide to get more details.

iPAY Departmental Reference Guide


Installation Guide


  • Note
    • Before installing this package make sure you install the following packages
    1. nesbot/carbon
      composer require nesbot/carbon
      
    2. guzzlehttp\guzzle
      composer require guzzlehttp/guzzle
      

Installation Steps

  1. Run

    composer require uisits/ipay
    
  2. Add Service Provider to your config/app.php

    uisits\ipay\IpayServiceProvider::class,
    

    Alternatively Add a Facade to your config/app.php (Under aliases array)

    'Ipay' => uisits\ipay\app\Facade\IpayFacade::class,
    
  3. Publish the resources

    php artisan vendor:publish
    
  4. Migrate the database

    php artisan migrate
    
  5. Edit the config/ipay.php file

  6. In your Controller to Send a payment write following code

    use uisits\ipay\app\Http\Controllers\IpayController as ipay;
    
    $ipay = new ipay();
    $redirect_url = $ipay->initiatePayment($amount);
    
    If you need to save the transaction details in another table you can fetch the latest transaction from the Ipay table and insert the records in the new table.
    
    Validate Url then send redirect away
    
    For Ex:
    if(\filter_var($redirect_url,FILTER_VALIDATE_URL)){
        return redirect()->away($redirect_url);
    }
    
    

    OR Alternatively using Facade

    use Ipay;
    
    $redirect_url = Ipay::initiatePayment($amount);
    
    Validate Url then send redirect away
    
    If you need to save the transaction details in another table you can fetch the latest transaction from the Ipay table and insert the records in the new table.
    
    For Ex:
    if(\filter_var($redirect_url,FILTER_VALIDATE_URL)){
        return redirect()->away($redirect_url);
    }
    
  7. To Capture the payment send the request from ipay server which is mapped to your application

    $ipay->capturePayment($request);
    

    Or Using Facade

    Ipay::capturePayment($request);
    

    The capturePayment() function returns true or throws error.


Docs

  1. initiatePayment()

    Info: Initiate the Payment Request with Ipay Server Parameters: float $amount return: string URL to redirect to Ipay server for payment form

  2. capturePayment()

    Info: Send a Capture Request to Ipay Server Parameters: HTTP $request with TOKEN from iPay Server return: boolean true Successful transaction | throw error for Failed transaction


Running Tests

Note: 1. You require .env.example file with all necessary parameters for iPay to work. These parameters can be found in the Interdepartmental Ipay Guide listed above. Please copy the .env.example file to vendor/uisits/ipay/.env.example path. 2. Please run composer install to install all dependencies including --dev dependencies 3. Navigate to vendor/uisits/ipay and run phpunit


TODO

  • Option for user to save transaction to Database or not
  • Add Costs to Table

ipay's People

Contributors

chinwalprasad avatar dependabot[bot] avatar

Watchers

 avatar  avatar

ipay's Issues

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.