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

ActiveLibrary[Payment Processing](/categories/payments)

nekofar/omnipay-zarinpal
========================

ZarinPal driver for the Omnipay PHP payment processing library

v2.0.1(2y ago)134661[7 PRs](https://github.com/nekofar/omnipay-zarinpal/pulls)MITPHPPHP &gt;=8.1

Since Aug 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nekofar/omnipay-zarinpal)[ Packagist](https://packagist.org/packages/nekofar/omnipay-zarinpal)[ Docs](https://github.com/nekofar/omnipay-zarinpal)[ Fund](https://unstoppabledomains.com/d/nekofar.crypto)[ GitHub Sponsors](https://github.com/nekofar)[ RSS](/packages/nekofar-omnipay-zarinpal/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (16)Versions (30)Used By (0)

Omnipay: ZarinPal
=================

[](#omnipay-zarinpal)

**ZarinPal driver for the Omnipay PHP payment processing library**

[![Packagist Version](https://camo.githubusercontent.com/e3a1e357930430ffd71edb1d75fc78b87bd68a8038e2e0e006fe8c0f38ed4508/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e656b6f6661722f6f6d6e697061792d7a6172696e70616c2e737667)](https://packagist.org/packages/nekofar/omnipay-zarinpal)[![PHP from Packagist](https://camo.githubusercontent.com/96d3630f2b3705a150b61aff2559368d188502cf14692b4377eede3cc5b65e69/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6e656b6f6661722f6f6d6e697061792d7a6172696e70616c2e737667)](https://packagist.org/packages/nekofar/omnipay-zarinpal)[![Packagist Downloads](https://camo.githubusercontent.com/fcdd3334056dc937ed230c0a351223b9bc99d8c0d83641c34ff92ba7b72bf882/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e656b6f6661722f6f6d6e697061792d7a6172696e70616c)](https://packagist.org/packages/nekofar/omnipay-zarinpal)[![Tests Status](https://camo.githubusercontent.com/05da41a6c66de50805ce6382ad79090820ea60a4939063b7dd6a100c316c80a8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e656b6f6661722f6f6d6e697061792d7a6172696e70616c2f74657374732e796d6c)](https://github.com/nekofar/omnipay-zarinpal/actions/workflows/tests.yml)[![Coverage Status](https://camo.githubusercontent.com/41929ae893ad1c4f0dbfcdb21a02bef8dd7196c709e93a4dbdc6034d3f5eaad5/68747470733a2f2f636f6465636f762e696f2f67682f6e656b6f6661722f6f6d6e697061792d7a6172696e70616c2f67726170682f62616467652e737667)](https://codecov.io/gh/nekofar/omnipay-zarinpal)[![License](https://camo.githubusercontent.com/49f84011d1b2f68dd145de88df553120f4b77c1bb1162c57be532fa812e9ab7d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e656b6f6661722f6f6d6e697061792d7a6172696e70616c2e737667)](https://github.com/nekofar/omnipay-zarinpal/blob/master/LICENSE.md)[![Twitter: nekofar](https://camo.githubusercontent.com/57201a0ecd7d9a2b7fe07039ddd3b199b96f44859a6e3c70b582a9d8d33cd535/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f666f6c6c6f772d2534306e656b6f6661722d3144413146323f6c6f676f3d74776974746572267374796c653d666c6174)](https://twitter.com/nekofar)

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP. This package implements ZarinPal support for Omnipay.

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

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply require `league/omnipay` and `nekofar/omnipay-zarinpal` with Composer:

```
composer require league/omnipay nekofar/omnipay-zarinpal

```

Basic Usage
-----------

[](#basic-usage)

The following gateways are provided by this package:

- ZarinPal

For general usage instructions, please see the main [Omnipay](https://github.com/omnipay/omnipay)repository.

Example
-------

[](#example)

### Purchase

[](#purchase)

The result will be a redirect to the gateway or bank.

```
use Omnipay\Omnipay;

$gateway = Omnipay::create('ZarinPal');
$gateway->setMerchantId('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
$gateway->setReturnUrl('https://www.example.com/return');

// Send purchase request
$response = $gateway->purchase([
    'amount' => 100,
    'description' => 'Some description'
])->send();

// Process response
if ($response->isRedirect()) {
    // Redirect to offsite payment gateway
    $response->redirect();
} else {
    // Payment failed: display message to customer
    echo $response->getMessage();
}
```

On return, the usual completePurchase will provide the result of the transaction attempt.

The final result includes the following methods to inspect additional details:

```
// Send purchase complete request
$response = $gateway->completePurchase([
    'amount' => 100,
    'authority' => $_REQUEST['Authority'],
)->send();

// Process response
if ($response->isSuccessful()) {
    // Payment was successful
    print_r($response);
} else {
    // Payment failed: display message to customer
    echo $response->getMessage();
}
```

### Testing

[](#testing)

```
composer test
```

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/nekofar/omnipay-zarinpal/issues), or better yet, fork the library and submit a pull request.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~68 days

Recently: every ~11 days

Total

21

Last Release

1090d ago

Major Versions

v0.1.0 → v1.0.02019-08-31

v1.3.11 → v2.0.02023-05-18

PHP version history (3 changes)v1.0.1PHP ^7.0

v1.2.0PHP ^7.3 || ^8.0

v2.0.0PHP &gt;=8.1

### Community

Maintainers

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

---

Top Contributors

[![nekofar](https://avatars.githubusercontent.com/u/147401?v=4)](https://github.com/nekofar "nekofar (176 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (43 commits)")[![mend-bolt-for-github[bot]](https://avatars.githubusercontent.com/in/16809?v=4)](https://github.com/mend-bolt-for-github[bot] "mend-bolt-for-github[bot] (1 commits)")

---

Tags

gatewaymerchantomnipaypaymentphppurchasezarinpalpaymentgatewaymerchantomnipaypurchasezarinpal

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[omnipay/common

Common components for Omnipay payment processing library

35119.0M1.0k](/packages/omnipay-common)[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

587421.0k11](/packages/lokielse-omnipay-alipay)

PHPackages © 2026

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