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 Chargify 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 Chargify 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 Chargify 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 Chargify Site mode (test vs. production) and your type of gateway (test vs. live)

Connecting with multiple gateways

The Multi-Gateway feature allows you to connect a single site with multiple gateways and is available on request. Please contact support for more information.

Connected gateways

The following section about Selecting a Gateway applies to the current, pre Multi-Gateway behavior. Contrary to its content, in a multi-gateway environment are no limitations about selecting a different gateway if your site contains some payment profiles.
In a multi-gateway environment, you can always connect with another available gateway. You can’t disconnect from a given gateway if it stores payment profiles, though.

There are three new terms associated with the Multi-Gateway feature: 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.

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. 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.

Selecting a Gateway

You may select a different gateway in Chargify only if your current site contains zero payment profiles.

While working in a test environment, you may also consider clearing your Site data for a quick way to “reset” your Site and change gateways. Clearing the current site data is not available for sites in live mode.

Click “Use this Gateway” next to the name of your gateway provider. Some providers may be disabled if they do not support the Site’s selected currency or if the site already has subscriptions.

Select a new gateway in Chargify

And then enter your gateway credentials.

Enter gateway credentials

All fields are required. The credentials requested for your gateway should be provided by your gateway, either via email or in their administrative interface. Be sure that you are entering your test credentials for a test site or live credentials for a production site.

Changing your Payment Gateway

If you need to change gateways, you may either delete all of the payment profiles within your Site, create another Site, or follow the Gateway Change Process.

Chargify does not recommend changing the credentials for a live site. If credentials are changed for a live site, existing payment profiles may become inactive.