Introducing the Chargebee CLI

Affirm via Adyen

This feature is currently a Private Beta release. Contact Chargebee Support to enable Affirm via Adyen for your live and test sites.

Affirm is a Buy Now, Pay Later (BNPL) payment method that lets customers in the United States and Canada split a purchase into installments and pay Affirm over time. Affirm pays the purchase amount upfront, and Adyen settles it to your merchant account. Affirm then collects the installments from the customer.

With Chargebee, you can configure and process Affirm payments through the Adyen payment gateway. Affirm via Adyen is a one-time payment method with a redirect-based flow: the customer completes the purchase on Affirm and returns to Chargebee, and Adyen confirms the final status asynchronously through webhooks.

Supported countries and currencies

Affirm via Adyen supports the following countries and currencies.

CountryCurrency
United StatesUSD
CanadaCAD

Payment features and workflows

Adyen confirms the final Affirm status asynchronously through webhooks.

  • Capture — Chargebee captures the payment right after Affirm authorizes it, which starts the customer's Affirm repayment schedule.
  • Upfront payment — you receive the purchase amount upfront, while Affirm collects the installments from the customer.
  • Transaction initiation — each Affirm payment is customer-present. Chargebee does not save Affirm for a later merchant-initiated charge.
  • Adding Affirm in the Chargebee app — customers can't add Affirm from the customer portal, and you can't add it in the Chargebee app.
  • Verification — not applicable. The customer approves each purchase on Affirm. Chargebee doesn't run a separate verification.
  • Regulatory requirements — not applicable in Chargebee. Affirm shows its loan terms and disclosures to the customer on the Affirm page.
  • Statement descriptor — not supported. Chargebee doesn't send a statement descriptor to Adyen for Affirm payments.
  • Chargeback management — not supported. Chargebee doesn't receive or process disputes for Affirm payments.
  • Fraud management — not applicable. Affirm runs its own eligibility check on the customer. Chargebee doesn't send fraud or risk data to Adyen for Affirm payments.
  • Error intelligence — a failed Affirm payment shows the refusal reason that Adyen returns. Affirm has no Affirm-specific error codes. See Error codes and troubleshooting.
  • Gateway transaction details — the transaction's id_at_gateway is the Adyen pspReference. See Reconciliation for Affirm payments.

Where you can use Affirm

Affirm is available on the Chargebee surfaces that collect a one-time payment. The following table summarizes where customers can pay with Affirm.

SurfaceAffirm availabilitySaved for later use
Checkout for subscriptionsYes, when one-time payment methods are allowed for subscriptionsNo
Checkout one-timeYesNo
Pay Now or Collect NowYesNo
Customer portalCustomers can't add Affirm as a payment methodNo

Refunds for Affirm payments

You can issue full and partial refunds for an Affirm payment from Chargebee.

Prerequisites

To accept Affirm payments, meet the following conditions:

  • You have the Adyen payment gateway configured in Chargebee, with webhooks enabled. Webhooks are mandatory because Adyen confirms the Affirm payment status asynchronously.
  • Affirm has approved you as a merchant, and Affirm is added as a payment method on your Adyen merchant account. Learn more.
  • For testing, you have Affirm test credentials, which you request from Affirm. For live payments, you've submitted a request for Affirm in your live Adyen Customer Area and provided your Affirm live credentials to Adyen.
  • At least one supported currency — USD or CAD — is enabled for your Chargebee site.
  • The Capture Delay setting of your Adyen account is synced with Chargebee. See Capture Delay Setting.
  • Your checkout collects the customer's first and last name, email address, phone number, and complete billing address, including the state or province and postal code. If you use Chargebee Hosted Pages, make the phone number field mandatory.

Integration options

You can integrate Affirm via Adyen using the following methods:

