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

ActiveLibrary[Payment Processing](/categories/payments)

omalizadeh/laravel-multi-payment
================================

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

v3.3.0(10mo ago)491.1k↓50%12[2 issues](https://github.com/omalizadeh/laravel-multi-payment/issues)MITPHPPHP ^8.1CI passing

Since May 4Pushed 5mo ago3 watchersCompare

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

READMEChangelog (10)Dependencies (7)Versions (27)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/7fd5189b9fe177059a70afa004b8c28319c97d77cf3a9ba3d4c6517c1d19cc50/68747470733a2f2f706f7365722e707567782e6f72672f6f6d616c697a616465682f6c61726176656c2d6d756c74692d7061796d656e742f76)](//packagist.org/packages/omalizadeh/laravel-multi-payment)[![Tests](https://github.com/omalizadeh/laravel-multi-payment/actions/workflows/tests.yml/badge.svg)](https://github.com/omalizadeh/laravel-multi-payment/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/6a75c56401336c07ca334d53462625faa4706a78fe57eafa8e890eb2b1cab0f5/68747470733a2f2f706f7365722e707567782e6f72672f6f6d616c697a616465682f6c61726176656c2d6d756c74692d7061796d656e742f646f776e6c6f616473)](//packagist.org/packages/omalizadeh/laravel-multi-payment)[![License](https://camo.githubusercontent.com/613690a7d21b7a2475a40d188fc61ad3b2738c7cd32568ed06027d385f1c854c/68747470733a2f2f706f7365722e707567782e6f72672f6f6d616c697a616465682f6c61726176656c2d6d756c74692d7061796d656e742f6c6963656e7365)](//packagist.org/packages/omalizadeh/laravel-multi-payment)

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 **v8.0+** and requires php **v8.1+**

> Star! if you liked this package.

> **[مستندات فارسی](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)
- [PayStar](https://paystar.ir)

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

[](#installation--configuration)

Install using composer

```
  composer require omalizadeh/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 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 Omalizadeh\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

48

—

FairBetter than 94% of packages

Maintenance62

Regular maintenance activity

Popularity29

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 82.1% 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 ~60 days

Recently: every ~196 days

Total

26

Last Release

316d ago

Major Versions

v1.x-dev → v2.0.02021-09-16

v2.x-dev → v3.0.02023-05-26

PHP version history (3 changes)v1.0.0PHP ^7.4|^8.0

v2.6.1PHP ^7.4 || ^8.0

v3.0.0PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![omalizadeh](https://avatars.githubusercontent.com/u/12392549?v=4)](https://github.com/omalizadeh "omalizadeh (197 commits)")[![majidfeiz](https://avatars.githubusercontent.com/u/6500924?v=4)](https://github.com/majidfeiz "majidfeiz (35 commits)")[![Hebrahimzadeh](https://avatars.githubusercontent.com/u/38420287?v=4)](https://github.com/Hebrahimzadeh "Hebrahimzadeh (6 commits)")[![TryV](https://avatars.githubusercontent.com/u/35303148?v=4)](https://github.com/TryV "TryV (2 commits)")

---

Tags

bankbehpardakhtgatewaylaravelpaymentphpshetabzarinpalphplaravelpaymentgatewayinvoiceBanktopzarinpalzibalsamanmellatpasargadparsianpepidpayshetabseppayirBehPardakhtpeceghtesad novin

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[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)
