Download the PHP package eboseogbidi/smartpaymentrouter without Composer
On this page you can find all versions of the php package eboseogbidi/smartpaymentrouter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eboseogbidi/smartpaymentrouter
More information about eboseogbidi/smartpaymentrouter
Files in eboseogbidi/smartpaymentrouter
Package smartpaymentrouter
Short Description This package can intelligently route payment transactions to the most suitable payment processor based on various factors such as transaction cost, reliability, and currency support.
License MIT
Informations about the package smartpaymentrouter
SmartPaymentRouter
A flexible and intelligent payment routing system that helps you manage multiple payment processors with automatic fallback and smart routing based on cost, reliability, and supported currencies.
Installation
You can install the package via composer:
Migration
Migrate the schema for the payment transaction log this helps to improve the reliability of the different payment processors:
Configuration
Publish the configuration file:
This will create a config/smartpaymentrouter.php
file where you can configure your payment processors.
Basic Configuration Structure
Configuration parameters:
name
: Display name for the processorclass
: The processor class that implements PaymentProcessorInterfacetransaction_cost
: Processing fee percentagereliability
: Estimated uptime percentagecurrencies
: Array of supported currencies
Extending PaymentProcessorInterface
To create a new payment processor, implement the PaymentProcessorInterface
:
Using the Payment Router
Example of how to use the PaymentRouter
in a Controller :
Using the ProcessorManager
The ProcessorManager provides methods to interact with and modify the payment configuration:
Testing
The package includes a comprehensive test suite. Run the tests with:
Error Handling
The package provides built-in error handling for common scenarios: