PHPackages                             shahrooz7216/laravel-multi-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. shahrooz7216/laravel-multi-payment

ActiveLibrary[Payment Processing](/categories/payments)

shahrooz7216/laravel-multi-payment
==================================

A driver-based laravel package for online payments via multiple gateways

1.1.2(1y ago)015MITPHPPHP ^7.4|^8.0

Since Dec 26Pushed 1y agoCompare

[ Source](https://github.com/shahrooz7216/laravel-multi-payment)[ Packagist](https://packagist.org/packages/shahrooz7216/laravel-multi-payment)[ Docs](https://github.com/omalizadeh/laravel-multi-payment)[ RSS](/packages/shahrooz7216-laravel-multi-payment/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Online Payment Gateway Package
======================================

[](#laravel-online-payment-gateway-package)

This is a laravel gateway payment package with multi driver support. Each driver can have multiple configurations.

Supports laravel **v7.0+** and requires php **v7.4+**

> **[مستندات فارسی](README-FA.md)**

Supported Gateways
------------------

[](#supported-gateways)

- [Mellat Bank (Behpardakht)](https://behpardakht.com)
- [Saman Bank (Sep)](https://sep.ir)
- [Parsian Bank (Top)](https://pec.ir)
- [Pasargad Bank (Pep)](https://pep.co.ir)
- [Eghtesad Novin Bank (Pardakht Novin)](https://pna.co.ir)
- [Zarinpal](https://zarinpal.com)
- [IDPay](https://idpay.ir)
- [Pay.ir](https://pay.ir)
- [Zibal](https://zibal.ir)

Installation &amp; Configuration
--------------------------------

[](#installation--configuration)

Install using composer

```
  composer require shahrooz7216/laravel-multi-payment
```

Publish main config file

```
  php artisan vendor:publish --tag=multipayment-config
```

Publish gateway config file based on tags. like:

- zarinpal-config
- mellat-config
- saman-config
- pasargad-config
- novin-config

For example:

```
  php artisan vendor:publish --tag=zarinpal-config
```

Also you may have to add Service provider to the providers Array in app.php file in config directory:

```
'providers' => [
    shahrooz7216\MultiPayment\Providers\MultiPaymentServiceProvider::class,
],

```

And you should add your configuration environment variables to your .env file:

```
    EGHTESAD_NOVIN_TERMINAL_ID="..."
    EGHTESAD_NOVIN_MERCHANT_ID="..."
    EGHTESAD_NOVIN_MID="..."
    EGHTESAD_NOVIN_USER_ID="..."
    EGHTESAD_NOVIN_PASSWORD="..."
    EGHTESAD_NOVIN_TOKEN=""
    EGHTESAD_NOVIN_CALLBACK_URL="https://something.com/novin.php"
    EGHTESAD_NOVIN_API_ENDPOINT="https://pna.shaparak.ir"
    EGHTESAD_NOVIN_CERT_PATH="..."
    EGHTESAD_NOVIN_CERT_USERNAME="..."
    EGHTESAD_NOVIN_CERT_PASSWORD="..."
    EGHTESAD_NOVIN_MODE="NoSign"

```

Also you can publish view file for gateway redirection and customize it

```
  php artisan vendor:publish --tag=multipayment-view
```

In main config file `multipayment.php`, you can specify default driver. For example, `zarinpal.second` value states that `zarinpal` gateway with configuration under `second` key section on zarinpal config file will be used. There is also an option for auto amount conversion from Iranian Tomans to Iranian Rials currency (IRR) and vice versa.

```
     /**
     * set default gateway
     *
     * valid pattern --> GATEWAY_NAME.GATEWAY_CONFIG_KEY
     */
    'default_gateway' => env('DEFAULT_PAYMENT_GATEWAY', 'zarinpal.second'),

    /**
     *  set to false if your in-app currency is IRR
     */
    'convert_to_rials' => true
```

In each gateway config file, you can specify multiple credentials, therefore you may have multiple gateways for your app from same provider.

```
     /**
     *  gateway configurations
     */
    'first' => [
        'merchant_id'  => '',
        'callback_url' => 'https://yoursite.com/path/to',
        'mode'        => 'normal', // Supported values: normal, sandbox, zaringate
        'description' => 'payment using zarinpal',
    ],
    'second' => [
        'merchant_id'  => '',
        'callback_url' => 'https://yoursite.com/path/to',
        'mode'        => 'sandbox',
        'description' => 'payment using zarinpal',
    ]
```

Usage
-----

[](#usage)

Gateway payment has two major phases. first is purchase (start process by calling gateway api for a transaction\_id/token) and opening gateway payment web page with received data. second is verification (checking payment was successful).

### Purchase

[](#purchase)

`Inovice` objects hold payment data. first you create an invoice, set amount and other information, then you pass invoice to `PaymentGateway` Facade to start payment process. you can use `setProvider` method on facade to change gateway before payment.

```
    // On top...
    use shahrooz7216\MultiPayment\Facades\PaymentGateway;

    ////

    $invoice = new Invoice(10000);
    $invoice->setPhoneNumber("989123456789");

    return PaymentGateway::purchase($invoice, function (string $transactionId) {
        // Save transaction_id and do stuff...
    })->view();
```

### Verification

[](#verification)

After payment gateway redirection to your app, you must create an invoice and set it's transaction\_id and amount. then use `PaymentGateway` to verify invoice successful payment.

```
    try {
        // Get amount & transaction_id from database or gateway request
        $invoice = new Invoice($amount, $transactionId);
        $receipt = PaymentGateway::verify($invoice);
        // Save receipt data and return response
        //
    } catch (PaymentAlreadyVerifiedException $exception) {
        // Optional: Handle repeated verification request
    } catch (PaymentFailedException $exception) {
        // Handle exception for failed payments
        return $exception->getMessage();
    }
```

### Other Features

[](#other-features)

#### Unverified Payments

[](#unverified-payments)

There is also a method (supported by zarinpal only for now) to get a list of successful unverified payments. use `unverifiedPayments` method in `PaymentGateway` facade for this feature.

#### Refund

[](#refund)

Using `refund` method, you can refund a successful payment back to customer.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.3% 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 ~45 days

Recently: every ~56 days

Total

6

Last Release

650d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a3db5436b71d2017b9da36fc2529cd83fb1867c4a923cd943d89fc384224047?d=identicon)[shahrooz7216](/maintainers/shahrooz7216)

---

Top Contributors

[![omalizadeh](https://avatars.githubusercontent.com/u/12392549?v=4)](https://github.com/omalizadeh "omalizadeh (191 commits)")[![shahrooz7216](https://avatars.githubusercontent.com/u/45891622?v=4)](https://github.com/shahrooz7216 "shahrooz7216 (20 commits)")[![TryV](https://avatars.githubusercontent.com/u/35303148?v=4)](https://github.com/TryV "TryV (2 commits)")[![Hebrahimzadeh](https://avatars.githubusercontent.com/u/38420287?v=4)](https://github.com/Hebrahimzadeh "Hebrahimzadeh (1 commits)")

---

Tags

phplaravelpaymentgatewayinvoiceBankzarinpalzibalsamanmellatpasargadidpayshetabseppayirBehPardakhteghtesad novin

### Embed Badge

![Health badge](/badges/shahrooz7216-laravel-multi-payment/health.svg)

```
[![Health](https://phpackages.com/badges/shahrooz7216-laravel-multi-payment/health.svg)](https://phpackages.com/packages/shahrooz7216-laravel-multi-payment)
```

###  Alternatives

[omalizadeh/laravel-multi-payment

A driver-based laravel package for online payments via multiple gateways

491.1k](/packages/omalizadeh-laravel-multi-payment)[parsisolution/gateway

A Laravel package for connecting to all Iraninan payment gateways

231.7k](/packages/parsisolution-gateway)[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

24553.7k](/packages/larabook-gateway)[dena-a/iran-payment

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

312.4k1](/packages/dena-a-iran-payment)

PHPackages © 2026

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