Payment gateway routing
Payment gateway routing is the process of dynamically routing transactions between payment gateways, based on real-time data and selected parameters. To configure payment routing you must have more than one gateway account connected to Rebilly. This automation uses the Gateway account requested event and the Pick gateway account action.
If you have not yet added a payment gateway, see Add gateway account. To configure payment routing you must have more than one gateway account connected to Rebilly.
Set up gateway routing
This process describes how to configure gateway routing.
Optionally, deactivate sticky gateways
Gateway routing is optimal on gateways that do not have the sticky gateways option activated. If sticky gateways is active when using gateway routing, a gateway is only available to:
- New payment instruments that were not used on a gateway — a sticky gateway account ID is not applied.
- Payment instruments that have not completed a successful transaction on another gateway.
- In the left navigation bar, press Settings .
- In the Configuration section, press Gateway accounts.
- Select a gateway account.
- Press Edit gateway account.
- In the Advanced configuration section, turn on the Advanced configuration toggle.
- Under Sticky gateway account, clear the Activate sticky gateway checkbox. For more information, see Sticky gateway accounts.
Create an automation on the 'gateway account requested' event
This step describes how to create an automation that is triggered when a customer attempts to make a transaction for the first time.
- In the left navigation bar, press Automations .
- In the Rules engine section, press Rules engine.
- Press Core events.
- Press the Gateway account requested event.
- Press Rule set, then press Create rule.
- In the Name field, enter a unique name to help differentiate between multiple rules.
- Optionally, to add labels that help you identify the rule: In the Labels field, add one or more labels.
- Optionally, to not stop further processing after this rule is executed: clear the Stop further processing checkbox.
Optionally, configure conditions that determine when a transaction is routed
Complete this step to configure conditions that determine when a transaction is routed to specific gateway accounts. For example, based on certain conditions, such as: payment card attributes, bank country, currency, and so on.
- In the Conditions section, clear the No conditions checkbox.
- In the Select filter field, select the filters you want to apply.
Examples:- To route based on the customer's address being in the US: Select 'Transaction > Customer > Primary address > Country'
is in
'US - United States'. - To route based on the USD currency: Select 'Transaction > Currency'
is in
'USD - US Dollar'. - To route based on a custom field that is created on the customer resource: Create a custom field, then select 'Transaction > Customer > Custom fields > 'Field name''.
- To route based on whether a customer related value is not in a list of values: Create a value list, then use a similar condition to this example: 'Transaction > Customer > Primary address > Emails > Value'
is not in
'Value list name'. - To route based on tags that are assigned to the customer: Select 'Transaction > Customer > Tags > Name'
is in
'Tag name'. For more information, see Tags.
- To route based on the customer's address being in the US: Select 'Transaction > Customer > Primary address > Country'
Configure the action to route transactions to gateway accounts
This step describes how to configure an action to route transactions to payment gateway accounts based on the weights assigned to each gateway account and the routing algorithm. Use weights to configure the probability of a gateway being selected to process a transaction. For more information, see Weights.
- In the Actions section, press Add action, then select Pick gateway account.
- In the Weight algorithm section, select the Weighted-random or Round-robin routing algorithm.
- In the Weight distribution section:
- To distribute weight based on gateway account, select Use gateway account weights.
- To distribute weight based on acquirer, select Use acquirer weights.
- Assign weights to each payment gateway.
To configure which payment methods are displayed to the customer at payment, based on their geographic location, see Display payment methods by location.
Weights
This section describes the transaction routing weights that are available in Rebilly.
Weighted-random
When this rule is activate, a transaction is randomly assigned to a gateway account based on the specified weighted distribution. Gateways with higher weight values have a higher chance of getting selected.
For example, 4 gateway accounts are set as follows:
Value | Gateway | Chance of processing a transaction |
---|---|---|
70 | Gateway A | 70% |
15 | Gateway B | 15% |
10 | Gateway C | 10% |
5 | Gateway D | 5% |
Round-robin
When this rule is activate, a transaction is randomly assigned to a gateway account based on the specified weighted distribution. Gateways with higher weight values have a higher chance of getting selected. Each time a gateway is used, it is then removed from the next round. When the last gateway is used, and no other gateways remain, the process begins again.
For example, 4 gateway accounts are set as follows, and the same payment instrument carries out transactions over a period of time:
Round one
Value | Gateway | Chance of processing a transaction |
---|---|---|
70 | Gateway A | 70% |
15 | Gateway B | 15% |
10 | Gateway C | 10% |
5 | Gateway D | 5% |
Round two
Value | Gateway | Chance of processing a transaction |
---|---|---|
15 | Gateway B | 49.98 |
10 | Gateway C | 33.33% |
5 | Gateway D | 16.66% |
Round three
Value | Gateway | Chance of processing a transaction |
---|---|---|
10 | Gateway C | 66.66% |
5 | Gateway D | 33.33% |
Round four
Value | Gateway | Chance of processing a transaction |
---|---|---|
5 | Gateway D | 100% |
Round five
Value | Gateway | Chance of processing a transaction |
---|---|---|
70 | Gateway A | 70% |
15 | Gateway B | 15% |
10 | Gateway C | 10% |
5 | Gateway D | 5% |
Sticky gateway accounts
By default, Rebilly assigns a sticky gateway account ID to a payment instrument when it performs an approved transaction on a payment gateway. On first use, the selection of this payment gateway is random. From this point on, the sticky gateway account ID is used to bind the payment instrument to that particular payment gateway, so that all future payments are processed by the same payment gateway.
When gateway payment routing is active:
- If the payment instrument does not have a sticky gateway account ID: The rules engine evaluates the transaction and finds the best gateway account to process the transaction.
-Or-
- If a payment instrument has a sticky gateway account ID assigned: The associated gateway is selected to process the transaction.