Payment Gateways 

The virtual equivalent of a credit card machine, a payment gateway is your portal to accepting online payments (everything from card payments to direct debit payments to payments via online wallets).

Chargebee supports a host of payment gateways with which you can get an account and start processing payments. When you have a payment gateway (and a merchant account, depending on which payment gateway you decide to use) in place, the next step would be configuring your payment gateway in Chargebee.

To configure a payment gateway, login to the web interface, and navigate to Settings > Configure Chargebee > Payment Gateways. Click Add a Gateway and choose your gateway from the list to get started.

Supported Gateways and Payment Methods 

You can find the detailed information of the payment methods supported by the payment gateways by navigating to the dedicated document for each gateway from the left navigation menu.

Setting up multiple gateway accounts 

Chargebee supports configuring multiple gateway accounts (you can configure the accounts you have with Stripe, Braintree and so on) on both your test site and live site.

If you have multiple accounts with a particular gateway (for example, multiple Authorize.net accounts to process multiple currencies), you can link them all to your Chargebee site.

Note to API Users: If you are an API user, before configuring multiple gateway accounts of a same gateway type, ensure to make these API changes   to avoid getting the error.

Smart Routing 

When your customer adds a payment method on checkout or updates their payment details, a gateway account must be linked to it. All the customer's future payments made using this payment method are processed through this gateway account.

With the Smart Routing feature, you can configure rules for automatically picking a gateway account based on the payment method that the customer chooses and the currency of the transaction, so that gateway account can be assigned by Chargebee automatically.

To illustrate what Smart Routing looks like in action, imagine that you have enabled multiple currencies in your Chargebee site, and have enabled your customer to pay you via Card and Direct Debit. Working within our example, this means that you can configure separate payment gateway accounts for card payments and direct debit payments in each currency. Once configured, your Smart Routing page would look like this:

Configuring/reviewing your Smart Routing rules is a mandatory step in your gateway configuration as it informs Chargebee of which gateway account to use for the payment method types and currencies that you have enabled in your site. It also presents a good opportunity to check if there are certain currencies that are not linked to a payment gateway account.

It's possible to explicitly specify a gateway account via the API (though it's not generally needed as it will be picked based on the Smart Routing rules). You can choose the gateway account to associate with a payment method type using the gateway_account_id param in any of the following API calls:

1) Create a subscription 
2) Update a subscription 
3) Import a subscription 
4) Create a customer 
5) Update payment method for the customer 
6) Checkout a new subscription  
7) Checkout an existing subscription 
8) Update payment method  
9) Update card for the customer 

Points to note 

  • If you have enabled Multiple Currencies make sure to configure the necessary gateway accounts for processing them. If a currency is not associated with a gateway account, Chargebee will not be able to process the transaction.

  • Payment method types without a gateway account preference in the Smart Routing page will not show up as an option for your customer to choose on checkout.

  • Changing the Smart Routing rules will only affect the gateway accounts linked to the new payment methods added to the system. The gateway accounts linked to the existing payment methods are not affected by changes on the Smart Routing page.

Testing the Payment flow 

After configuring a gateway in either the test site or live site, it is advisable to perform test transactions in order to ensure proper functioning of the payment flow. Testing ensures that the workflow beginning from the customer making payments to the collection of payments, functions as expected.

Was this article helpful?
Loading…