# Manage payment gateways

This topic describes how to manage payment gateways that are connected to Rebilly.
For information on how to add and set up a payment gateway, see [Set up a payment gateway](/docs/settings/set-up-a-gateway).

## Activate or deactivate a gateway

Use this process to activate or deactivate a payment gateway that is connected to Rebilly.

1. In the left navigation bar, press **Settings**.
2. In the **Configuration** section, press **Gateway accounts**.
3. In the ID column, press a gateway account.
4. Select from the following:
  - Edit a gateway account: Press **Edit gateway account**.
  - Activate or deactivate a gateway account: Turn on or off the **Activate gateway account** toggle.
  - Close a gateway account: Press **Close**.


## Create a downtime schedule

Use this process to schedule downtime or maintenance for a payment gateway.
The downtime schedule feature diverts incoming transactions to another available gateway until the downtime expires.
For more information, see [Payment gateway routing](/docs/settings/gateway-routing).

Before you schedule downtime, ensure that at least one gateway account is active for this currency, website, and payment method.
If no other gateway is available, the transaction is declined with the error message: "No gateway account available to process this transaction".

1. [Log in or sign up to Rebilly](https://app-sandbox.rebilly.com/).
2. Select an environment: In the top right corner of the page, press your initials, then select an environment.
3. In the left navigation bar, press **Settings**.
4. In the **Configuration** section, press **Gateway accounts**.
5. In the ID column, select the name of the gateway.
6. Press **Add downtime schedule**.
7. Add a downtime details, and press **Save**.


## View ongoing downtime

Use this process to view ongoing downtime for a payment gateway account.

If a gateway is down, transactions are automatically routed to another gateway if one is available.
If no other gateway is available, the transaction is declined with the error message: "No gateway account available to process this transaction".

Ensure that at least one gateway account is active for this currency, website, and payment method.

1. [Log in or sign up to Rebilly](https://app-sandbox.rebilly.com/).
2. In the left navigation bar, press **Settings**.
3. In the **Configuration** section, press **Gateway accounts**.
4. In the list of gateways, the **Ongoing downtime** column indicates if a gateway is down.
If the gateway is down, the column displays **Yes**.
If the gateway is not down, the column displays **No**.


## Set volume limits

Use volume limits to limit the amount of money, or number of transactions, that a gateway account can process daily or monthly.
When a volume limit is reached, the gateway account enters scheduled downtime until the frequency period expires.

If a new transaction is initiated during this period, and a weighted distribution rule is configured, the gateway with ongoing downtime is not considered.
If no gateway account is available, the transaction is declined.
For more information, see [Payment gateway routing](/docs/settings/gateway-routing).

1. [Log in or sign up to Rebilly](https://app-sandbox.rebilly.com/).
2. Select an environment: In the top right corner of the page, press your initials, then select an environment.
3. In the left navigation bar, press **Settings**.
4. In the **Configuration** section, press **Gateway accounts**.
5. In the ID column, select the name of the gateway.
6. Press **Set volume limits**.
7. Add a volume and press **Save**.


## Set payout limits

Use payout limits to control the amount that automatic payout allocation can assign to a gateway account.
Set a minimum amount per transaction, a maximum amount per transaction, a maximum amount per rolling 24-hour period, or any combination.
Each limit applies to one currency that the gateway account accepts.

Payout limits apply during automatic allocation only.
Manual allocations are not limited.
Payout limits are distinct from [volume limits](#set-volume-limits), which restrict deposit and sale processing.

To use payout limits on a gateway account, the gateway account must be configured to process payouts.
If the gateway is not configured to process payouts, the **Payout limits** section is not displayed.
To activate a gateway for payouts, see [Configure a gateway to manage payout requests](/docs/settings/set-up-a-gateway#optionally,-configure-how-the-gateway-manages-payout-requests).

1. [Log in or sign up to Rebilly](https://app-sandbox.rebilly.com/).
2. Select an environment: In the top right corner of the page, press your initials, then select an environment.
3. In the left navigation bar, press **Settings**.
4. In the **Configuration** section, press **Gateway accounts**.
5. In the ID column, select the name of the gateway.
6. In the **Payout limits** section, select from the following:
If a limit of the same type already exists for the selected currency, the new limit replaces it.
  1. Press **Add payout limit**.
  2. In the **Limit amount** field, enter the amount.
  3. In the **Currency** dropdown, select a currency.
  4. In the **Limit type** dropdown, select one of the following:
    - **Max per transaction**: Maximum amount for a single automatic allocation.
    - **Max per period**: Maximum amount for a rolling period.
    - **Min per transaction**: Minimum amount for a single automatic allocation.
  5. If the limit type is **Max per period**, in the **Period** dropdown, select **24 hours**.
  6. Press **Add**.

  1. On the right of the limit, press **Edit**.
  2. In the **Limit amount** field, enter the new amount.
  3. If the limit type is **Max per period**, in the **Period** dropdown, select **24 hours**.
  4. Press **Update**.

  1. On the right of the limit, press **Delete**.
  2. To confirm, press **Delete**.


## Skip unproven cards during suspected card testing

Payment card transactions that are recently declined are evaluated for each gateway account.
When the pattern matches suspected card testing, unproven payment cards are skipped on that gateway for a period of time.
Cards that have already had an approved transaction continue to use the gateway.
Unproven cards have a status of `inactive` or `verification-needed`.
Those cards are routed to the next suitable gateway.

If no other gateway account is available for an unproven card, the transaction is declined with mapped code `415` and the message: "No gateway account available for unproven payment cards".
Proven cards, rebills, capture, and query are not skipped for this reason.

When the skip window opens, a timeline message is added on the gateway account.
To view the message, see [View gateway events](#view-gateway-events).

## Pause gateway accounts during connectivity outages

Recent `sale` and `authorize` transactions are monitored on each gateway account for `timeout` and `conn-error` results.
If those results indicate a connectivity outage, the gateway account is flagged for temporary downtime.
While the downtime is active, transactions route to the next suitable gateway.

This protection is always on and does not require configuration.

If no other gateway account is available, the transaction is declined with mapped code `414` and the message: "No gateway account available to process this transaction".

When downtime starts, the gateway account timeline records the event, and the **Ongoing downtime** column displays **Yes**.
For more information, see [View ongoing downtime](#view-ongoing-downtime) and [View gateway events](#view-gateway-events).

To resume the gateway account before the pause ends, delete the downtime schedule.

## View gateway events

Use this process to view gateway account events and transactions, or added notes and attachments.

1. [Log in or sign up to Rebilly](https://app-sandbox.rebilly.com/).
2. Select an environment: In the top right corner of the page, press your initials, then select an environment.
3. In the left navigation bar, press **Settings**.
4. In the **Configuration** section, press **Gateway accounts**.
5. In the ID column, select the name of the gateway.
6. Scroll down to the **Timeline** section.
Timeline is a listing of all events and transitions that have occurred on a particular gateway.
To add a note, a tag, or an attachment, type in the text field beneath the **Timeline** label.


## Configure financial settings

Use this process to configure balance transaction settlements and risk reserves.
For more information, see [Balance transactions](/docs/dev-docs/balance-transactions).

1. [Log in or sign up to Rebilly](https://app-sandbox.rebilly.com/).
2. Select an environment: In the top right corner of the page, press your initials, then select an environment.
3. In the left navigation bar, press **Settings**.
4. In the **Configuration** section, press **Gateway accounts**.
5. In the ID column, select a gateway account.
6. In the **Financial settings** section, press **Configure settings**.
7. In the **Settlement currency** dropdown, select a currency.
8. In the **Settlement method** section, select from the following:
  1. Select the **Date-interval** method and specify the duration.
  2. Optionally, to more accurately schedule settlements, press **Set period anchor** and select one of the following:
    - **Day of month**: Select the day of the month and time.
    - **Day of week**: Select the week, day of the week, and time.

Select the **Immediately** method.
9.   1. Turn on the **Advanced settings** toggle.
  2. Press **Add filters** and specify which transactions these settings apply to.
These settings override the default fee settlement settings.
  3. In the **Settlement currency** dropdown, select a currency.
  4. In the **Settlement method** section, select from the following:
    1. Select the **Date-interval** method and specify the duration.
    2. Optionally, to more accurately schedule when settlements funds are settled, select **Set period anchor** and select one of the following:
      - **Day of month**: Select the day of the month and time.
      - **Day of week**: Select the week, day of the week, and time.

Select the **Immediately** method.
10.   1. Turn on the **Risk reserve settings** toggle.
  2. Press **Add filters** and specify which transactions the risk reserve settings apply to.
  3. To reserve a basis point of settled funds for a period of time, in the **Bips** (Basis points) field, enter a value.
  4. Enter the duration and select a unit of time.
  5. Optionally, to more accurately schedule when the risk reserves are released, select **Set period anchor** and select one of the following:
    - **Day of month**: Select the day of the month and time.
    - **Day of week**: Select the week, day of the week, and time.
  6. Optionally, to add additional risk reserve settings, press **Add risk reserve setting**.
11. Press **Save settings**.