Integration methodDescription
In-App CheckoutCustomers pay with Affirm in Chargebee's In-App Checkout.
Full-Page CheckoutCustomers pay with Affirm in Chargebee's Full-Page Checkout.
Chargebee.jsEmbed Affirm as a payment method in your custom checkout using Chargebee.js.
Payment ComponentsCustomers pay with Affirm in Chargebee Payment Components embedded in your checkout.
API (Payment Intent)Process Affirm payments using Chargebee APIs for a fully custom checkout and payment flow.

Supported token formats

This integration supports the following token. Affirm is a one-time payment method, so it doesn't support a permanent token.

TokenDescriptionFormat and Sample
Chargebee Payment Intent IDThis is the Payment Intent ID returned after a successful authorization using Chargebee.js.Format: payment_intent[id]

Configure Affirm via Adyen in Chargebee

Follow these steps to configure Affirm via Adyen in your Chargebee site:

  1. Log in to the Chargebee app.
  2. Go to Settings > Configure Chargebee > Payment Gateways.
  3. Select the relevant Adyen instance from the list.
  4. Turn on Affirm.
  5. Click Apply to save your changes.

Configure Smart Routing for Affirm

After you turn on Affirm, follow these steps to configure Smart Routing for it:

  1. Go to Settings > Configure Chargebee > Payment Gateways.
  2. Click Manage Rules under Smart Routing.
  3. Under For Affirm, a row appears for each currency enabled on your site (USD or CAD). Click Add a gateway when no gateway is assigned. When a gateway is already assigned, click the edit icon.
  4. Select your Adyen instance from the Choose a payment gateway dropdown, and then click Save.

Enable Affirm to pay for subscriptions

To let customers pay the first subscription invoice at checkout with Affirm, allow one-time payment methods for subscriptions on your Chargebee site.

Follow these steps to enable one-time payment methods for subscriptions:

  1. In the Chargebee app, go to Settings > Configure Chargebee > Checkout & Self-Serve Portal.
  2. Select the Configuration tab, and then turn on Allow customers to pay for subscriptions with payment methods that only support one-time payments.

After you enable this setting, Affirm appears on subscription checkouts. Customers can pay a renewal invoice through Pay Now, or with another saved payment method.

Make the phone number field mandatory

Affirm needs the customer's phone number to process a payment. If you use Chargebee Hosted Pages, follow these steps to make the Phone field mandatory at checkout:

  1. In the Chargebee app, go to Settings > Configure Chargebee > Checkout & Self-Serve Portal.
  2. Select the Fields tab, and then select Account Information.
  3. Turn on the Phone toggle.
  4. Click the edit icon next to Phone, set In checkout to Mandatory, and then click Apply.
  5. Click Publish.

Configure webhook notifications for Affirm

Affirm via Adyen confirms payment status asynchronously. Configure Adyen webhooks in Chargebee before you accept live Affirm payments. Follow the webhook setup steps in Configure Webhook Notifications on the Adyen payment gateway page.

Checkout flow with Affirm

When a customer selects Affirm in Chargebee's checkout, the payment flow is as follows:

  1. The customer clicks Proceed to Checkout to start a purchase.
  2. The customer enters their first and last name, email address, phone number, and billing address, including the state or province and postal code.
  3. On the Add your payment details page, the customer selects Affirm, and then clicks Next.
  4. On the Complete your order page, the customer clicks the pay button. The button includes the order total, for example Pay $550.00 & subscribe.
  5. On the Affirm page, the customer verifies the phone number, chooses a payment plan, reviews the terms, and confirms the purchase.
  6. After confirmation, Chargebee shows its thank-you page. If you set a redirect URL on the plan, Chargebee sends the customer there instead. Adyen confirms the final payment status asynchronously, so check the transaction before you treat the payment as successful.

Chargebee can't process an Affirm payment without the customer's first and last name, email address, and phone number. Make sure the billing address is complete and accurate, including the state or province and postal code.

Choose an Affirm financing program

Your Affirm financing program decides which payment plans Affirm can offer your customers, and the annual percentage rate (APR) that customers pay on each plan. For the payment plans and customer APR of each financing program, see Affirm financing packages. For pricing, see Adyen pricing.

