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

ActiveLibrary[Payment Processing](/categories/payments)

xsotechs/smart-payment-routing
==============================

A Laravel package that allows your application to intelligently select the best payment processor for each transaction.

05PHP

Since Jul 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Tope19/smart-payment-routing)[ Packagist](https://packagist.org/packages/xsotechs/smart-payment-routing)[ RSS](/packages/xsotechs-smart-payment-routing/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Smart Routing Package
=====================

[](#smart-routing-package)

Introduction
------------

[](#introduction)

The Smart Routing Package for Laravel provides an intelligent routing system for payment gateways. It dynamically selects the most suitable payment processor based on various factors such as transaction cost, reliability, and currency support. This package ensures efficient, flexible, and secure handling of payment transactions.

Features
--------

[](#features)

- **Dynamic Routing Logic**: Intelligently routes transactions to the best payment processor.
- **Processor Management**: Manage multiple payment processors with ease.
- **Configuration Options**: Customize routing rules based on transaction cost, reliability, and other criteria.
- **Laravel Compatibility**: Compatible with the latest stable version of Laravel.

Table of Contents
-----------------

[](#table-of-contents)

1. [Installation](#installation)
2. [Usage](#usage)
3. [Running Tests](#running-tests)

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

[](#installation)

You can install the package via composer:

```
composer require xsotechs/smart-payment-routing:dev-main
```

You can adjust your project's minimum-stability to allow less stable versions. Add the following to your composer.json file:

```
{
    "minimum-stability": "dev",
    "prefer-stable": true
}
```

After installation, publish the configuration file:

```
php artisan vendor:publish --provider="Xsotechs\SmartPaymentRouting\SmartPaymentRoutingServiceProvider" --tag="config"
```

Run your migration command:

```
php artisan migrate
```

Usage
-----

[](#usage)

To use the smart payment routing in your Laravel application:

```
use Xsotechs\SmartPaymentRouting\Services\SmartRouterService;

public function processPayment(Request $request)
{
    $smartRouterService = new SmartRouterService();
    $paymentData = [
        'amount' => $request->amount,
        'currency' => $request->currency,
        'country' => $request->country,
        // Add any other necessary data
    ];

    try {
        $data = $smartRouterService->route($paymentData);
        // Use the data to initiate a payment logic
    } catch (\Exception $e) {
        return response()->json(['message' => 'Error: ' . $e->getMessage()], 500);
    }
}
```

Managing Payment Processors
---------------------------

[](#managing-payment-processors)

You can use the '**PaymentProcessorService**' to manage payment processors:

```
use Xsotechs\SmartPaymentRouting\Services\PaymentProcessorService;

$processorService = new PaymentProcessorService();

// Create a new processor
$newProcessor = $processorService->create([
    'name' => 'paystack',
    'is_active' => true,
    'transaction_cost' => 0.029,
    'reliability_score' => 99.0,
    'supported_currencies' => ['NGN', 'USD'], // Supported currencies
    'supported_countries' => ['NG', 'US'], // Supported countries
    'config' => ['api_key' => 'your_stripe_api_key'],
]);

// Update a processor
$processor = PaymentProcessor::find(1);
$processorService->update($processor, [
    'transaction_cost' => 0.028,
    'reliability_score' => 95.0,
]);

// Delete a processor
$processor = PaymentProcessor::find(1);
$processorService->delete($processor);

// Get all processors
$allProcessors = $processorService->getAll();

// Get active processors
$activeProcessors = $processorService->getActive();
```

Running Tests
-------------

[](#running-tests)

Please make sure to update the database credentials in phpunit.xml with your own when running tests for the package.

```

```

Then run the below commands:

1. vendor/bin/phpunit tests/unit/PaymentProcessorServiceTest.php
2. vendor/bin/phpunit tests/unit/SmartRouterServiceTest.php
3. vendor/bin/phpunit tests/unit/\*.php

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

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/51832865?v=4)[Tope Olotu](/maintainers/tope19)[@Tope19](https://github.com/Tope19)

### Embed Badge

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

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

###  Alternatives

[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.1k](/packages/msilabs-bkash)

PHPackages © 2026

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