This creates the flow that guides the customer through the Affirm checkout process. The flow ends when the customer either successfully confirms the checkout, cancels the checkout, or encounters an error. In each of these cases, Affirm will send a message to AffirmCheckoutDelegate with additional information about the outcome.

3. Authorize a test charge

Follow these steps to get the checkout token during development:

Initiate checkout to access the account creation screen

If you have an existing account, click Sign In

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

Note: Unlike the ecommerce integration, the Affirm SDK expects prices to be formatted as an NSDecimalNumber in dollars, not integer cents USD.

Add monthly payment messaging

Display monthly payment messaging by using a custom AffirmAsLowAsButton provided in the SDK. AffirmAsLowAsButton includes all the functionality in a button, which handles all its states. You only need to add to your view and configure it. Add AffirmALAButton with the following code:

amount: The price of the product or cart in NSDecimal (value less than 50 opens a site modal with no pricing information)

promoId: Affirm provides this Promo ID

5. Test your integration

After completing your integration, do a thorough testing of both your front-end and order management functions in our sandbox to ensure that everything works as expected. Click here for our recommended test plan. However, you’ll need to tailor your testing plan to your specific systems, processes, and integration.

6. Deploy to production

Coordinate testing with Affirm

Before deploying the Affirm integration to your production site, Affirm will need to test it in your development or staging environment connected to our live environment. Contact your Client Success Manager to coordinate this test.

Launch to production

After you have connected your integration to our live environment and we have tested it, you are ready to release your application in your production environment and offer Affirm as a payment option to your customers.