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

ActiveLibrary[Payment Processing](/categories/payments)

miladk313/gateway
=================

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

23PHP

Since Jul 4Pushed 1y ago3 watchersCompare

[ Source](https://github.com/miladk313/gateway)[ Packagist](https://packagist.org/packages/miladk313/gateway)[ RSS](/packages/miladk313-gateway/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (6)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 (update from new documents)
9. PAY.IR (to use : new \\Payir())
10. YEKPAY (**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

20

—

LowBetter than 13% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7e86b63d56d4cee06d39fe1ff889722e44ec5dd33a0cffba80e6fb9596be991?d=identicon)[miladk313](/maintainers/miladk313)

---

Top Contributors

[![miladk313](https://avatars.githubusercontent.com/u/33084317?v=4)](https://github.com/miladk313 "miladk313 (8 commits)")[![soroosh-e](https://avatars.githubusercontent.com/u/14157656?v=4)](https://github.com/soroosh-e "soroosh-e (6 commits)")[![ho3inmoradiii](https://avatars.githubusercontent.com/u/76064596?v=4)](https://github.com/ho3inmoradiii "ho3inmoradiii (3 commits)")

### Embed Badge

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

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

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18579.5k1](/packages/omnipay-coinbase)[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.2k](/packages/msilabs-bkash)[binkode/laravel-paystack

A description for laravel-paystack.

112.1k](/packages/binkode-laravel-paystack)

PHPackages © 2026

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