PHPackages                             hosseinizadeh/gateway - 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. hosseinizadeh/gateway

ActiveLibrary[Payment Processing](/categories/payments)

hosseinizadeh/gateway
=====================

A Laravel package for connecting to all Iranian bank and Paypal with one unique API.

1.0.40(1y ago)51641MITPHP

Since May 21Pushed 1y agoCompare

[ Source](https://github.com/hosseinizadeh/gateway)[ Packagist](https://packagist.org/packages/hosseinizadeh/gateway)[ Docs](https://github.com/hosseinizadeh/gateway)[ RSS](/packages/hosseinizadeh-gateway/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (2)Versions (39)Used By (0)

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

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

Please inform us once you've encountered [bug](https://github.com/hosseinizadeh/gateway/issues) or [issue](https://github.com/hosseinizadeh/gateway/issues) .

Available Banks:

1. MELLAT
2. SADAD (MELLI)
3. SAMAN
4. PARSIAN
5. PASARGAD
6. ZARINPAL
7. PAYPAL
8. ASAN PARDAKHT
9. PAY.IR (to use : new \\Payir())
10. YEKPAY
11. NOVIN (EGHTESADEH NOVIN) (**New**)

---

**Installation**:

Run below statements on your terminal :

STEP 1 :

```
composer require hosseinizadeh/gateway

```

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

```
'providers' => [
  ...
  Hosseinizadeh\Gateway\GatewayServiceProvider::class, //  [
  ...
  'Gateway' => Hosseinizadeh\Gateway\Gateway::class, // 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());
2. Gateway::mellat()
3. app('gateway')-&gt;make(new Mellat());
4. app('gateway')-&gt;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();

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

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

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

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

} catch (\Exception $e) {

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

```

for yekpay you can use like this:

```
    try {
        $gateway = Gateway::yekpay();

        /// can check country return true or false
        $gateway->checkip(\request()->ip());

        /// can get exchange currency
        $exchange = $gateway->exchange(978,364);

        $gateway->setCallback(route('bank.callback'));
        $gateway->setFrom(364);
        $gateway->setTo(364);
        $gateway->setFname('ftest');
        $gateway->setLname('ltest');
        $gateway->setEmail('test@gmail.com');
        $gateway->setMobile('+44123456789');
        $gateway->setAddress('address');
        $gateway->setPostalcode('9656789');
        $gateway->setCountry('iran');
        $gateway->setCity('tehran');
        $gateway->setDescription('description');
        $gateway->price(10000)->ready(10000);
        $refId = $gateway->refId();
        $transID = $gateway->transactionId();

        $payurl = $gateway->payurl();

        return redirect($payurl);

    } catch (YekpayException $e) {
        $message = $e->getMessage();
        dd($message);
    }

```

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 .

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 58% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~55 days

Recently: every ~19 days

Total

37

Last Release

539d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e43f8fbfdb8eafcb089d42abd0cb1954470fae2d7ce6a0744f3a28996d1da38?d=identicon)[hosseinizadeh](/maintainers/hosseinizadeh)

---

Top Contributors

[![hpakdaman](https://avatars.githubusercontent.com/u/9606809?v=4)](https://github.com/hpakdaman "hpakdaman (153 commits)")[![hosseinizadeh](https://avatars.githubusercontent.com/u/26816720?v=4)](https://github.com/hosseinizadeh "hosseinizadeh (42 commits)")[![honarkhah](https://avatars.githubusercontent.com/u/904829?v=4)](https://github.com/honarkhah "honarkhah (14 commits)")[![amirdew](https://avatars.githubusercontent.com/u/1938899?v=4)](https://github.com/amirdew "amirdew (10 commits)")[![amiriun](https://avatars.githubusercontent.com/u/5228893?v=4)](https://github.com/amiriun "amiriun (7 commits)")[![shahriyaaar](https://avatars.githubusercontent.com/u/24561816?v=4)](https://github.com/shahriyaaar "shahriyaaar (6 commits)")[![imanghafoori1](https://avatars.githubusercontent.com/u/6961695?v=4)](https://github.com/imanghafoori1 "imanghafoori1 (6 commits)")[![akoSalman](https://avatars.githubusercontent.com/u/17239230?v=4)](https://github.com/akoSalman "akoSalman (6 commits)")[![erfansahaf](https://avatars.githubusercontent.com/u/12012168?v=4)](https://github.com/erfansahaf "erfansahaf (4 commits)")[![vahidalvandi](https://avatars.githubusercontent.com/u/7871623?v=4)](https://github.com/vahidalvandi "vahidalvandi (2 commits)")[![alighasemzadeh-archived](https://avatars.githubusercontent.com/u/85446576?v=4)](https://github.com/alighasemzadeh-archived "alighasemzadeh-archived (2 commits)")[![mohammad6006](https://avatars.githubusercontent.com/u/553379?v=4)](https://github.com/mohammad6006 "mohammad6006 (2 commits)")[![Ahmad110](https://avatars.githubusercontent.com/u/10651421?v=4)](https://github.com/Ahmad110 "Ahmad110 (2 commits)")[![mahdi4187](https://avatars.githubusercontent.com/u/25785927?v=4)](https://github.com/mahdi4187 "mahdi4187 (1 commits)")[![mbpcoder](https://avatars.githubusercontent.com/u/3877538?v=4)](https://github.com/mbpcoder "mbpcoder (1 commits)")[![mehrdadx10](https://avatars.githubusercontent.com/u/4258955?v=4)](https://github.com/mehrdadx10 "mehrdadx10 (1 commits)")[![Anisi](https://avatars.githubusercontent.com/u/7829372?v=4)](https://github.com/Anisi "Anisi (1 commits)")[![Pezhvak](https://avatars.githubusercontent.com/u/3134479?v=4)](https://github.com/Pezhvak "Pezhvak (1 commits)")[![saeedsajadi](https://avatars.githubusercontent.com/u/3465334?v=4)](https://github.com/saeedsajadi "saeedsajadi (1 commits)")[![eamirgh](https://avatars.githubusercontent.com/u/14164441?v=4)](https://github.com/eamirgh "eamirgh (1 commits)")

---

Tags

laravelportpaymentgatewaypaypalBankpayiranzarinpalPaylineshaparaksamanMelimellatpasargadparsiansadadjahanpayasan pardakhtpardakhtdargahiranian-bankspersian-bankspoolportipaypay-iryekpay

### Embed Badge

![Health badge](/badges/hosseinizadeh-gateway/health.svg)

```
[![Health](https://phpackages.com/badges/hosseinizadeh-gateway/health.svg)](https://phpackages.com/packages/hosseinizadeh-gateway)
```

###  Alternatives

[larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

24553.7k](/packages/larabook-gateway)[parsisolution/gateway

A Laravel package for connecting to all Iraninan payment gateways

231.7k](/packages/parsisolution-gateway)[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
