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

ActiveLibrary[Payment Processing](/categories/payments)

tenetup/zarinpal
================

this package use for send and validate zarinpal gateway transaction

128PHP

Since Feb 1Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mbehzad-bhz/TenetUp_Zarinpal)[ Packagist](https://packagist.org/packages/tenetup/zarinpal)[ RSS](/packages/tenetup-zarinpal/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

TenetUp-Zarinpal
================

[](#tenetup-zarinpal)

In this package, it is easily connected to ZarinPal gateway and you can validate your transactions.

> **NOTE:** These instructions are for the latest version of Laravel.

[![Total Downloads](https://camo.githubusercontent.com/bd14dde0eaaf7383a5c052be58b61c84c9eba0d87a890f90315226790c13cdf3/687474703a2f2f706f7365722e707567782e6f72672f74656e657475702f7a6172696e70616c2f646f776e6c6f616473)](https://packagist.org/packages/tenetup/zarinpal)[![License](https://camo.githubusercontent.com/eb790dd77dcf7d5015e6b6411db11494914cd58838fcd04d68c2f3f2f8377023/687474703a2f2f706f7365722e707567782e6f72672f74656e657475702f7a6172696e70616c2f6c6963656e7365)](https://packagist.org/packages/tenetup/zarinpal)

- [Installation](#installation)
- [Request](#Request)
- [Verification](#Verification)
- [Configuration](#Configuration)
- [Copyright and License](#copyright-and-license)

[![JetBrains](https://camo.githubusercontent.com/68371698a9d5ad6989b69158e7c06e14005262305f6037b1d98402802e5bc857/68747470733a2f2f74656e657475702e636f6d2f74656e657475702e706e67)](https://tenetup.com)

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

[](#installation)

1. Install the package via Composer:

    ```
    $ composer require tenetup/zarinpal
    ```
2. Register The package in your config/app.php

    A. set in Providers -&gt; TenetUp\\Zarinpal\\ZarinpalServiceProvider::class,

    B. set in Aliases -&gt; 'zarinpal' =&gt; \\TenetUp\\Zarinpal\\ZarinpalFacade::class,
3. Optionally, publish the configuration file if you want to change any defaults:

    ```
    php artisan vendor:publish --provider="TenetUp\Zarinpal\ZarinpalServiceProvider"
    ```

> **NOTE:** the configuration filename is "zarinpal.php"

Request
-------

[](#request)

to make request and send to the zarrinpal

```
return \zarinpal::createRequest(20000);
```

> **NOTE:** price is required (you must to set your price as toman standard)

full command

```
return \zarinpal::createRequest(20000 , '091232145687' , 'example@email.com' , 'description');
```

sample response

```
{
  "Node": "sandbox",
  "Method": "SOAP",
  "Status": 100,
  "Message": "عمليات با موفقيت انجام گرديده است.",
  "StartPay": "https://sandbox.zarinpal.com/pg/StartPay/000000000000000000000000000000592872",
  "Authority": "000000000000000000000000000000592872"
}
```

Verification
------------

[](#verification)

after transaction success or not in your backPaymentURL you must to verify your transaction

> be default zarinpal gateway send you Autority unique code and simply we authorize by this

```
return \zarinpal::verifyTransAction(20000);
```

> **NOTE:**in this method just set the price we check your $\_GET\['authority'\] , price and your merchantID with zarinpal after that in the response you can handle your proccess

Sample Response

```
verification success
{
  "Node": "sandbox",
  "Method": "SOAP",
  "Status": 100,
  "Message": "عمليات با موفقيت انجام گرديده است.",
  "Amount": 20000,
  "RefID": 12345678,
  "Authority": "000000000000000000000000000000592907"
}
```

```
verification failed
{
  "Node": "sandbox",
  "Method": "SOAP",
  "Status": -54,
  "Message": "اتوریتی نامعتبر است",
  "Amount": 20000,
  "RefID": "",
  "Authority": ""
}
```

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

[](#configuration)

in the `config/zarinpal` your must to change your merchantID and you can change your every thing you need, you can set your callBackUrl simply to `route('backPayment')`

```
return [
    'merchantID' => 'xxxx-xxxx-xxxx-xxx-xxxxx',
    'sandBox' => true,
    'callBackUrl' => 'https://example.com/backPayment',
    'zarinGate' => false,

    'errorList' => [
        "-1" 	=> "اطلاعات ارسال شده ناقص است.",
        "-2" 	=> "IP و يا مرچنت كد پذيرنده صحيح نيست",
        "-3" 	=> "با توجه به محدوديت هاي شاپرك امكان پرداخت با رقم درخواست شده ميسر نمي باشد",
        "-4" 	=> "سطح تاييد پذيرنده پايين تر از سطح نقره اي است.",
        "-9" 	=> "خطای اعتبار سنجی",
        "-10" 	=> "ای پی و يا مرچنت كد پذيرنده صحيح نيست",
        "-11" 	=> "مرچنت کد فعال نیست لطفا با تیم پشتیبانی ما تماس بگیرید",
        "-12" 	=> "تلاش بیش از حد در یک بازه زمانی کوتاه.",
        "-15" 	=> "ترمینال شما به حالت تعلیق در آمده با تیم پشتیبانی تماس بگیرید",
        "-16" 	=> "سطح تاييد پذيرنده پايين تر از سطح نقره اي است.",
        "-21" 	=> "هيچ نوع عمليات مالي براي اين تراكنش يافت نشد",
        "-22" 	=> "تراكنش ناموفق ميباشد",
        "-30" 	=> "اجازه دسترسی به تسویه اشتراکی شناور ندارید",
        "-31" 	=> "حساب بانکی تسویه را به پنل اضافه کنید مقادیر وارد شده واسه تسهیم درست نیست",
        "-32" 	=> "Wages is not valid, Total wages(floating) has been overload max amount.	",
        "-33" 	=> "رقم تراكنش با رقم پرداخت شده مطابقت ندارد",
        "-34" 	=> "سقف تقسيم تراكنش از لحاظ تعداد يا رقم عبور نموده است",
        "-35" 	=> "تعداد افراد دریافت کننده تسهیم بیش از حد مجاز است",
        "-40" 	=> "اجازه دسترسي به متد مربوطه وجود ندارد.",
        "-41" 	=> "اطلاعات ارسال شده مربوط به AdditionalData غيرمعتبر ميباشد.",
        "-42" 	=> "مدت زمان معتبر طول عمر شناسه پرداخت بايد بين 30 دقيه تا 45 روز مي باشد.",
        "-50" 	=> "مبلغ پرداخت شده با مقدار مبلغ در وریفای متفاوت است",
        "-51" 	=> "تراكنش نا موفق ميباشد",
        "-52" 	=> "خطای غیر منتظره با پشتیبانی تماس بگیرید",
        "-53" 	=> "اتوریتی برای این مرچنت کد نیست",
        "-54" 	=> "اتوریتی نامعتبر است",
        "100" 	=> "عمليات با موفقيت انجام گرديده است.",
        "101" 	=> "عمليات پرداخت موفق بوده و قبلا این تراكنش انجام شده است.",
    ]
];
```

by default package set to sandbox and just for testing if you want to publish your project you must to change `sanbox => false`

Copyright and License
---------------------

[](#copyright-and-license)

[tenetup-zarinpal](https://github.com/mbehzad-bhz/tenetup_zarinpal)was written by [majid behzadnasab](https://github.com/mbehzad-bhz) and [pooria noruzi](https://github.com/pooria-noruzi) and is released under the [MIT License](LICENSE.md).

Copyright (c) 2021 TenetUp Company

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity23

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/d5d314f344a1152e5a27f68735e03374355161f8cbd16ec4a47f49ffa39dec3e?d=identicon)[tntlearn](/maintainers/tntlearn)

---

Top Contributors

[![mbehzad-bhz](https://avatars.githubusercontent.com/u/22252603?v=4)](https://github.com/mbehzad-bhz "mbehzad-bhz (5 commits)")

---

Tags

buyinglaravel-frameworkphpshopshopping-cart

### Embed Badge

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

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/braintree

Braintree gateway for Omnipay payment processing library

35558.0k3](/packages/omnipay-braintree)

PHPackages © 2026

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