2017 © Pedro Peláez
 

library gateway

Connect to Iran payment gateways through PHP(laravel).

image

ako/gateway

Connect to Iran payment gateways through PHP(laravel).

  • Tuesday, July 24, 2018
  • by ako
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 43 % Grown

The README.md

Attention: This package is a fork of Larabook-Gateway, There was some esenssial changes that owners of the original package did not accept in my pull requests, so i implemented that changes on this repo., (*1)

by this package we are able to connect to all Iranian bank with one unique API., (*2)

( This Package is now compatible with both 4.* and 5.* versions of Laravel ), (*3)

Please inform us once you've encountered bug or issue ., (*4)

Available Banks: 1. MELLAT 2. SADAD (MELLI) 3. SAMAN 4. PARSIAN 5. PASARGAD 6. ZARINPAL 7. PAYPAL (New) 8. ASAN PARDAKHT (New), (*5)

9. PAY.IR (New)

Installation:, (*6)

Run below statements on your terminal :, (*7)

STEP 1 :, (*8)

composer require ako/gateway

STEP 2 : Add provider and facade in config/app.php, (*9)

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


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

Step 3:, (*10)

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

Step 4:, (*11)

php artisan migrate

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

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

try {

   $gateway = \Gateway::make(new \Mellat());

   // $gateway->setCallback(url('/path/to/callback/route')); You can also change the callback
   $gateway
        ->price(1000)
        // setShipmentPrice(10) // optional - just for paypal
        // setProductName("My Product") // optional - just for paypal
        ->ready();

   $refId =  $gateway->refId(); // شماره ارجاع بانک
   $transID = $gateway->transactionId(); // شماره تراکنش

  // در اینجا
  //  شماره تراکنش  بانک را با توجه به نوع ساختار دیتابیس تان 
  //  در جداول مورد نیاز و بسته به نیاز سیستم تان
  // ذخیر کنید .

   return $gateway->redirect();

} catch (\Exception $e) {

    echo $e->getMessage();
}

you can call the gateway by these ways : 1. Gateway::make(new Mellat()); 1. Gateway::mellat() 2. app('gateway')->make(new Mellat()); 3. app('gateway')->mellat();, (*14)

Instead of MELLAT you can enter other banks Name as we introduced above ., (*15)

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

and in your callback :, (*17)

try { 

   $gateway = \Gateway::verify();
   $trackingCode = $gateway->trackingCode();
   $refId = $gateway->refId();
   $cardNumber = $gateway->cardNumber();

    // تراکنش با موفقیت سمت بانک تایید گردید
    // در این مرحله عملیات خرید کاربر را تکمیل میکنیم

} catch (\Ako\Gateway\Exceptions\RetryException $e) {

    // تراکنش قبلا سمت بانک تاییده شده است و
    // کاربر احتمالا صفحه را مجددا رفرش کرده است
    // لذا تنها فاکتور خرید قبل را مجدد به کاربر نمایش میدهیم

    echo $e->getMessage() . "<br>";

} catch (\Exception $e) {

    // نمایش خطای بانک
    echo $e->getMessage();
}  

If you are intrested to developing this package you can help us by these ways :, (*18)

  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 ., (*19)

The Versions

24/07 2018

dev-master

9999999-dev https://github.com/akoSalman/payment

Connect to Iran payment gateways through PHP(laravel).

  Sources   Download

MIT

The Requires

 

by Hamed Pakdaman
by Amir Khorsandi
by Ako Salman

laravel payment pay gateway paypal bank iran zarinpal payline port saman meli ipay shaparak pardakht dargah mellat pasargad parsian sadad jahanpay iranian-banks persian-banks poolport asan-pardakht pay-ir next-pay

16/04 2018

0.2

0.2.0.0 https://github.com/larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

  Sources   Download

MIT

The Requires

 

by Hamed Pakdaman
by Amir Khorsandi
by Ako Salman

laravel payment pay gateway paypal bank iran zarinpal payline port saman meli ipay shaparak pardakht dargah mellat pasargad parsian sadad jahanpay iranian-banks persian-banks poolport asan-pardakht pay-ir

16/04 2018

0.1

0.1.0.0 https://github.com/larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

  Sources   Download

MIT

The Requires

 

by Hamed Pakdaman
by Amir Khorsandi

laravel payment pay gateway paypal bank iran zarinpal payline port saman meli ipay shaparak pardakht dargah mellat pasargad parsian sadad jahanpay iranian-banks persian-banks poolport asan-pardakht pay-ir

16/04 2018

dev-dev

dev-dev https://github.com/larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

  Sources   Download

MIT

The Requires

 

by Hamed Pakdaman
by Amir Khorsandi

laravel payment pay gateway paypal bank iran zarinpal payline port saman meli ipay shaparak pardakht dargah mellat pasargad parsian sadad jahanpay iranian-banks persian-banks poolport asan-pardakht pay-ir