Smart Router Functionality
Practical demonstration of smart router functionality.
Last updated
Practical demonstration of smart router functionality.
Last updated
In this example, we will create a Smart Router instance that utilizes the . The following steps will demonstrate how to configure the Smart Router and define the criteria for selected MIDs, specifically MPGS
and Knet
MIDs.
Navigate to the PGSR (Smart Router section) in the Administration Panel and click on the Add Smart Router button. Fill in the required details as shown in the figure below:
Smart Router Configuration:
Name: Smart Router Example
Is Active: Yes
Code Identifier: smart_router_example
Strategies: Transaction Size Strategy
Knet MID Criteria:
Minimum Amount: 1
Maximum Amount: 50
MPGS MID Criteria:
Minimum Amount: 51
Maximum Amount: 100
Using the Checkout API, we will create a checkout link. Below is the payload request for creating the checkout link:
The generated checkout link will redirect to the Checkout Page where the customer will click on the Pay button.
Once the pay button is clicked, the Smart Router starts functioning to choose the best path between the two chosen MIDs (MPGS and Knet). The path selection is based on the defined criteria.
As shown in the figure below, the chosen MID is MPGS since the transaction amount is 55, which falls within the range of the defined MPGS criteria.
If we change the amount in the request payload to be 50.
The Smart Router will choose Knet since the defined range covers the amount, as shown in the figure below:
Conclusion
Since we are using the , the criteria for this strategy must be defined for each selected MID. The figure below shows the criteria defined for MPGS
and Knet
MIDs:
By following these steps, we demonstrated how to create a Smart Router instance using the and defined criteria for MPGS
and Knet
MIDs. This example illustrates how the Smart Router dynamically selects the most appropriate payment gateway based on the transaction amount, optimizing the payment processing workflow and enhancing overall efficiency.