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

ActiveLibrary[Payment Processing](/categories/payments)

atbox/zarinpal
==============

transaction request system for zarinpal

v1.1.3(9y ago)12.7k1GPL2PHP

Since Jul 1Pushed 5y ago3 watchersCompare

[ Source](https://github.com/Atbox/Composer-Library)[ Packagist](https://packagist.org/packages/atbox/zarinpal)[ RSS](/packages/atbox-zarinpal/feed)WikiDiscussions master Synced yesterday

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

zarinpal-composer-library
=========================

[](#zarinpal-composer-library)

Transaction request library for zarinpal

\##laravel ready this package is going to work with all kinds of projects, but for laravel i add provider to make it as easy as possible. just add :

```
'providers' => array(
    ...
    'Zarinpal\Laravel\ZarinpalServiceProvider'
    ...
)
```

to providers list in "config/app.php". and run '`php artisan vendor:publish --provider="Zarinpal\Laravel\ZarinpalServiceProvider"`' to add config file to laravel configs directory config it and you are good to go now you can access the zarinpal lib like this:

```
Zarinpal::request("example.com/testVerify.php",1000,'testing');
Zarinpal::verify('OK',1000,$answer['Authority']);
```

\##usage ###installation `composer require atbox/zarinpal`or

```
"require": {
    ...
    "atbox/zarinpal" : "1.*",
    ...
},
```

\###request

```
use Zarinpal\Drivers\Soap;
use Zarinpal\Zarinpal;

$test = new Zarinpal('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',new soap());
echo json_encode($answer = $test->request("example.com/testVerify.php",1000,'testing'));
if(isset($answer['Authority'])) {
    file_put_contents('Authority',$answer['Authority']);
    $test->redirect();
}
//it will redirect to zarinpal to do the transaction or fail and just echo the errors.
//$answer['Authority'] must save somewhere to do the verification
```

\###verify

```
use Zarinpal\Drivers\Soap;
use Zarinpal\Zarinpal;

$test = new Zarinpal('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',new soap());
$answer['Authority'] = file_get_contents('Authority');
echo json_encode($test->verify('OK',1000,$answer['Authority']));
//'Status'(index) going to be 'success', 'error' or 'canceled'
```

\##change driver driver can be changed between restAPI , soap and NuSoap with using:

restAPI (recommended):

```
$test = new Zarinpal('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX');
```

or soap:

```
use Zarinpal\Drivers\Soap;
$test = new Zarinpal('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',new soap());
```

or nuSoap:

```
use Zarinpal\Drivers\NuSoap;
$test = new Zarinpal('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',new NuSoap());
```

\##Zaringate for redirect user to Zaringate instead of Zarinpal gateway, pass true as first parameter of redirect method (as default user will redirect to Zarinpal gateway with this method):

```
Zarinpal::redirect(true);
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 66% 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 ~109 days

Total

5

Last Release

3580d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13828769?v=4)[Atbox](/maintainers/atbox)[@Atbox](https://github.com/Atbox)

---

Top Contributors

[![hoomanna](https://avatars.githubusercontent.com/u/5413073?v=4)](https://github.com/hoomanna "hoomanna (31 commits)")[![sajjadrad](https://avatars.githubusercontent.com/u/1608837?v=4)](https://github.com/sajjadrad "sajjadrad (8 commits)")[![miladnouri](https://avatars.githubusercontent.com/u/3003901?v=4)](https://github.com/miladnouri "miladnouri (2 commits)")[![MA7](https://avatars.githubusercontent.com/u/4957870?v=4)](https://github.com/MA7 "MA7 (2 commits)")[![thesoulless](https://avatars.githubusercontent.com/u/1730786?v=4)](https://github.com/thesoulless "thesoulless (2 commits)")[![zartosht](https://avatars.githubusercontent.com/u/6488633?v=4)](https://github.com/zartosht "zartosht (1 commits)")[![majidgolshadi](https://avatars.githubusercontent.com/u/5164297?v=4)](https://github.com/majidgolshadi "majidgolshadi (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k34](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.3M9](/packages/chargebee-chargebee-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[imdhemy/google-play-billing

Google Play Billing

491.4M5](/packages/imdhemy-google-play-billing)

PHPackages © 2026

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