PHPackages                             harbdhulquadri/smart-routing - 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. harbdhulquadri/smart-routing

ActiveLibrary[Payment Processing](/categories/payments)

harbdhulquadri/smart-routing
============================

A smart payment routing system for Laravel applications

11PHP

Since Oct 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/HarbdhulQuadri/smart-routing)[ Packagist](https://packagist.org/packages/harbdhulquadri/smart-routing)[ RSS](/packages/harbdhulquadri-smart-routing/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Smart Payment Router
====================

[](#smart-payment-router)

Smart Payment Router is a Laravel package that provides intelligent payment routing capabilities for your application. It dynamically selects the best payment processor for each transaction based on factors such as transaction cost, reliability, and currency support.

Features
--------

[](#features)

- Dynamic routing logic to select the best payment processor for each transaction
- Configurable routing rules
- Easy management of payment processors (add, update, remove)
- Adapter pattern for easy integration of new payment processors
- Logging and monitoring mechanisms
- Robust error handling
- Secure handling of sensitive payment information
- Compatible with Laravel 10.x
- Comprehensive test suite

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

[](#installation)

You can install the package via composer:

```
composer require harbdhulquadri/smart-routing:dev-master
```

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

[](#configuration)

After installation, publish the configuration file:

```
php artisan vendor:publish --provider="Codehunter\SmartPaymentRouter\SmartPaymentRouterServiceProvider" --tag="config"
```

This will create a `config/smart_payment_router.php` file. You can modify this file to add or configure payment processors.

Usage
-----

[](#usage)

To use the Smart Payment Router in your application:

```
use Codehunter\SmartPaymentRouter\PaymentRouter;

class PaymentController extends Controller
{
    protected $paymentRouter;

    public function __construct(PaymentRouter $paymentRouter)
    {
        $this->paymentRouter = $paymentRouter;
    }

    public function processPayment(Request $request)
    {
        $transaction = [
            'amount' => $request->input('amount'),
            'currency' => $request->input('currency'),
        ];

        try {
            $processor = $this->paymentRouter->route($transaction);
            $result = $processor->process($transaction);

            if ($result) {
                return response()->json(['message' => 'Payment processed successfully']);
            } else {
                return response()->json(['error' => 'Payment processing failed'], 400);
            }
        } catch (PaymentProcessorNotFoundException $e) {
            return response()->json(['error' => $e->getMessage()], 400);
        }
    }
}
```

Adding a New Payment Processor
------------------------------

[](#adding-a-new-payment-processor)

To add a new payment processor:

1. Create a new adapter class that extends `PaymentProcessorAdapter`.
2. Implement the required methods in your adapter class.
3. Add the new processor to your configuration file.

Example of adding a new processor in the configuration:

```
'new_processor' => [
    'name' => 'New Processor',
    'adapter' => \App\PaymentProcessors\NewProcessorAdapter::class,
    'supported_currencies' => ['USD', 'EUR'],
    'min_amount' => 1,
    'max_amount' => 10000,
    'base_fee' => 0.30,
    'percentage_fee' => 0.025,
    'reliability_score' => 0.97,
],
```

Security
--------

[](#security)

The Smart Payment Router package follows security best practices for handling sensitive payment information. However, it's crucial to ensure that your entire application adheres to PCI DSS standards when dealing with payment data.

Testing
-------

[](#testing)

To run the package tests:

```
vendor/bin/phpunit
```

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

The Smart Payment Router package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![HarbdhulQuadri](https://avatars.githubusercontent.com/u/33990653?v=4)](https://github.com/HarbdhulQuadri "HarbdhulQuadri (15 commits)")

### Embed Badge

![Health badge](/badges/harbdhulquadri-smart-routing/health.svg)

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

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