PHPackages                             amidesfahani/filament-payment-manager - 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. amidesfahani/filament-payment-manager

ActiveLibrary[Payment Processing](/categories/payments)

amidesfahani/filament-payment-manager
=====================================

A Filament plugin to manage Shetabit Payment gateways

v4.0.1(6mo ago)11424↓42.9%2[1 issues](https://github.com/amidesfahani/filament-payment-manager/issues)[1 PRs](https://github.com/amidesfahani/filament-payment-manager/pulls)MITPHPPHP ^8.1

Since Oct 24Pushed 6mo agoCompare

[ Source](https://github.com/amidesfahani/filament-payment-manager)[ Packagist](https://packagist.org/packages/amidesfahani/filament-payment-manager)[ RSS](/packages/amidesfahani-filament-payment-manager/feed)WikiDiscussions v4 Synced yesterday

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

Filament Payment Manager
========================

[](#filament-payment-manager)

A comprehensive Filament 4 plugin to manage [Shetabit Payment](https://github.com/shetabit/payment) gateways with a beautiful admin interface.

[![tiny-editor](images/filament-payment-manager.jpg?raw=true)](images/filament-payment-manager.jpg?raw=true)

Features
--------

[](#features)

- ✅ **Filament 4 Compatible** - Built specifically for Filament 4
- 🎨 **Beautiful UI** - Modern, intuitive interface for managing payment gateways
- 🔌 **Multiple Gateways** - Support for 30+ payment providers
- ⚙️ **Dynamic Configuration** - Configure each gateway independently
- 🎯 **Default Gateway** - Set a default payment gateway
- 🔄 **Custom Redirect Forms** - Use custom views or HTML templates
- 📊 **Gateway Management** - Enable/disable, sort, and organize gateways
- 🔐 **Secure** - Built on top of trusted Shetabit Payment package

Supported Payment Gateways
--------------------------

[](#supported-payment-gateways)

- Zarinpal, Saman, PayPal, Stripe
- Parsian, Sadad, Zibal, PayPing
- Behpardakht (Mellat), Pasargad, IranKish
- And 20+ more Iranian and international gateways

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

[](#installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require amidesfahani/filament-payment-manager
```

### Step 2: Publish Configuration &amp; Migrations

[](#step-2-publish-configuration--migrations)

```
php artisan vendor:publish --tag="filament-payment-manager-config"
php artisan vendor:publish --tag="filament-payment-manager-migrations"
php artisan vendor:publish --tag="filament-payment-manager-views"
```

### Step 3: Run Migrations

[](#step-3-run-migrations)

```
php artisan migrate
```

### Step 4: Register Plugin

[](#step-4-register-plugin)

Add the plugin to your Filament panel in `app/Providers/Filament/AdminPanelProvider.php`:

```
use YourVendor\FilamentPaymentManager\FilamentPaymentManagerPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            FilamentPaymentManagerPlugin::make(),
        ]);
}
```

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

[](#configuration)

### Environment Variables

[](#environment-variables)

Add these to your `.env` file:

```
PAYMENT_CALLBACK_URL=https://yourdomain.com/payment/callback
PAYMENT_DEFAULT_CURRENCY=T
PAYMENT_AUTO_LOAD_GATEWAYS=true
PAYMENT_ENABLE_LOGGING=false
```

### Config File

[](#config-file)

The config file `config/filament-payment-manager.php` allows you to customize:

- Default callback URL
- Auto-loading gateways
- Default currency (T=Toman, R=Rial)
- Driver default configurations
- Logging settings

Usage
-----

[](#usage)

### Creating a Payment Gateway

[](#creating-a-payment-gateway)

1. Navigate to **Settings &gt; Payment Gateways** in your Filament panel
2. Click **Create**
3. Fill in the required fields:
    - **Name**: Display name for the gateway
    - **Driver**: Select payment provider
    - **Configuration**: Add required credentials (merchantId, password, etc.)
    - **Callback URL**: Optional custom callback URL
    - **Active**: Enable/disable the gateway
    - **Default**: Set as default gateway

### Using in Your Application

[](#using-in-your-application)

#### Basic Payment Flow

[](#basic-payment-flow)

```
use YourVendor\FilamentPaymentManager\Services\PaymentManagerService;
use Shetabit\Multipay\Invoice;

// Get the service
$paymentManager = app(PaymentManagerService::class);

// Create an invoice
$invoice = new Invoice();
$invoice->amount(10000); // Amount in Toman or Rial

// Create payment (uses default gateway)
$payment = $paymentManager->createPayment($invoice->getAmount());

// Or specify a gateway
$payment = $paymentManager->createPayment($invoice->getAmount(), 'zarinpal');

// Purchase and get transaction ID
try {
    $transactionId = $payment->purchase($invoice, function($driver, $transactionId) {
        // Store transaction ID in your database
    })->pay()->render();

} catch (\Exception $e) {
    // Handle error
}
```

#### Verify Payment (in callback)

[](#verify-payment-in-callback)

```
use YourVendor\FilamentPaymentManager\Services\PaymentManagerService;
use Shetabit\Payment\Facade\Payment;

public function callback(Request $request)
{
    $paymentManager = app(PaymentManagerService::class);

    try {
        $receipt = $paymentManager->verifyPayment();

        // Payment successful
        $referenceId = $receipt->getReferenceId();

        // Update your order status

        return redirect()->route('payment.success');

    } catch (\Exception $e) {
        // Payment failed
        return redirect()->route('payment.failed');
    }
}
```

#### Get Available Gateways

[](#get-available-gateways)

```
$paymentManager = app(PaymentManagerService::class);

// Get all active gateways
$gateways = $paymentManager->getActiveGateways();

// Get default gateway
$defaultGateway = $paymentManager->getDefaultGateway();

// Get specific gateway by driver
$gateway = $paymentManager->getGatewayByDriver('zarinpal');
```

### Custom Redirect Forms

[](#custom-redirect-forms)

You have three options for redirect forms:

#### 1. Use Package Default (Recommended)

[](#1-use-package-default-recommended)

Beautiful, modern redirect form with countdown timer and animations.

#### 2. Custom Blade View

[](#2-custom-blade-view)

Create your own Blade view:

```
{{-- resources/views/payments/custom-redirect.blade.php --}}

    Payment Redirect

    Redirecting to payment...

        @foreach($inputs as $name => $value)

        @endforeach
        Continue

        document.getElementById('payment-form').submit();

```

Then set in gateway: `payments.custom-redirect`

#### 3. Custom HTML Template

[](#3-custom-html-template)

Use placeholders in your HTML:

```

    {inputs}
    Pay Now

document.forms[0].submit();
```

Gateway Configuration Examples
------------------------------

[](#gateway-configuration-examples)

### Zarinpal

[](#zarinpal)

```
[
    'merchantId' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
    'callbackUrl' => 'https://yourdomain.com/payment/callback',
    'description' => 'Payment for Order #123',
    'currency' => 'T', // T=Toman, R=Rial
    'mode' => 'normal', // normal, sandbox, zaringate
]
```

### Saman Bank

[](#saman-bank)

```
[
    'merchantId' => 'your-merchant-id',
    'password' => 'your-password',
    'callbackUrl' => 'https://yourdomain.com/payment/callback',
    'currency' => 'T',
]
```

### PayPal

[](#paypal)

```
[
    'clientId' => 'your-client-id',
    'clientSecret' => 'your-client-secret',
    'callbackUrl' => 'https://yourdomain.com/payment/callback',
    'currency' => 'USD',
    'mode' => 'normal', // normal or sandbox
]
```

### Stripe

[](#stripe)

```
[
    'secret' => 'sk_test_xxxxxxxxxxxxx',
    'currency' => 'usd',
    'success_url' => 'https://yourdomain.com/payment/success',
    'cancel_url' => 'https://yourdomain.com/payment/cancel',
]
```

Advanced Usage
--------------

[](#advanced-usage)

### Manual Gateway Loading

[](#manual-gateway-loading)

If you disable auto-loading in config:

```
use YourVendor\FilamentPaymentManager\Services\PaymentManagerService;
use YourVendor\FilamentPaymentManager\Models\PaymentGateway;

$paymentManager = app(PaymentManagerService::class);

// Load specific gateway
$gateway = PaymentGateway::where('driver', 'zarinpal')->first();
$paymentManager->registerGateway($gateway);
```

### Custom Redirect Form Service

[](#custom-redirect-form-service)

```
use YourVendor\FilamentPaymentManager\Models\PaymentGateway;
use YourVendor\FilamentPaymentManager\Services\PaymentManagerService;

$gateway = PaymentGateway::find(1);
$paymentManager = app(PaymentManagerService::class);

$html = $paymentManager->getRedirectForm(
    $gateway,
    'https://payment.gateway.com/pay',
    'POST',
    ['token' => 'abc123', 'amount' => 10000]
);

return response($html);
```

API Reference
-------------

[](#api-reference)

### PaymentManagerService Methods

[](#paymentmanagerservice-methods)

MethodDescription`createPayment($amount, $driver = null)`Create a new payment`verifyPayment($driver = null)`Verify a payment callback`getActiveGateways()`Get all active gateways`getDefaultGateway()`Get the default gateway`getGatewayByDriver($driver)`Get gateway by driver name`registerGateway(PaymentGateway $gateway)`Manually register a gateway`getRedirectForm($gateway, $action, $method, $inputs)`Get custom redirect form HTML### PaymentGateway Model

[](#paymentgateway-model)

PropertyTypeDescription`name`stringGateway display name`driver`stringPayment driver name`is_active`booleanActive status`is_default`booleanDefault gateway flag`config`arrayGateway configuration`callback_url`stringCustom callback URL`redirect_form_view`stringCustom Blade view path`redirect_form_html`stringCustom HTML template`sort_order`integerDisplay order`description`stringInternal notesTesting
-------

[](#testing)

### Using Local Gateway

[](#using-local-gateway)

The package includes a local test gateway:

```
// In Filament, create a gateway with driver 'local'
// This allows you to test payment flow without real credentials
```

### Sandbox Mode

[](#sandbox-mode)

Many gateways support sandbox mode:

```
// Zarinpal
'mode' => 'sandbox'

// PayPal
'mode' => 'sandbox'
```

Troubleshooting
---------------

[](#troubleshooting)

### Gateway not working

[](#gateway-not-working)

1. Check if gateway is **active** in admin panel
2. Verify all **required configuration** fields are filled
3. Ensure **callback URL** is accessible
4. Check **logs** if logging is enabled

### Callback URL issues

[](#callback-url-issues)

Make sure your callback URL:

- Is publicly accessible (not localhost in production)
- Matches exactly what you configured in the gateway
- Uses HTTPS in production

### Currency issues

[](#currency-issues)

Iranian gateways typically require amounts in **Rial**, but you can use **Toman** by setting `currency => 'T'` in config. The package handles conversion automatically.

Contributing
------------

[](#contributing)

Contributions are welcome! Please submit pull requests or issues on GitHub.

License
-------

[](#license)

This package is open-source software licensed under the MIT license.

Credits
-------

[](#credits)

- Built on [Shetabit Payment](https://github.com/shetabit/payment)
- Designed for [Filament PHP](https://filamentphp.com)

Support
-------

[](#support)

For issues and questions:

- GitHub Issues: \[[amidesfahani/filament-payment-manager](https://github.com/amidesfahani/filament-payment-manager)\]

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance64

Regular maintenance activity

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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 ~25 days

Total

3

Last Release

203d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d9ed461878eff3be19c9bfd4158e246a2a02f3728fa9589d8d48b61867fc2b0?d=identicon)[amidesfahani](/maintainers/amidesfahani)

---

Top Contributors

[![amidesfahani](https://avatars.githubusercontent.com/u/61671721?v=4)](https://github.com/amidesfahani "amidesfahani (3 commits)")

---

Tags

laravelpaymentfilamentshetabit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/amidesfahani-filament-payment-manager/health.svg)

```
[![Health](https://phpackages.com/badges/amidesfahani-filament-payment-manager/health.svg)](https://phpackages.com/packages/amidesfahani-filament-payment-manager)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

274325.8k8](/packages/croustibat-filament-jobs-monitor)[stephenjude/filament-debugger

About

104162.2k2](/packages/stephenjude-filament-debugger)[finity-labs/fin-mail

A powerful email template manager and composer for Filament with dynamic token replacement, template versioning, and inline email sending.

284.5k1](/packages/finity-labs-fin-mail)

PHPackages © 2026

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