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

AbandonedArchivedLibrary

rez0sk/laravel-zarinpal
=======================

Laravel package for Zarinpal payment gateway.

027[1 issues](https://github.com/rez0sk/laravel-zarinpal/issues)PHP

Since Apr 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/rez0sk/laravel-zarinpal)[ Packagist](https://packagist.org/packages/rez0sk/laravel-zarinpal)[ RSS](/packages/rez0sk-laravel-zarinpal/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-zarinpal
================

[](#laravel-zarinpal)

[![Build Status](https://camo.githubusercontent.com/f1ed0f21e8987f36f6994911da19df180b2dbc2428d13a64cfa6f0033be30099/68747470733a2f2f7472617669732d63692e636f6d2f72657a30736b2f6c61726176656c2d7a6172696e70616c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/rez0sk/laravel-zarinpal)[![codecov](https://camo.githubusercontent.com/92cb1a07f828563f627e30d90fccd9ad8cd94c78373bd2adb4dbd2ac04cfc10d/68747470733a2f2f636f6465636f762e696f2f67682f72657a30736b2f6c61726176656c2d7a6172696e70616c2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/rez0sk/laravel-zarinpal)[![StyleCI](https://camo.githubusercontent.com/c34f4d7b5dd18d5d6cdafa0db2515140650db6b845dbea9c3ffeab8177672a3d/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3137393639383431332f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/179698413)

Laravel package for Zarinpal payment gateway.

This package provides an interface (a laravel facade) that you can easily use and mock!

Features
--------

[](#features)

- Mockability
- Dynamic MerchantID
- Supporting zarinpal's sandbox

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

[](#installation)

```
composer require rez0sk/laravel-zarinpal

```

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

[](#configuration)

In your `config/services.php` file add this config:

```
'zarinpal' => [
        'merchant_id' => env('ZARINPAL_MERCHANT_ID'),
        'description' => 'Default description' // optional
]
```

then add `ZARINPAL_MERCHANT_ID` to your `.env` file.

#### Sandbox mode (Optional)

[](#sandbox-mode-optional)

It's recomanded to enable sandbox mode in `local` environment.

If you wan't to do so, add these lines to your `AppServiceProvider` class's `boot` function.

```
public function boot()
{
    if ($this->app->isLocal()) {
        Zarinpal::enableSandbox();
    }
}
```

Usage
-----

[](#usage)

Simply issue a payment-request and redirect user to Zarinpal with one shot!

```
use Zarinpal\Facades\Zarinpal;
...

public function someControllerFunction ()
{
    return Zarinpal::pay(2000, route('paymnet.verify', $order->id))->redirect();
}
```

Or retrieve Authority code and redirect manually:

```
Zarinpal::pay(2000, 'http://callback.url/id')->payment->authority
```

There are some additional information you can provide for payment:

```
Zarinpal::pay(2000, 'http://callback.url/id', [
        'description' => 'This is such a dummy order!',
        'email' => 'User's email address',
        'phone' => 'User's phone number'
]);
```

#### Dynamic MerchantID

[](#dynamic-merchantid)

You can dynamically set MerchantID before each payment:

```
Zarinpal::setMerchantID('xxxxx-xxxx-xxx');
Zarinpal::pay(...)
```

### Payment Verification

[](#payment-verification)

```
public function verifyOrderPayment (Order $order, Request $request)
{
    $result = Zarinpal::verify($request, $order->TotalPrice);

    $result->status //Status code. 100 means success :)
    $result->RefID //Payment's unique ReferenceID
    $result->amount // Payment's amount in Tuman. (Always use Toman with Zarinpal)
    $result->description //Payment's description.
}
```

### TODO

[](#todo)

- CI setup.
- Adding examples.
- Improve tests.
- Support wages.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1bc6f7e8533bfe553d65d8817279c69e9030ff5bcd74fe3a171f782f6d0716d8?d=identicon)[reza-askari](/maintainers/reza-askari)

---

Top Contributors

[![rezsk](https://avatars.githubusercontent.com/u/34791944?v=4)](https://github.com/rezsk "rezsk (29 commits)")

---

Tags

laravel

### Embed Badge

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

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

PHPackages © 2026

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