Last updated

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.

To set up gateway routing:

  1. 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.
    1. In the left navigation bar, click Settings .
    2. In the Configuration section, click Gateway accounts.
    3. Select a gateway account.
    4. Click Edit gateway account.
    5. In the Advanced configuration section, turn on the Advanced configuration toggle.
    6. Under Sticky gateway account, clear the Activate sticky gateway checkbox. For more information, see Sticky gateway accounts.
  2. Set up routing:

    1. In the left navigation bar, click Automations .
    2. In the Rules engine section, click Rules engine.
    3. Click Core events.
    4. Click Gateway account requested.
    5. Click Rule set, then click Create rule.
    6. In the Rule name field, enter a descriptive name for the rule.
    7. In the Actions section, click Add action, then select Pick gateway account.
    8. In the Weight algorithm section, select the**Weighted-random** or Round-robin routing algorithm.
    9. 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.
    10. Configure the weights.

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:

ValueGatewayChance of processing a transaction
70Gateway A70%
15Gateway B15%
10Gateway C10%
5Gateway D5%

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

ValueGatewayChance of processing a transaction
70Gateway A70%
15Gateway B15%
10Gateway C10%
5Gateway D5%

Round two

ValueGatewayChance of processing a transaction
15Gateway B49.98
10Gateway C33.33%
5Gateway D16.66%

Round three

ValueGatewayChance of processing a transaction
10Gateway C66.66%
5Gateway D33.33%

Round four

ValueGatewayChance of processing a transaction
5Gateway D100%

Round five

ValueGatewayChance of processing a transaction
70Gateway A70%
15Gateway B15%
10Gateway C10%
5Gateway D5%

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.

Further reading