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

ActiveLibrary[Payment Processing](/categories/payments)

imerit-pro/gateway
==================

A Laravel package for connecting to all Saman payment gateway

v4.5.3(6y ago)033MITPHP

Since May 2Pushed 6y agoCompare

[ Source](https://github.com/imerit-pro/gateway)[ Packagist](https://packagist.org/packages/imerit-pro/gateway)[ Docs](https://github.com/imerit-pro/gateway)[ RSS](/packages/imerit-pro-gateway/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (4)Dependencies (2)Versions (46)Used By (0)

پکیج اتصال به بانک سامان و paypal

این پکیج با ورژن های ( 6,7 ) لاراول سازگار می باشد

پشتیبانی تنها از درگاهای زیر می باشد:

1. SAMAN
2. PAYPAL

---

**نصب**:

دستورات زیر را جهت نصب دنبال کنید :

**مرحله ۱)**

```
composer require imerit-pro/gateway
```

**مرحله ۲) - انتقال فایل های مورد نیاز**

برای لاراول ۶ به بعد :

```
php artisan vendor:publish

// then choose : GatewayServiceProviderLaravel6
```

**مرحله ۳) - ایجاد جداول**

```
php artisan migrate
```

**مرحله ۴)**

عملیات نصب پایان یافته است حال فایل gateway.php را در مسیر app/ باز نموده و تنظیمات مربوط به درگاه بانکی مورد نظر خود را در آن وارد نمایید .

حال میتوایند برای اتصال به api بانک از یکی از روش های زیر به انتخاب خودتان استفاده نمایید . (Facade , Service container):

1. Gateway::make(new Smana())
2. Gateway::make('saman')
3. Gateway::saman()
4. app('gateway')-&gt;make(new Saman());
5. app('gateway')-&gt;saman();

مثال :‌اتصال به بانک ملت (درخواست توکن و انتقال کاربر به درگاه بانک) توجه :‌ مقدار متد price به ریال وارد شده است و معادل یکصد تومان می باشد

یک روت از نوع GET با آدرس /bank/request ایجاد نمایید و کد های زیر را در آن قرار دهید .

```
try {

   $gateway = \Gateway::make('saman');

   $gateway->setCallback(url('/bank/response')); // 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();
}
```

و سپس روت با مسیر /bank/response و از نوع post ایجاد نمایید و کد های زیر را در آن قرار دهید :

```
try {

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

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

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

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

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

} catch (\Exception $e) {

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

در صورت تمایل جهت همکاری در توسعه :

1. توسعه مستندات پکیج.
2. گزارش باگ و خطا.
3. همکاری در نوشتن ماژول دیگر بانک ها برای این پکیج .

درصورت بروز هر گونه [باگ](https://github.com/imeirt-pro/gateway/issues) یا [خطا](https://github.com/imeirt-pro/gateway/issues) . ما را آگاه سازید .

این پکیج از پکیج دیگری بنام larabook/gateway مشتق شده است

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 70.6% 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 ~34 days

Recently: every ~44 days

Total

44

Last Release

2206d ago

Major Versions

1.2 → 2.02016-05-04

2.9.9 → 3.02016-12-27

v3.5.2 → v4.5.32020-05-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/8aa107aad46310f625cf7aa5938d8d752a924a0f9c379884159d7ab11d1cfab5?d=identicon)[medga](/maintainers/medga)

---

Top Contributors

[![hpakdaman](https://avatars.githubusercontent.com/u/9606809?v=4)](https://github.com/hpakdaman "hpakdaman (219 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)")[![medga](https://avatars.githubusercontent.com/u/2234163?v=4)](https://github.com/medga "medga (8 commits)")[![amiriun](https://avatars.githubusercontent.com/u/5228893?v=4)](https://github.com/amiriun "amiriun (7 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)")[![mohammad-chavoshipor](https://avatars.githubusercontent.com/u/12573801?v=4)](https://github.com/mohammad-chavoshipor "mohammad-chavoshipor (4 commits)")[![erfansahaf](https://avatars.githubusercontent.com/u/12012168?v=4)](https://github.com/erfansahaf "erfansahaf (4 commits)")[![mahdi4187](https://avatars.githubusercontent.com/u/25785927?v=4)](https://github.com/mahdi4187 "mahdi4187 (3 commits)")[![Ahmad110](https://avatars.githubusercontent.com/u/10651421?v=4)](https://github.com/Ahmad110 "Ahmad110 (2 commits)")[![alighasemzadeh-archived](https://avatars.githubusercontent.com/u/85446576?v=4)](https://github.com/alighasemzadeh-archived "alighasemzadeh-archived (2 commits)")[![bluemmb](https://avatars.githubusercontent.com/u/7195720?v=4)](https://github.com/bluemmb "bluemmb (2 commits)")[![jyarali](https://avatars.githubusercontent.com/u/25876572?v=4)](https://github.com/jyarali "jyarali (2 commits)")[![mhndev](https://avatars.githubusercontent.com/u/5164182?v=4)](https://github.com/mhndev "mhndev (2 commits)")[![mohammad6006](https://avatars.githubusercontent.com/u/553379?v=4)](https://github.com/mohammad6006 "mohammad6006 (2 commits)")[![mostafaznv](https://avatars.githubusercontent.com/u/7619687?v=4)](https://github.com/mostafaznv "mostafaznv (2 commits)")[![psobhanlo](https://avatars.githubusercontent.com/u/12683937?v=4)](https://github.com/psobhanlo "psobhanlo (2 commits)")[![saeedsajadi](https://avatars.githubusercontent.com/u/3465334?v=4)](https://github.com/saeedsajadi "saeedsajadi (2 commits)")[![vahidalvandi](https://avatars.githubusercontent.com/u/7871623?v=4)](https://github.com/vahidalvandi "vahidalvandi (2 commits)")

---

Tags

laravelportpaymentgatewaypaypalBankpayiransaman

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/imerit-pro-gateway/health.svg)](https://phpackages.com/packages/imerit-pro-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)

PHPackages © 2026

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