Gateway Configuration

If you need an introduction to the purpose and function of Gateways and Merchant Accounts, or need help obtaining one, please see our FAQ on Payment Gateway Installations.

By default, your Site will be set to use the Advanced Billing Test Gateway. The Test Gateway is great for playing around, but in order to test your integration with a sandbox gateway, or to sell subscriptions using a real gateway, you will need to choose a gateway and enter your credentials.

The Advanced Billing Test Gateway

This gateway does not do any real authorizations or captures on credit cards. It allows you to simulate successful and unsuccessful credit card transactions.

When using the Advanced Billing Test Gateway:

  • Use the credit card number “1” to simulate a credit card in good status. All payments and authorizations will succeed.
  • Use the credit card number “2” to simulate a credit card that will not accept any payments. Authorizations will succeed.
  • Use the credit card number “3” to simulate a credit card in which all authorizations and payments will fail.

Sites in test mode connect to “Sandbox” gateways

Any Site that is in test mode will only work with gateways accounts that are provided as test, developer, or sandbox accounts from your gateway provider. Usually, these “test” gateways use a different URL than their production counterparts, and Sites that are in test mode will only connect to these URLs.

Sites in production mode connect to “Live” gateways

Any Site that is in production mode will only work with real, live gateway accounts. If you are experiencing problems with incorrect credentials, ensure that you don’t have a mismatch between your Advanced Billing Site mode (test vs. production) and your type of gateway (test vs. live)

Gateway Terms

There are three terms associated with the Gateways that should be known: Gateway Handle_Accepted Payment Types, and a Default Gateway for a given payment type.

Gateway Handle

Every gateway should have a unique gateway handle. A gateway handle must be specified when adding a gateway. A gateway handle can be passed via an API call or in chargify.js configuration to directly select which gateway a given payment profile should be stored in. It is required to use a gateway_handle attribute via API for the request to be processed correctly if you have connected multiple gateways from the same provider.

Accepted Payment Types

Each gateway supports given payment types. For example, Stripe supports credit cards and ACH, GoCardless supports Direct Debit only and Braintree supports credit cards and PayPal.

You can explicitly select which payment types should be accepted for a given gateway. You won’t be able to store payment profiles of a given type in a gateway if this payment type is not set as accepted for a given gateway.

For example, let’s assume that your Site is connected with Stripe among other gateways and ACH only is marked as an accepted payment type for Stripe. With these settings in place - you won’t be able to store credit cards in Stripe regardless of whether an attempt was made via chargify.js, user interface or the API. Only bank accounts can be created for Stripe.

If a given payment type is marked as accepted for a given gateway, this gateway can be selected as a default gateway for this payment type.

The default gateway for a given payment type

To become a default gateway for a given payment type, this gateway must accept a given payment type.

Default gateways behave differently than regular gateways.
If there is a default gateway for a given payment type, this payment type can be selected by a customer on the Public Signup Pages and Self Service Pages. Also when you pass payment profile attributes of the given type via API or chargify.js, a default gateway for this payment type is selected and a payment profile gets created in this gateway.

For example, if credit card attributes are being passed while creating a subscription or payment profile, a default gateway for credit cards is selected and a credit card is persisted in this gateway.
This behavior can be bypassed if a gateway handle is specified in the API call or the chargify.js configuration. In this case, a payment profile will be stored in the gateway that a gateway handle points to.

Please note that for Self Service Page and Billing Portal, having a default gateway for a given payment type means that during updates, the payment profile will always be stored in the default gateway for the payment type. This means that if a payment profile is stored in a gateway that is no longer the default for the given payment type, during update via Self Service Page or the Billing Portal, the payment profile will be stored as a new one in the now default gateway.

Custom gateway for Public Signup Pages

Public Signup Pages initially are using default gateway for a given payment type. That is, if a particular gateway is selected as the default, it will be used to process signup payment on PSP.

To override the default behaviour, the custom gateway can be selected for Public Signup Page. Each configured gateway can be associated with the payment profile for the specific public signup page. Each PSP has its own configuration and set of associated gateways.

custom_gateway_for_psp.png
Select custom gateway for PSP

 

Selecting a Gateway

You may select and connect multiple gateways in Advanced Billing while still using your current gateway.

  1. Go to Config > Payment Gateways and select "+ Add Gateway".
    2023-02-17_10-45-03.png
  2. Select the check marks next to the name of the desired gateway providers to connect. Some providers may be disabled if they do not support the Site’s selected currency or if the site already has subscriptions. Select "Continue".
    2023-02-17_11-04-45.png
  3.  Click the "Connect" buttons next to your selected gateways. A new window should appear prompting you to for connection details. Once all gateways are successfully connected, click the "Continue" button.
    2023-02-17_11-02-02.png
  4. Select how you would like payments routed through your gateways. This is mostly important for those who have multiple gateways. Once the setting are correct, click the "Finish" button.
    2023-02-17_11-06-01.png

The gateway setup is now complete. 

Any changes to the gateway can be made by going into the "Gateway Settings" of said gateway.

Was this article helpful?
0 out of 0 found this helpful