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
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.
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.
Selecting a Gateway
You may select and connect multiple gateways in Advanced Billing while still using your current gateway.
- Go to Config > Payment Gateways and select "+ Add Gateway".
- 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".
- 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.
- 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.
The gateway setup is now complete.
Any changes to the gateway can be made by going into the "Gateway Settings" of said gateway.