Git Product home page Git Product logo

gateway's Introduction

package's home : larabook.ir

by this package we are able to connect to all Iranian bank with one unique API.

Please inform us once you've encountered bug or issue .

Available Banks:

  1. MELLAT
  2. SADAD (MELLI)
  3. SAMAN
  4. PARSIAN
  5. PASARGAD
  6. ZARINPAL
  7. JAHANPAY (Disabled)
  8. PAYLINE (Disabled)

Installation:

Run below statements on your terminal :

STEP 1 :

composer require larabook/gateway

STEP 2 : Add provider and facade in config/app.php

'providers' => [
  ...
  Larabookir\Gateway\GatewayServiceProvider::class, // <-- add this line at the end of provider array
],


'aliases' => [
  ...
  'Gateway' => Larabookir\Gateway\Gateway::class, // <-- add this line at the end of aliases array
]

Step 3:

php artisan vendor:publish --provider=Larabookir\Gateway\GatewayServiceProvider

Step 4:

php artisan migrate

Configuration file is placed in config/gateway.php , open it and enter your banks credential:

You can make connection to bank by several way (Facade , Service container):

try {
   
   $gateway = \Gateway::make(new \Mellat());
   // $gateway->setCallback(url('/path/to/calback/route')); You can also change the callback
   $gateway->price(1000)->ready();
   $refId =  $gateway->refId();
   $transID = $gateway->transactionId();

   // Your code here

   return $gateway->redirect();
   
} catch (Exception $e) {
   
   	echo $e->getMessage();
}

you can call the gateway by these ways :

  1. Gateway::make(new Mellat());
  2. Gateway::mellat()
  3. app('gateway')->make(new Mellat());
  4. app('gateway')->mellat();

Instead of MELLAT you can enter other banks Name as we introduced above .

In price method you should enter the price in IRR (RIAL)

and in your callback :

try { 
   
   $gateway = \Gateway::verify();
   $trackingCode = $gateway->trackingCode();
   $refId = $gateway->refId();
   $cardNumber = $gateway->cardNumber();
   
   // Your code here
   
} catch (Exception $e) {
   
   echo $e->getMessage();
}  

If you are intrested to developing this package you can help us by these ways :

  1. Improving documents.
  2. Reporting issue or bugs.
  3. Collaboration in writing codes and other banks modules.

This package is extended from PoolPort but we've changed some functionality and improved it .

gateway's People

Contributors

hpakdaman avatar honarkhah avatar erfansahaf avatar ahmad110 avatar alighasemzadeh-archived avatar mmehdibalouchi avatar anisi avatar akosalman avatar amirdew avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  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.