PHPackages                             farayaz/larapay - 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. farayaz/larapay

ActiveLibrary[Payment Processing](/categories/payments)

farayaz/larapay
===============

iranian online payment gateways

v1.30.1(3mo ago)205394MITPHPPHP ^8.1

Since Oct 25Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/farayaz/larapay)[ Packagist](https://packagist.org/packages/farayaz/larapay)[ Docs](https://github.com/farayaz/larapay)[ RSS](/packages/farayaz-larapay/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (79)Used By (0)

Larapay | لاراپِی
=================

[](#larapay--لاراپِی)

 [![GitHub Repo stars](https://camo.githubusercontent.com/ccafc5bfa6146cce37346da91915e727cf14c54aad2d017cc2cd55bfb9466638/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6661726179617a2f6c617261706179)](https://github.com/farayaz/larapay) [![Total Downloads](https://camo.githubusercontent.com/1f0cc70f780123de64afabf90d39740d502927b896f8520e7c046f06001b10e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6661726179617a2f6c617261706179)](https://packagist.org/packages/farayaz/larapay) [![Latest Stable Version](https://camo.githubusercontent.com/aa559ace28342785face2f2e2d92247fa0d80ac706677700bbbb7a45bc52a4cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6661726179617a2f6c617261706179)](https://packagist.org/packages/farayaz/larapay) [![License](https://camo.githubusercontent.com/a6033dacf55eaa3481c9c0f6ff6b93b869eaa2fe765e164645a286850fb7b011/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6661726179617a2f6c617261706179)](https://packagist.org/packages/farayaz/larapay)

Larapay is a Laravel package for integrating Iranian payment gateways. لاراپی یک پکیج لاراول برای اتصال به درگاه‌های پرداختی ایرانی است.

Gateways | درگاه‌ها
-------------------

[](#gateways--درگاه‌ها)

ClassName (en)Name (fa)Requirements**AsanPardakht**[AsanPardakht](https://asanpardakht.ir)آسان پرداخت (آپ)‍`username`, `password`, `merchant_configuration_id`**Azkivam**[Azkivam](https://azkivam.com/)ازکی وام`merchant_id`, `api_key`**BehPardakht**[Beh Pardakht Mellat](https://behpardakht.com)به‌پرداخت ملت`terminal_id`, `username`, `password`, `is_credit`**Bitpay**[Bitpay](https://bitpay.ir/)بیت پی`api`, `sandbox`**Digipay**[Digipay](https://www.mydigipay.com)دیجی‌پی`username`, `password`, `client_id`, `client_secret`**ECD**[Electronic Card Damavand](https://ecd-co.ir)پرداخت الکترونیک دماوند`terminal_number`, `hash_key`**FanavaCard**[FanavaCard](https://fanavacard.ir)فن‌آوا کارت`user_id`, `password`**IdPay**[IdPay](https://idpay.ir)آیدی‌پی`apiKey`, `sandbox`**IranDargah**[IranDargah](https://irandargah.com)ایران درگاه`merchant_id`, `sandbox`**IranKish**[Iran Kish](https://www.irankish.com)ایران کیش`terminalId`, `password`, `acceptorId`, `pubKey`**IsipaymentSamin**[Isipayment Samin](https://isipayment.ir)ایزایران ثمین`merchant_code`, `merchant_password`, `terminal_code`, `type`, `number_of_installment`**Keepa**[Keepa - Kipaa](https://keepa.ir)کیپا`token`**MehrIran**[MehrIran](https://qmb.ir)بانک مهر ایران`terminal_id`, `merchant_nid`, `encrypt_key`**NextPay**[NextPay](https://nextpay.org)نکست پی`api_key`**Omidpay**[Omidpay - Sayan Card](https://omidpayment.ir)امید پی (سایان کارت)`user_id`, `password`**PardakhtNovin**[Pardakht Novin](https://pna.co.ir)پرداخت نوین`userId`, `password`, `terminalId`**Payir**[Pay.ir](https://www.pay.ir)پی.آی‌آر`api`**PayPing**[PayPing](https://payping.ir)پی پینگ`token`**PEC**[PEC](https://pec.ir)تجارت الکترونیک پارسیان`login_account`**PEP**[PEP](https://pep.co.ir)پرداخت الکترونیک پاسارگاد`username`, `password`, `terminal_number`**Polam**[Polam(Poolam)](https://polam.io)پولام`api_key`**RefahBeta**[Refah Beta](https://beta.refah-bank.ir)بانک رفاه بتا`client_id` , `client_secret`, `api_key`, `number_of_installments`**Sadad**[Sadad](https://sadadpsp.ir)پرداخت الکترونیک سداد (ملی)`terminal_id`, `merchant_id`, `key`**SadadBNPL**[SadadBNPL](https://sadadpsp.ir)پرداخت الکترونیک سداد (ملی)`terminal_id`, `merchant_id`, `key`**Sep**[Saman Electronic Payment](https://www.sep.ir)پرداخت الکترونیک سامان (سپ)`terminalId`**Sepal**[Sepal](https://sepal.ir)سپال`api_key`**SepehrPay**[Sepehr Pay](https://www.sepehrpay.com)پرداخت الکترونیک سپهر (مبنا)`terminalId`**Shepa**[Shepa](https://shepa.com)شپا`api`**SnappPay**[SnappPay](https://snapppay.ir)اسنپ‌پی`username`, `password`, `client_id`, `client_secret`**TabaPay**[TabaPay](https://tabapay.ir)تاباپی`token`**TejaratBajet**[Tejarat Bajet](https://mybajet.ir)بانک تجارت - باجت`client_id`, `client_secret`, `sandbox`🧪 **Test****Test****تست**برای تست**Vandar**[Vandar](https://vandar.io)وندار`api_key`**ZarinPal**[Zarin Pal](https://www.zarinpal.com)زرین پال`merchant_id`**Zibal**[Zibal](https://zibal.ir)زیبال`merchant`If you don't find the gateway you want, let us know or contribute to add it

---

اگر درگاه مورد نظر خود را پیدا نکردید، به ما اطلاع دهید یا در اضافه کردن آن مشارکت کنید

Benefits | مزایا
----------------

[](#benefits--مزایا)

- Simple | ساده
- Flexibility | انعطاف‌پذیری
- Fee Calculation | محاسبه هزینه تراکنش

Install | نصب
-------------

[](#install--نصب)

You can install the package via composer:

شما می‌توانید با استفاده از composer پکیج را نصب کنید

```
composer require farayaz/larapay
```

Usage | استفاده
---------------

[](#usage--استفاده)

To make the payment, 3 steps must be done:

برای انجام پرداخت ۳ مرحله می‌بایست انجام شود:

### Step 1: get token | مرحله ۱: دریافت توکن

[](#step-1-get-token--مرحله-۱-دریافت-توکن)

```
use Farayaz\Larapay\Exceptions\LarapayException;
use Larapay;

$gatewayClass = 'ZarinPal';
$gatewayConfig = [ // gateway config | تنظیمات درگاه
    'merchant_id' => 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
];

$amount = 10000;
$id = 1230; // transaction id | شماره تراکنش
$callbackUrl = route('api.transactions.verify', $id);
$nationalId = '1234567890';
$mobile = '09131234567';
$allowedCards = [ // شماره کارت‌های مجاز (در صورت پشتیبانی درگاه)
    '6037991199500590'
];

try {
    $result = Larapay::gateway($gatewayClass, $gatewayConfig)
        ->request(
            id: $id,
            amount: $amount,
            callbackUrl: $callbackUrl,
            nationalId: $nationalId,
            mobile: $mobile,
            // allowedCards: $allowedCards,
        );
} catch (LarapayException $e) {
    throw $e;
}

// store token in db | ذخیره توکن در دیتابیس
$result['token'];
$result['fee'];
```

### Step 2: redirect | مرحله ۲: ریدایرکت

[](#step-2-redirect--مرحله-۲-ریدایرکت)

Transfer the user to gateway with the received token:

انتقال کاربر به درگاه با توکن دریافت شده:

```
try {
    return Larapay::gateway($gatewayClass, $gatewayConfig)
        ->redirect($id, $token, $callbackUrl);
} catch (LarapayException $e) {
    throw $e;
}
```

### Step 3: verify | مرحله ۳: تایید

[](#step-3-verify--مرحله-۳-تایید)

Checking the payment status after the user returns from the gateway:

بررسی وضعیت پرداخت پس از بازگشت کاربر از درگاه:

```
$params = $request->all();
try {
    $result = Larapay::gateway($gatewayClass, $gatewayConfig)
        ->verify(
            id: $id,
            amount: $amount,
            token: $token,
            params: $params
        );
} catch (LarapayException $e) {
    // transaction failed | تراکنش ناموفق
    throw $e;
}

// transaction verified | تراکنش موفق
$result['result'];
$result['reference_id'];
$result['tracking_code'];
$result['card'];
$result['fee'];
```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance82

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 97.4% 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 ~11 days

Recently: every ~34 days

Total

77

Last Release

98d ago

PHP version history (2 changes)v1.1.1PHP ^8.0

v1.14.2PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![mehrdadx10](https://avatars.githubusercontent.com/u/4258955?v=4)](https://github.com/mehrdadx10 "mehrdadx10 (187 commits)")[![rezakhademix](https://avatars.githubusercontent.com/u/70235203?v=4)](https://github.com/rezakhademix "rezakhademix (5 commits)")

---

Tags

payment

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/farayaz-larapay/health.svg)

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M531](/packages/laravel-passport)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

71510.9M66](/packages/laravel-mcp)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[bref/laravel-bridge

An advanced Laravel integration for Bref, including Octane support.

3384.1M11](/packages/bref-laravel-bridge)

PHPackages © 2026

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