PHPackages                             pishran/zarinpal - 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. pishran/zarinpal

ActiveLibrary[Payment Processing](/categories/payments)

pishran/zarinpal
================

Zarinpal library for Laravel.

v4.3.7(1mo ago)4629.9k↓73.1%14[1 issues](https://github.com/pishran/Zarinpal/issues)MITPHPPHP ^7.2|^8.0CI failing

Since Jul 29Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/pishran/Zarinpal)[ Packagist](https://packagist.org/packages/pishran/zarinpal)[ Docs](https://github.com/pishran/zarinpal)[ RSS](/packages/pishran-zarinpal/feed)WikiDiscussions main Synced 1w ago

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

زرین پال | Zarinpal
===================

[](#زرین-پال--zarinpal)

Zarinpal library for Laravel based on Zarinpal API v4

کتابخانه زرین پال برای لاراول براساس نسخه 4 ای‌پی‌آی زرین پال

روش نصب - Installation
----------------------

[](#روش-نصب---installation)

Use composer to install this package

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

```
composer require pishran/zarinpal
```

تنظیمات - Configuration
-----------------------

[](#تنظیمات---configuration)

Add your merchant id to .env file

مرچنت کد خود را اضافه کنید

```
ZARINPAL_MERCHANT_ID=00000000-0000-0000-0000-000000000000
```

You can also define merchant id at runtime.

امکان تعیین مرچنت کد در حین اجرا نیز وجود دارد که در ادامه توضیح داده خواهد شد.

To change currency to Toman (Default)

برای تغییر واحد پول به تومان (مقدار پیشفرض)

```
ZARINPAL_CURRENCY=IRT
```

To change currency to Rial

برای تغییر واحد پول به ریال

```
ZARINPAL_CURRENCY=IRR
```

روش استفاده | How to use
------------------------

[](#روش-استفاده--how-to-use)

### ارسال مشتری به درگاه پرداخت | Send customer to payment gateway

[](#ارسال-مشتری-به-درگاه-پرداخت--send-customer-to-payment-gateway)

```
$response = zarinpal()
    ->merchantId('00000000-0000-0000-0000-000000000000') // تعیین مرچنت کد در حین اجرا - اختیاری
    ->amount(100) // مبلغ تراکنش
    ->request()
    ->description('transaction info') // توضیحات تراکنش
    ->callbackUrl('https://domain.com/verification') // آدرس برگشت پس از پرداخت
    ->mobile('09123456789') // شماره موبایل مشتری - اختیاری
    ->email('name@domain.com') // ایمیل مشتری - اختیاری
    ->send();

if (!$response->success()) {
    return $response->error()->message();
}

// ذخیره اطلاعات در دیتابیس
// $response->authority();

// هدایت مشتری به درگاه پرداخت
return $response->redirect();
```

### بررسی وضعیت تراکنش | Verify payment status

[](#بررسی-وضعیت-تراکنش--verify-payment-status)

```
$authority = request()->query('Authority'); // دریافت کوئری استرینگ ارسال شده توسط زرین پال
$status = request()->query('Status'); // دریافت کوئری استرینگ ارسال شده توسط زرین پال

$response = zarinpal()
    ->merchantId('00000000-0000-0000-0000-000000000000') // تعیین مرچنت کد در حین اجرا - اختیاری
    ->amount(100)
    ->verification()
    ->authority($authority)
    ->send();

if (!$response->success()) {
    return $response->error()->message();
}

// دریافت هش شماره کارتی که مشتری برای پرداخت استفاده کرده است
// $response->cardHash();

// دریافت شماره کارتی که مشتری برای پرداخت استفاده کرده است (بصورت ماسک شده)
// $response->cardPan();

// پرداخت موفقیت آمیز بود
// دریافت شماره پیگیری تراکنش و انجام امور مربوط به دیتابیس
return $response->referenceId();
```

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance92

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 75.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 ~123 days

Recently: every ~136 days

Total

21

Last Release

39d ago

Major Versions

v1.x-dev → v2.0.02020-02-01

v2.3 → v4.02021-06-06

v2.3.1 → v4.3.52025-02-24

PHP version history (4 changes)v1.0.0PHP &gt;=7.1.0

v2.1.0PHP ^7.1

v2.3PHP ^7.1|^8.0

v4.0PHP ^7.2|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8607021?v=4)[Farid Aghili](/maintainers/FaridAghili)[@FaridAghili](https://github.com/FaridAghili)

---

Top Contributors

[![FaridAghili](https://avatars.githubusercontent.com/u/8607021?v=4)](https://github.com/FaridAghili "FaridAghili (31 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![DenaSon](https://avatars.githubusercontent.com/u/34172621?v=4)](https://github.com/DenaSon "DenaSon (1 commits)")[![hosseinir4](https://avatars.githubusercontent.com/u/74095288?v=4)](https://github.com/hosseinir4 "hosseinir4 (1 commits)")[![MohammadZarifiyan](https://avatars.githubusercontent.com/u/55022827?v=4)](https://github.com/MohammadZarifiyan "MohammadZarifiyan (1 commits)")

---

Tags

laravelpaymentzarinpal

### Embed Badge

![Health badge](/badges/pishran-zarinpal/health.svg)

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

###  Alternatives

[larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

24753.9k](/packages/larabook-gateway)[evryn/laravel-toman

A simple stable Laravel package to handle popular payment gateways in Iran including ZarinPal and IDPay.

10710.2k](/packages/evryn-laravel-toman)[dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

312.4k1](/packages/dena-a-iran-payment)[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)
