Partner Test and Go-Live

Use our sandbox environment to develop and test your integration.

Overview

Before deploying your Affirm integration, you should test it to ensure that both the user experience and your order management system perform as expected. Complete your front-end and order management testing while connected to our sandbox. 

See our sample test plan

🚧

Sample test plan

Not all tests may be applicable to your platform.

Admin configuration settings

Perform the following checks and tests while connected to our sandbox.

1. In the admin settings, add your sandbox public and private keys
2. Ensure that sandbox mode is enabled in the admin settings so that test transactions go to Affirm sandbox environment
3. Ensure that the default value for payment during checkout is set to Affirm. Refer to our Branding assets page.
4. Go to the checkout page to verify that Affirm displays as a payment option.
5. Follow the steps below to test your front-end (test for both Authorize Only and Authorize & Capture) and order management system.
6. Verify that Affirm does not display for non-US billing and shipping address.
7. Verify that the checkout object includes platform-specific metadata information
8. Verify that either the checkout object or the authorize/capture request includes the order_id (order_id is part of the settlement reports sent by Affirm and is used for reconciliation purposes)
9. Enable Affirm Promotional Messaging and verify placement on the following pages:

  • Home page / front page
  • Category page / product gallery / scroll
  • Product page
  • Cart or mini cart page

After you've tested your site, disable Affirm to verify that Affirm checkout and Affirm Promotional Messaging are no longer displayed.

Front-end testing (sandbox)

Initiate and complete the Affirm payment flow. 

1. Add an item to the cart on your test site..
2. Proceed to checkout.
3. During checkout, enter valid U.S. addresses and mobile-phone information (We can't test your configuration if the address or phone information isn't valid).
4. Select Affirm as the payment option.
5. If you have an existing account, click Sign In.
6. If you don't have an existing account, create one with the following:

  • Any first and last name
  • An email address with a valid format
  • A valid US cell phone number (you do not need access to this number) that you will use in all subsequent checkout attempts
  • A birth date older than 18 years old
  • SSN Bypass number is 5678

7. Enter 123456 for the verification code and click VERIFY CODE
8. Complete checkout flow and click CONFIRM LOAN
9. Confirm that you are redirected to user_confirmation_url
10. Confirm that the response includes the checkout token.
11. Confirm that the checkout process called the Authorize API endpoint and received a response.
12. Confirm that the charge status is authorized in the merchant dashboard.

Initiate and abandon the Affirm payment flow

1. Initiate checkout to access the account creation screen
2. If you have an existing account, click Sign In.
3. If you don't have an existing account, create one with the following:

  • Any first and last name
  • An email address with a valid format
  • A valid US cell phone number (you do not need access to this number) that you will use in all subsequent checkout attempts
  • A birth date older than 18 years old
  • Any four digits

4. Click Return to [merchant name].
5. Confirm that you are redirected to user_cancel_url.
6. Confirm that you are able to select another payment method.

Order management testing (sandbox)

1. Initiate a checkout to access the account creation screen
2. If you have an existing account, click Sign In.
3. If you don't have an existing account, create one with the following:

  • Any first and last name
  • An email address with a valid format
  • A valid US cell phone number (you do not need access to this number) that you will use in all subsequent checkout attempts
  • A birth date older than 18 years old
  • SSN Bypass number is 5678

4. Enter 1234 for the verification code and click VERIFY CODE.
5. Complete the checkout flow and click CONFIRM LOAN.
6. Capture the charge using the process you intend to use when fulfilling orders.
7. Confirm that you receive a 200 response from the Affirm API.
8. Confirm that the charge status is captured in the merchant dashboard.

Void an authorized charge

1. Initiate a checkout to access the account creation screen.
2. If you have an existing account, click Sign In.
3. If you don't have an existing account, create one with the following:

  • Any first and last name
  • An email address with a valid format
  • A valid US cell phone number (you do not need access to this number) that you will use in all subsequent checkout attempts
  • A birth date older than 18 years old
  • Any four digits

4. Enter 1234 for the verification code and click VERIFY CODE.
5. Complete checkout flow and click CONFIRM LOAN.
6. Void, reverse, or cancel the charge using the current void process used for other payment methods.
7. Confirm that you receive a 200 response from the Affirm API.
8. Confirm that the charge status is captured in the merchant dashboard.

Refund an captured charge

1. Initiate checkout to access the account creation screen.
2. If you have an existing account, click Sign In
3. If you don't have an existing account, create one with the following:

  • Any first and last name
  • An email address with a valid format
  • A valid US cell phone number (you do not need access to this number) that you will use in all subsequent checkout attempts
  • A birth date older than 18 years old
  • Any four digits

4. Enter 1234 for the verification code and click VERIFY CODE.
5. Complete checkout flow and click CONFIRM LOAN.
6. Capture the charge using the process you intend to use when fulfilling orders.
7. Refund or cancel the charge using the current refund process used for other payment methods
8. Confirm that you receive a 200 response from the Affirm API.
9. Confirm that the charge status is captured in the merchant dashboard.

Partially refund a captured charge

1. Initiate checkout to access the account creation screen.
2. If you have an existing account, click Sign In.
3. If you don't have an existing account, create one with the following:

  • Any first and last name
  • An email address with a valid format
  • A valid US cell phone number (you do not need access to this number) that you will use in all subsequent checkout attempts
  • A birth date older than 18 years old
  • Any four digits

4. Enter 1234 for the verification code and click VERIFY CODE.
5. Complete checkout flow and click CONFIRM LOAN.
6. Capture the charge using the process you intend to use when fulfilling orders.
7. Refund the charge for an amount less than the total using the current refund process used for other payment methods.
8. Confirm that you receive a 200 response from the Affirm API.
9. Confirm that the charge status is captured in the merchant dashboard.

Verify the order details of a test transaction

1. Verify that the order details show Affirm as the payment method for both the merchant and consumer views
2. Verify that the Affirm Charge ID in the order details links to the loan and the charge in your merchant dashboard (see format below) 

Error case testing

The customer sees an error when they enter invalid information before starting the Affirm checkout process.

1. On your site, enter an invalid address (e.g., an invalid zip code) during checkout.
2. Initiate the Affirm checkout process.
3. Confirm that you see a modal explaining which field contains invalid information.
4. Click Return to Merchant.
5. Confirm that you return to the correct page to edit the field.

Confirm that you get an error when doing the following while using the Charge API:

  • Pass an invalid or missing checkout token when authorizing a charge
  • Pass an invalid charge ID when capturing a charge
  • Void a charge before capturing it
  • Capture a charge twice

Admin and account settings (production)

🚧

Testing in production

Do not use your own personal account to do test transactions in the Affirm live environment as Affirm furnishes loan and repayment information to credit bureaus. Capturing arbitrary test loans could impact your actual credit score. Please work with the Affirm channel partner integration team or your Client Success Manager who is coordinating your launch for testing in the live environment.

Confirm the locations of all Affirm environment references that you'll need to switch from the sandbox to our live environment.