PHPackages                             amedev/smart-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. amedev/smart-payment

ActiveLibrary[Payment Processing](/categories/payments)

amedev/smart-payment
====================

A smart and extensible Laravel payment system

1.0.3(11mo ago)00MITPHPPHP ^8.0

Since Aug 2Pushed 11mo agoCompare

[ Source](https://github.com/aliNoori/smart-payment)[ Packagist](https://packagist.org/packages/amedev/smart-payment)[ RSS](/packages/amedev-smart-payment/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (4)Used By (0)

SmartPayment
============

[](#smartpayment)

SmartPayment is a flexible and extensible Laravel package for managing payment workflows. It follows clean architecture principles and allows dynamic resolution of gateways and models.

---

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require amedev/smart-payment
```

Then publish the package components:

```
php artisan vendor:publish --tag=smart-payment-config         # Configuration file
php artisan vendor:publish --tag=smart-payment-migrations     # Database migrations
php artisan vendor:publish --tag=smart-payment-models         # Default models
php artisan vendor:publish --tag=smart-payment-translations   # Translations (e.g. Farsi)
```

Run migrations:

```
php artisan migrate
```

---

⚙️ Configuration
----------------

[](#️-configuration)

The configuration file will be available at `config/smart-payment.php`:

```
return [
    'default' => 'zarinpal', // Default payment gateway

    'gateways' => [
        'zarinpal' => \SmartPayment\Gateways\ZarinpalGateway::class,
        // You can register your own gateway classes like:
        // 'idpay' => \App\Gateways\CustomIDPayGateway::class,
    ],

    'models' => [
        'order' => \App\Models\Order::class,           // Your custom Order model
        'transaction' => \App\Models\Transaction::class, // Your custom Transaction model
    ],
];
```

---

🚀 Making a Payment
------------------

[](#-making-a-payment)

To initiate a payment request, make a `POST` call to `/api/payment/pay`:

```
POST /api/payment/pay
Content-Type: application/json
```

Example JSON body:

```
{
  "amount": 10000,
  "gateway": "zarinpal",
  "callback_url": "https://your-site.com/payment/callback",
  "meta": {
    "description": "Order #123",
    "email": "user@example.com",
    "mobile": "09123456789"
  }
}
```

This will create a transaction and redirect the user to the payment gateway.

---

🔄 Payment Callback
------------------

[](#-payment-callback)

After payment, the user is redirected to the callback URL:

```
GET /payment/callback
```

The package will verify the payment status and complete the transaction accordingly.

---

🛠 Artisan Utilities
-------------------

[](#-artisan-utilities)

To automatically fix namespaces for your custom models (especially if you override default ones):

```
php artisan smart-payment:fix-model-namespace
```

---

🌐 Translations
--------------

[](#-translations)

You can customize user-facing messages using the published translation file:

```
resources/lang/vendor/smart-payment/fa/messages.php

```

---

📌 Notes
-------

[](#-notes)

- The package is UI-agnostic: ideal for REST APIs or frontend frameworks like Vue or React.
- You can extend it with custom gateways by implementing your own Gateway class and registering it.
- The `meta` field allows storing custom order-related data like user contact or description.

---

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance52

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

Total

3

Last Release

334d ago

### Community

Maintainers

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

---

Top Contributors

[![aliNoori](https://avatars.githubusercontent.com/u/23056374?v=4)](https://github.com/aliNoori "aliNoori (7 commits)")

### Embed Badge

![Health badge](/badges/amedev-smart-payment/health.svg)

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

###  Alternatives

[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.2k](/packages/msilabs-bkash)

PHPackages © 2026

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