PHPackages                             salamzadeh/pb-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. salamzadeh/pb-payment

ActiveLibrary[Payment Processing](/categories/payments)

salamzadeh/pb-payment
=====================

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

v1.2(3y ago)016[1 issues](https://github.com/salamzadeh/pb-payment/issues)MITPHPPHP ^7.4|^8.0|^9.0

Since Dec 22Pushed 3y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (9)Versions (4)Used By (0)

 [![](https://raw.githubusercontent.com/salamzadeh/pb-payment/master/images/logo.png)](https://raw.githubusercontent.com/salamzadeh/pb-payment/master/images/logo.png)

Payment Gateways for Laravel
============================

[](#payment-gateways-for-laravel)

[![](https://raw.githubusercontent.com/salamzadeh/pb-payment/master/images/screen.png)](https://github.com/salamzadeh/pb-payment)

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

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

[![Latest Stable Version](https://camo.githubusercontent.com/93bf88836ab69c4693dc7ae56122b3c36b5d7f5242164c6f2669255aabef707a/68747470733a2f2f706f7365722e707567782e6f72672f73616c616d7a616465682f70622d7061796d656e742f76)](https://packagist.org/packages/salamzadeh/pb-payment)[![Total Downloads](https://camo.githubusercontent.com/7b5d344c0b5517c4935080067a943981fe7a20c796d89bb8460d7ec90e9a7754/68747470733a2f2f706f7365722e707567782e6f72672f73616c616d7a616465682f70622d7061796d656e742f646f776e6c6f616473)](https://packagist.org/packages/salamzadeh/pb-payment)[![Latest Unstable Version](https://camo.githubusercontent.com/32a00ee020db37f15bbdf957c8a3039a85fb353e81c9480e36e282f5900c4f18/68747470733a2f2f706f7365722e707567782e6f72672f73616c616d7a616465682f70622d7061796d656e742f762f756e737461626c65)](https://packagist.org/packages/salamzadeh/pb-payment)[![License](https://camo.githubusercontent.com/d80b327215d124f5ca91d318a1456f22edc7daa78bb5727b81e88dd388b4305c/68747470733a2f2f706f7365722e707567782e6f72672f73616c616d7a616465682f70622d7061796d656e742f6c6963656e7365)](https://packagist.org/packages/salamzadeh/pb-payment)

Gateways
--------

[](#gateways)

GatewayDescriptionAvailableTestedLast Update[Sadad (Melli)](https://sadadpsp.ir/)بانک ملی (سداد)✓✓2021/12/22[Pay.ir](https://pay.ir/)پرداخت پی✓✓2021/12/22[Zarinpal](https://zarinpal.com/)زرین پال✓✓2023/01/03[Sizpay](https://sizpay.ir/)سیز پی✓✓2023/01/03[Payping](https://www.payping.ir/)پی پینگ✓-2021/12/22[Qeroun](https://qeroun.com/)قرون - خرید امن با ایجاد توافق‌نامه---[Saman (Sep)](https://www.sep.ir/)(سپ) بانک سامان✓-2021/12/22[Mellat (Behpardakht)](http://www.behpardakht.com/)(به پرداخت) بانک ملت---[Parsian (Pec)](https://www.pec.ir/)(پک) بانک پارسیان---[Pasargad (Pep)](https://www.pep.co.ir/)(پپ) بانک پاسارگاد---[Zibal](https://zibal.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 salamzadeh/pb-payment:^1.2.0
    ```

    Or add it to `composer.json` manually:

    ```
    "require": {
        "salamzadeh/pb-payment": "^1.2.0"
    }
    ```
2. PBPayment's service providers will be automatically registered using Laravel's auto-discovery feature.

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

    ```
    $app->register( Salamzadeh\PBPayment\PBPaymentServiceProvider::class);
    ```
3. Publish the config-file and migration with:

    ```
    php artisan vendor:publish --provider="Salamzadeh\PBPayment\PBPaymentServiceProvider"
    ```
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 Salamzadeh\PBPayment\PBPayment;

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

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

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

### Verify Payment:

[](#verify-payment)

```
use Salamzadeh\PBPayment\PBPayment;
use Salamzadeh\PBPayment\Exceptions\PBPaymentException;

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

### Create your own payment gateway class

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

```
use Salamzadeh\PBPayment\Gateways\AbstractGateway;
use Salamzadeh\PBPayment\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
        ]);
    }
}
```

Upgrading from v1.x
-------------------

[](#upgrading-from-v1x)

TODO:

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/salamzadeh/pb-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

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity69

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~188 days

Total

3

Last Release

1230d ago

PHP version history (2 changes)v1.0PHP ^7.4|^8.0

v1.2PHP ^7.4|^8.0|^9.0

### Community

Maintainers

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

---

Top Contributors

[![salamzadeh](https://avatars.githubusercontent.com/u/4796598?v=4)](https://github.com/salamzadeh "salamzadeh (5 commits)")

---

Tags

laravelpaymentgatewayBankpaymerchantpurchaseBankingiranzarinpalsamanMelisadadseppayirpayment systemPayPing

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/salamzadeh-pb-payment/health.svg)

```
[![Health](https://phpackages.com/badges/salamzadeh-pb-payment/health.svg)](https://phpackages.com/packages/salamzadeh-pb-payment)
```

###  Alternatives

[dena-a/iran-payment

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

312.4k1](/packages/dena-a-iran-payment)[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)
