PHPackages                             dena-a/iran-payment - 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. dena-a/iran-payment

ActiveLibrary[Payment Processing](/categories/payments)

dena-a/iran-payment
===================

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

v2.2.1(1y ago)312.4k16[5 PRs](https://github.com/dena-a/iran-payment/pulls)1MITPHPPHP ^7.4|^8.0CI failing

Since Nov 15Pushed 1y ago3 watchersCompare

[ Source](https://github.com/dena-a/iran-payment)[ Packagist](https://packagist.org/packages/dena-a/iran-payment)[ Docs](https://github.com/dena-a/iran-payment)[ RSS](/packages/dena-a-iran-payment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (21)Used By (1)

 [![](https://raw.githubusercontent.com/dena-a/iran-payment/master/images/logo.png)](https://raw.githubusercontent.com/dena-a/iran-payment/master/images/logo.png)

IranPayment for Laravel
=======================

[](#iranpayment-for-laravel)

[![](https://raw.githubusercontent.com/dena-a/iran-payment/master/images/screen.png)](https://github.com/dena-a/iran-payment)

**a Laravel package to handle Internet Payment Gateways (IPGs) for Iran Banking System**

Accepting [Sadad (Melli)](https://sadadpsp.ir/), [Saman (Sep)](https://www.sep.ir/), [Zarinpal](https://zarinpal.com/) and more iranian payment gateways. Just use the IranPayment to receive payments directly on your website.

[![Latest Stable Version](https://camo.githubusercontent.com/1837fbc4ecc3a2fe66972cd7d709428e6481f134e5116fb0f74efe286591fd5f/68747470733a2f2f706f7365722e707567782e6f72672f64656e612d612f6972616e2d7061796d656e742f76)](https://packagist.org/packages/dena-a/iran-payment)[![Total Downloads](https://camo.githubusercontent.com/5062713a2268fe09b067215e6d2b9e0fa2b5f586ae86094629e85c255537e172/68747470733a2f2f706f7365722e707567782e6f72672f64656e612d612f6972616e2d7061796d656e742f646f776e6c6f616473)](https://packagist.org/packages/dena-a/iran-payment)[![Latest Unstable Version](https://camo.githubusercontent.com/b99cfa9454d37fcab0a009516c6ef960f0dbb896bc7e303d1b7f74beaeb5fb02/68747470733a2f2f706f7365722e707567782e6f72672f64656e612d612f6972616e2d7061796d656e742f762f756e737461626c65)](https://packagist.org/packages/dena-a/iran-payment)[![License](https://camo.githubusercontent.com/efad47ef946304a58d9345e19b1d8c2d9f9629b0fca48d1be6ce27cf0a507ec7/68747470733a2f2f706f7365722e707567782e6f72672f64656e612d612f6972616e2d7061796d656e742f6c6963656e7365)](https://packagist.org/packages/dena-a/iran-payment)

Gateways
--------

[](#gateways)

Gateways
--------

[](#gateways-1)

LogoGatewayDescriptionAvailableTestedLast Update[![](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/sadad.png)](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/sadad.png)[Sadad (Melli)](https://sadadpsp.ir/)بانک ملی (سداد)✓✓2020/09/10[![](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/sep.png)](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/sep.png)[Saman (Sep)](https://www.sep.ir/)(سپ) بانک سامان✓✓2020/08/03[![](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/pay.png)](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/pay.png)[Pay.ir](https://pay.ir/)پرداخت پی✓✓2020/08/03[![](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/zp.png)](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/zp.png)[Zarinpal](https://zarinpal.com/)زرین پال✓✓2020/08/03[![](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/payping.png)](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/payping.png)[Payping](https://www.payping.ir/)پی پینگ✓✓2020/08/04[![](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/novinopay.png)](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/novinopay.png)[Novinopay](https://www.novinopay.com/)نوینو پرداخت✓✓2022/03/23[![](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/digipay.png)](https://raw.githubusercontent.com/dena-a/iran-payment/master/resources/assets/img/digipay.png)[Digipay](https://www.mydigipay.com/)دیجی پیCPG ✓ BPG/BNPL ✓✓2024/06/24---[Qeroun](https://qeroun.com/)قرون - خرید امن با ایجاد توافق‌نامه------[Mellat (Behpardakht)](http://www.behpardakht.com/)(به پرداخت) بانک ملت------[Parsian (Pec)](https://www.pec.ir/)(پک) بانک پارسیان------[Pasargad (Pep)](https://www.pep.co.ir/)(پپ) بانک پاسارگاد------[Zibal](https://zibal.ir/)زیبال------[IDPay](https://idpay.ir/)آیدی پی---Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- PHP ext-curl
- PHP ext-json
- PHP ext-soap
- [Laravel](https://www.laravel.com) (or [Lumen](https://lumen.laravel.com)) &gt;= 5.7

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

[](#installation)

1. Add the package to your composer file via the `composer require` command:

    ```
    $ composer require dena-a/iran-payment:^2.0
    ```

    Or add it to `composer.json` manually:

    ```
    "require": {
        "dena-a/iran-payment": "^2.0"
    }
    ```
2. IranPayment's service providers will be automatically registered using Laravel's auto-discovery feature.

    > Note: For Lumen you have to add the IranPayment service provider manually to: `bootstrap/app.php` :

    ```
    $app->register( Dena\IranPayment\IranPaymentServiceProvider::class);
    ```
3. Publish the config-file and migration with:

    ```
    php artisan vendor:publish --provider="Dena\IranPayment\IranPaymentServiceProvider"
    ```
4. After the migration has been published you can create the transactions-tables by running the migrations:

    ```
    php artisan migrate
    ```

Usage
-----

[](#usage)

### New Payment:

[](#new-payment)

```
use Dena\IranPayment\IranPayment;

// Default gateway
$payment = IranPayment::create();
// Select one of available gateways
$payment = IranPayment::create('sadad');
// Test gateway (Would not work on production environment)
$payment = IranPayment::create('test');
// Or use your own gateway
$payment = IranPayment::create(NewGateway::class);

$payment->setUserId($user->id)
        ->setAmount($data['amount'])
        ->setCallbackUrl(route('bank.callback'))
        ->ready();

return $payment->redirect();
```

### Verify Payment:

[](#verify-payment)

```
use Dena\IranPayment\IranPayment;
use Dena\IranPayment\Exceptions\IranPaymentException;

try {
    $payment = IranPayment::detect()->confirm();
    $trackingCode = $payment->getTrackingCode();
    $statusText = $payment->getTransactionStatusText();
} catch (Dena\IranPayment\Exceptions\IranPaymentException $ex) {
    throw $ex;
}
```

### Create your own payment gateway class

[](#create-your-own-payment-gateway-class)

```
use Dena\IranPayment\Gateways\AbstractGateway;
use Dena\IranPayment\Gateways\GatewayInterface;

class NewGateway extends AbstractGateway implements GatewayInterface
{
    public function getName(): string
    {
        return 'new-gateway';
    }

    public function initialize(array $parameters = []): self
    {
        parent::initialize($parameters);

        return $this;
    }

    public function purchase(): void
    {
        // Send Purchase Request

        $reference_number = 'xxxx';

        $this->transactionUpdate([
            'reference_number' => $reference_number,
        ]);
    }

    public function purchaseUri(): string
    {
        return 'http://new-gateway.com/token/xxxx';
    }

    public function verify(): void
    {
        $this->transactionVerifyPending();

        // Send Payment Verify Request

        $tracking_code = 'yyyy';

        $this->transactionSucceed([
            'tracking_code' => $tracking_code
        ]);
    }
}
```

Contribute
----------

[](#contribute)

Contributions are always welcome!

Support
-------

[](#support)

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

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

44

—

FairBetter than 91% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 78% 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 ~176 days

Recently: every ~59 days

Total

17

Last Release

634d ago

Major Versions

v0.2.0 → v1.0.02017-03-05

v1.1.0 → v2.0.02021-02-22

PHP version history (4 changes)v0.1.0PHP &gt;=5.5.0

v2.0.0PHP ^7.4

v2.0.1PHP ^7.4|^8.0|^8.1

v2.1.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3acb8478bf68a89f8b96580001aa6759ec71ab51346c61823f3007a3ae79c4fb?d=identicon)[dena-a](/maintainers/dena-a)

---

Top Contributors

[![dena-a](https://avatars.githubusercontent.com/u/4950968?v=4)](https://github.com/dena-a "dena-a (181 commits)")[![yeknava](https://avatars.githubusercontent.com/u/4211913?v=4)](https://github.com/yeknava "yeknava (38 commits)")[![MohammadMehrabani](https://avatars.githubusercontent.com/u/18621426?v=4)](https://github.com/MohammadMehrabani "MohammadMehrabani (5 commits)")[![qmeyti](https://avatars.githubusercontent.com/u/38724146?v=4)](https://github.com/qmeyti "qmeyti (3 commits)")[![avankey](https://avatars.githubusercontent.com/u/55177933?v=4)](https://github.com/avankey "avankey (3 commits)")[![meh-dev](https://avatars.githubusercontent.com/u/56062730?v=4)](https://github.com/meh-dev "meh-dev (1 commits)")[![fmmajd](https://avatars.githubusercontent.com/u/6819858?v=4)](https://github.com/fmmajd "fmmajd (1 commits)")

---

Tags

iraniran-paymentiranian-banklaravel-paymentspaypay-irpayirpayment-gatewaypaypingqerounsamansaman-banksaman-laravel-gatewaysepsep-payzarinpalzarinpal-gatewayzarinpal-laravel-gatewaylaravelpaymentgatewayBankpaymerchantpurchaseBankingiranzarinpalsamanMelisadadseppayirpayment systemPayPingnovinopay

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dena-a-iran-payment/health.svg)

```
[![Health](https://phpackages.com/badges/dena-a-iran-payment/health.svg)](https://phpackages.com/packages/dena-a-iran-payment)
```

###  Alternatives

[larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

24553.7k](/packages/larabook-gateway)[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)