When a customer is redirected to Affirm, Affirm runs a real-time eligibility check and shows the payment plans available under your program. The customer chooses a plan and completes the purchase. After Chargebee captures the payment, Affirm starts the repayment schedule and collects the installments from the customer directly.

Review Affirm payments

To review an Affirm transaction:

  1. In your Chargebee site, go to Logs > Transactions.
  2. Select the transaction to open its details.

Test Affirm via Adyen

Sandbox testing for Affirm

Test Affirm on your Chargebee test site with the Adyen test environment. Chargebee doesn't issue Affirm test credentials; request them from Affirm.

Follow these steps to run a sandbox test:

  1. Confirm that Affirm is enabled in your Adyen test Customer Area and in your Chargebee test site, and that Adyen webhooks point to your test site.
  2. Start a checkout in USD with a United States billing address, or in CAD with a Canadian billing address. Enter a valid address and mobile phone number; Affirm can't process the test if the address or phone number isn't valid.
  3. On the Affirm page, sign in with an existing sandbox account, or create one by following the steps in Affirm's sandbox testing guide.
  4. When Affirm asks for a verification code, enter 1234. The Affirm sandbox doesn't send a text message, so you don't need access to the phone number. See Affirm's sandbox testing guide.
  5. Complete the Affirm checkout and confirm the payment.
  6. Check the payment status in your Adyen test Customer Area under Payments > Payment list, and confirm the transaction in your Chargebee test site.

Production testing for Affirm

Before going live:

  • Ensure Affirm has provided your live credentials, and that you've submitted a request for Affirm in your live Adyen Customer Area.
  • Turn on Affirm in Chargebee, and make sure Affirm is enabled in your Adyen Customer Area.
  • Confirm that the Capture Delay setting in Chargebee matches your Adyen account.
  • Coordinate any live end-to-end test purchase with Affirm.
  • Don't use your personal Affirm account for a live test purchase.

Reconciliation for Affirm payments

For financial reconciliation between Chargebee and Adyen:

  • Use the Chargebee transaction field id_at_gateway, which maps to the pspReference in Adyen.

Follow these steps to reconcile transactions:

  1. Retrieve the id_at_gateway value from the Chargebee transaction details.
  2. Locate the corresponding pspReference in Adyen reports for Affirm transactions.
  3. Match transactions using this reference to ensure financial consistency.

Error codes and troubleshooting

Affirm via Adyen has no Affirm-specific error codes. When a payment fails, open the transaction in Chargebee to see the refusal reason that Adyen returned. For how Chargebee classifies payment failures, see Payment errors.

IssueCauseResolution
The payment fails before the redirect to AffirmThe customer's first or last name, email address, phone number, or part of the billing address is missing. Affirm needs the street, city, state or province, postal code, and country.Make these fields mandatory in your checkout, or pass them in your API request. See Make the phone number field mandatory.

Limitations and important points

Keep the following limitations in mind when offering Affirm via Adyen:

  • Affirm via Adyen supports USD and CAD only. Affirm accepts purchases from USD 35 to USD 30,000 in the United States and from CAD 50 to CAD 30,000 in Canada. Learn more.
  • Affirm is a one-time payment method. Chargebee doesn't save Affirm as a payment method, so Affirm can't be used for automatic subscription renewals. Each Affirm payment requires the customer to complete the purchase on Affirm.
  • Affirm appears on subscription checkouts only when Allow customers to pay for subscriptions with payment methods that only support one-time payments is enabled.
  • Customers can't add Affirm as a payment method from the customer portal, and you can't add it in the Chargebee app.
  • Chargebee captures Affirm payments right after authorization, and the capture starts the customer's Affirm repayment schedule. An Affirm authorization that isn't captured within 28 days expires.
  • Affirm requires the customer's first and last name, email address, phone number, and a complete billing address, including the state or province and postal code.