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.

Set up gateway routing

This process describes how to configure 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, press Settings .
    2. In the Configuration section, press Gateway accounts.
    3. Select a gateway account.
    4. Press 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. 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.

    1. In the left navigation bar, press Automations .
    2. In the Rules engine section, press Rules engine.
    3. Press Core events.
    4. Press the Gateway account requested event.
    5. Press Rule set, then press Create rule.
    6. In the Name field, enter a unique name to help differentiate between multiple rules.
    7. Optionally, to add labels that help you identify the rule: In the Labels field, add one or more labels.
    8. Optionally, to not stop further processing after this rule is executed: clear the Stop further processing checkbox.
  3. 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.

    1. In the Conditions section, clear the No conditions checkbox.
    2. 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.
  4. Configure the action to route transactions to a gateway accounts

    This step describes how to configure an action to route transactions to a payment gateway accounts based on weights assigned to each gateway account, and routing algorithm. Use weights to configure the probability of a gateway being selected to process a transaction. For more information, see Weights.

    1. In the Actions section, press Add action, then select Pick gateway account.
    2. In the Weight algorithm section, select the Weighted-random or Round-robin routing algorithm.
    3. 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.
    4. 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:

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