Introducing the Chargebee CLI

Payment Method Helper

Overview

The Payment Method Helper is a Chargebee.js feature that lets you integrate a range of payment methods into your web pages through your preferred payment gateways. It abstracts away the differences between payment methods, which makes the integration simpler.

For the payment methods each gateway supports, see Payment gateways.

Advantages

  • Integrate every payment method you accept with one uniform integration.
  • Switch payment gateways as needed.
  • Abstract away PCI compliance.
  • Support a wide range of gateways.
  • Pair with the gateway JS of your choice.
  • Sync payments to Chargebee with the Chargebee APIs.

Workflow

  1. Create a payment intent with the Chargebee APIs.
  2. Process the payment with a Chargebee.js payment method helper.
  3. After successful authorization, you receive an authorized payment intent.
  4. On your server, use the payment intent ID with one of the following APIs:

Set up Chargebee.js

Include the Chargebee.js script

To use Chargebee.js, include the script in your HTML page. You only need to do this once per page.

<script src="https://js.chargebee.com/v2/chargebee.js"></script>

Initialize a Chargebee instance

After including the script, initialize Chargebee.js in your JavaScript. Initialization creates a Chargebee instance object that gives you access to Chargebee.js features.

Initialize Chargebee.js after the page has loaded, and provide your site configuration. This object is used to create components.

const chargebee = Chargebee.init({
  site: "YOUR_CHARGEBEE_BILLING_SUBDOMAIN", // Your test site.
  domain: "https://mybilling.acme.com", // Optional: custom domain.
  publishableKey: "test__"
});

Supported payment methods

Each payment method below links to its own step-by-step integration guide. For all of them in one place, see the Payment Method Helper tutorials.

Card payments

Chargebee.js supports card-based payments through Bancontact, the market leader for online and in-store card transactions in Belgium. Bancontact is available through four gateways:

  • Adyen, which processes payments in multiple currencies and suits businesses with an international customer base.
  • Checkout.com, which offers a broad range of payment options and fraud protection.
  • Mollie, which provides a variety of payment methods and a dashboard to monitor payment performance.
  • Stripe, which is known for its developer tooling and extensive documentation.

Guide: Bancontact.

Bank payments

Bank payments let customers transact securely using direct transfers from their bank accounts. Chargebee.js supports the following:

  • Netbanking — pay directly from a bank account. Supported through Razorpay, and one of the most common payment methods in India. Guide: Netbanking.
  • UPI (Unified Payments Interface) — transfer funds between bank accounts from a mobile app. Supported through Razorpay, and widely used in India. Guide: UPI.
  • iDEAL — a preferred method in the Netherlands that lets customers buy online through direct bank transfers. Guide: iDEAL.
  • SOFORT (Pay now with Klarna) — a popular online banking method available in Germany, Austria, the Netherlands, Switzerland, Italy, Spain, Belgium, and Poland. Guides: SOFORT and Klarna Pay Now.
  • Dotpay — bank payments in Poland. Guide: Online banking Poland.
  • Direct debit — funds withdrawn directly from a customer's bank account, commonly used for recurring payments. Guide: Direct debit.

Wallet payments

A digital wallet stores payment information such as card details and makes online transactions quicker. Chargebee.js supports the following wallets:

  • Google Pay — supported through Braintree and Stripe, for quick and secure payments on Android. Guide: Google Pay.
  • PayPal — supported through Braintree, PayPal Express Checkout, and PayPal Commerce. Guide: PayPal.
  • Apple Pay — supported through Adyen, Stripe, and Braintree, for payments from Apple devices. Guide: Apple Pay.
  • Venmo — supported through Braintree, and popular with mobile-first users. Guide: Venmo.
  • Payconiq by Bancontact — a European mobile payment solution for online and in-store payments that settles instantly in EUR. Supported through Adyen. Guide: Payconiq by Bancontact.

Voucher payments

Vouchers let customers complete an online purchase by paying in person at an authorized location, such as a convenience store. They are useful for:

  • Businesses serving customers without a debit card, credit card, or bank account.
  • Merchants targeting countries with low card authorization rates, where an alternative payment method can raise conversion.

Vouchers also keep a record of payments made in cash or through bank transactions. Chargebee.js lets you create, manage, and validate them.

Guide: Boleto via Stripe.

Cryptocurrency payments

Cryptocurrency payments let customers pay with blockchain-based digital currencies. Chargebee.js supports stablecoins, whose value is pegged to a stable real-world asset, most commonly a fiat currency such as USD or EUR.

Guide: Stablecoin via Stripe.