comecerodocs
Settings reference

Gateway weight

How the gateway weight decides which payment gateway takes a payment when more than one can, and how backup gateways and gateway attempts work.

When more than one active gateway can take a payment, Comecero picks one at random, weighted by each gateway's weight. A gateway can take a payment when it handles the payment method type, the currency and, for a card, the card brand.

Set the weight on the gateway in the dashboard under Gateways, or in the weight field of Update a gateway. The default is 1.

How the weight works

The chance that a gateway is picked is its weight divided by the total weight of the gateways that can take the payment.

GatewayWeightShare of payments
A100About half
B100About half
GatewayWeightShare of payments
A10About 1 in 11
B100About 10 in 11

A gateway with weight 0 is a backup. It is picked only after every gateway with a weight above 0, for example when they declined the payment.

Trying another gateway after a decline

When a card is declined and more than one gateway can take it, Comecero can try the next gateway in the weighted order. Maximum Gateway Attempts under Settings > Payment (max_gateway_attempts in Update payment settings) sets how many gateways to try in all. Set it to 1 to never try a second gateway. New accounts start at 2.

When the weight is not used

  • A payment method locked to a gateway. A saved card can be tied to the gateway that stored it, for example after that gateway updated the card number. That gateway goes first, even with weight 0. A card saved on Comecero Express Payments can only be charged there.
  • Comecero Express Payments first. When your account's own Comecero Express Payments gateways and Comecero's platform gateways can both take a payment, your Express gateways go first and the platform gateways are kept as backup.
  • A gateway you choose. A secret or trusted token can send gateway_id on a payment to use that gateway instead of letting Comecero choose (not on accounts on the reseller model).

On this page