
Adding a new configuration
A Configuration object reprepsents the set of routing rules that will be invoked by Cashfree for every payment. Our first step is to just create a new configuration. To get started:- Log in to your Cashfree Dashboard, navigate to Payment Gateway, and select FlowWise.
- In the Configure screen, click Add Configuration and enter a unique Name and Description to identify the rule.
Rules
to this Configuration
object. A rule
objects represents a condition like:
IF Payment Mode is
CREDIT CARD
AND IF Bank is HDFC Bank
- Simple Rule: This must always be set as this is the default rule for a
Configuration
object. - Advanced Rule: This is optional and should be used for advanced routing configuration.
Add a Simple rule
To configure a simple rule, just select a payment gateway from your configured gateways.Adding an Advanced rule
Advanced rule can be used when you want to route payments based on various parameters such as payment method, bank, card networks, and more. For example: you may want to send all UPI transactions through Cashfree and PayU, and want to ensure routing such that Flowwise ensures the best gateway at any point in time. Let’s assume we want to add create the following rule: Create a configuration which routes netbanking transactions for major banks (HDFC, ICICI, YES, SBI, AXIS, KOTAK) to PayU and Razorpay, and all other banks to PayTM. Route all other types of transactions to Cashfree (such as UPI, Cards etc)1
Step 1
Select
Rule 1
and set When Payment Method IS Net Banking
2
Add conditions to this rule
Add a conditional (AND) within Rule 1, since we need netbanking as well as bank names
AND When Issuing Bank IN HDFC, ICICI, YES, SBI, AXIS, KOTAK
3
Add conditions to this rule
Add a conditional (AND) within Rule 1, since we need netbanking as well as bank names
AND When Issuing Bank IN HDFC, ICICI, YES, SBI, AXIS, KOTAK
4
Decide Routing
Now, that we have a rule we need to add gateways to this rule. Since we wanted to add PayU and Razorpay to this rule, we also need to decide how should routing take place between these two gateways. Recall our dynamic routing options. Let’s assume that we decide on ‘Smart Routing’ because we want to maximize the success rate.
We select ‘Smart Routing’ since we want maximum success rate.
5
Add gateways
From dropdown in ‘Select Gateways’, we select PayU and Razorpay. We need to ensure that both gateways are active. This completes Rule #1.
6
Add Rule 2
Now we are left with routing rule for other banks. As in step 2 above, we now add the following rule
When Payment Method IS Net Banking AND When Issuing Bank NOT IN HDFC, ICICI, YES, SBI, AXIS, KOTAK
. Note that we are using the NOT IN
operator since we want to exclude these banks.7
Add gateway for Rule 2
From dropdown in ‘Select Gateways’, we select PayTm