Last updated 5 months ago

Intelligent payment routing

Prerequisites

  • Multiple connected gateway accounts

Gateway account selection

Gateway account selection happens during transaction processing.

A customer uses a payment instrument to complete a transaction. The payment instrument has a property: sticky gateway account ID.

  1. If the transaction's payment instrument has a sticky gateway account ID and it is eligible to be used for the transaction, it is selected for processing, Otherwise, continue...
  2. The "gateway account was requested" event will trigger the rules engine to evaluate the transaction and find the best configured match for the transaction. The gateway account will be selected. However, if no eligible gateway account was selected, then continue...
  3. A random eligible gateway account was selected. If you have only one eligible account per transaction, because, for example, you have one per currency or payment method, then you may not need to craft any rules.

Sticky gateway accounts

Assignment of sticky gateway account ID

By default, Rebilly will assign a sticky gateway account ID to a payment instrument when there is an approved transaction for that payment instrument.

This is considered a good practice to keep future purchases, such as a rebills, on the same gateway account. However, if you have a specific business need that is not compatible with the stickiness, then disable the behavior.

Settings

Rebilly has two levels of sticky gateway account behavior. It can be enabled/disabled on a per gateway account basis.

Transfer of sticky gateway account ID

The sticky gateway account ID associated with a gateway account can be changed three ways:

  • Using our web interface from the customer detail > payment instruments tile to change one at a time.
  • Using our API to change one at a time.
  • Using our utility to change transfer all payment instruments with a given sticky gateway account ID to a different sticky gateway account ID.

Pick gateway account settings

Within the "gateway account requested" event, configure your settings for the pick gateway account rule based on a weighted-random or round-robin approach and set the weighted distribution.

Note: This process only pertains to transactions initiated with payment instruments that do not have a sticky gateway account ID assigned.

Weighted-random

Each time the rule is triggered, the transaction will randomly choose a gateway account based on the weighted distribution.

For example, using this distribution

exclude a gateway account

When a transaction is initiated, the transaction has an

  • 80% chance of choosing Gateway account A
  • 10% chance of choosing Gateway account B
  • 10% chance of choosing Gateway account C
  • 0% chance or choosing Gateway account D

Round-robin

Using the weighted-random approach, the transactions will be distributed across the gateway accounts, across many customers. But for any given customer, the transaction distribution is less random.

When enabled, the round-robin approach ensures that the transactions for a given payment instrument rotate across the available gateway accounts. This approach works by removing a selected gateway account from the picking process for the next tranaction initiated with that payment instrument.

Using the example from above, Sandy initiates a transaction. Her first transaction has an

  • 80% chance of choosing Gateway account A
  • 10% chance of choosing Gateway account B
  • 10% chance of choosing Gateway account C
  • 0% chance or choosing Gateway account D

Her first transaction chooses Gateway account A and this account is removed from the picking process for her second transaction. Her second transaction has a

  • 50% chance of choosing Gateway account B
  • 50% chance of choosing Gateway account C
  • 0% chance of choosing Gateway account D

Her second transaction chooses Gateway account C and this account is removed from the picking process for her third transaction. Her third transaction has a

  • 100% chance of choosing Gateway account B
  • 0% chance of choosing Gateway account D

Her third transaction chooses Gateway account B and the account is removed from the picking process. Now, there are no more available gateways. Her fourth transaction will start at the top again, and so on and so forth.