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

ActiveLibrary[Payment Processing](/categories/payments)

abolfazlahmadiweb/laravel-zarinpal
==================================

Simple Laravel package for Zarinpal payment gateway.

v1.0.0(1mo ago)179↑33.3%MITPHPPHP ^8.2

Since Jul 9Pushed 1mo ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (2)Used By (0)

Laravel Zarinpal
================

[](#laravel-zarinpal)

A simple, lightweight and clean Laravel package for integrating the Zarinpal Payment Gateway.

Features
--------

[](#features)

- 🚀 Simple API
- ⚡ Laravel Auto Discovery
- 📦 Publishable configuration
- 🎯 Facade support
- 💉 Dependency Injection support
- 🧩 Laravel 12 &amp; 13 compatible
- 🛠️ Minimal and easy to maintain

---

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require abolfazlahmadiweb/laravel-zarinpal
```

---

Publish Configuration
---------------------

[](#publish-configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=zarinpal-config
```

---

Environment Variables
---------------------

[](#environment-variables)

Add the following variables to your `.env` file:

```
ZARINPAL_MERCHANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

ZARINPAL_SANDBOX=true

ZARINPAL_CURRENCY=IRT

ZARINPAL_MAX_AMOUNT=200000000

ZARINPAL_BASE_URL=https://sandbox.zarinpal.com/pg/v4/payment
```

---

Create Payment
--------------

[](#create-payment)

```
use AbolfazlAhmadi\LaravelZarinpal\Facades\Zarinpal;

$payment = Zarinpal::request(
    amount: 100000,
    description: 'Order #1001',
    callback: route('payment.callback'),
    mobile: '09123456789',
    email: 'user@example.com'
);

return redirect()->away($payment['url']);
```

Response:

```
[
    "authority" => "...",
    "url" => "...",
    "fee" => "...",
    "fee_amount" => ...
]
```

---

Verify Payment
--------------

[](#verify-payment)

```
use AbolfazlAhmadi\LaravelZarinpal\Facades\Zarinpal;

$result = Zarinpal::verify(
    authority: request('Authority'),
    amount: 100000
);
```

Response:

```
[
    "ref_id" => "...",
    "card_pan" => "...",
    "fee" => "...",
    "fee_type" => "..."
]
```

---

Using Dependency Injection
--------------------------

[](#using-dependency-injection)

```
use AbolfazlAhmadi\LaravelZarinpal\Services\ZarinpalService;

public function __construct(
    protected ZarinpalService $zarinpal
) {
}

$payment = $this->zarinpal->request(...);
```

---

Configuration
-------------

[](#configuration)

KeyDescriptionmerchant\_idZarinpal Merchant IDsandboxEnable Sandbox modecurrencyIRT or IRRmax\_amountMaximum payment amountbase\_urlZarinpal API URL---

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 12+
- Laravel 13+

---

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance90

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f7741c7650e4d510c4483d6e45e5d81a04cfdf77c513d8abaaca4fcd86c3877?d=identicon)[abolfazlahmadiweb](/maintainers/abolfazlahmadiweb)

---

Top Contributors

[![abolfazlahmadiweb](https://avatars.githubusercontent.com/u/75119096?v=4)](https://github.com/abolfazlahmadiweb "abolfazlahmadiweb (2 commits)")

---

Tags

laravelpaymentgatewayzarinpal

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)

PHPackages © 2026

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