Skip to main content

Merchant Help

 

Affirm Merchant Help

Salesforce Commerce Cloud (Demandware) Integration

Overview

This guide describes how to integrate Affirm into the Salesforce Commerce Cloud (formerly Demandware) so that you can provide Affirm as a payment option to your customers. It’s applicable if your SiteGenesis is based on Pipelines, JavaScript controllers, or if it uses Storefront Reference Architecture (SFRA). After integrating Affirm, your Salesforce Commerce Cloud site will:

  • Offer Affirm as payment option on the checkout page
  • Process Affirm charges in your order management system
  • Display Affirm promotional messaging

The integration steps are:

  1. Install Affirm
  2. Configure Affirm as a payment method
  3. Add Affirm promotional messaging
  4. Set up your order management functions
  5. Test your integration
  6. Deploy to production

This guide assumes you are familiar with SiteGenesis, Salesforce Commerce Cloud’s reference storefront. The Affirm cartridge is certified (sign in required) by Salesforce Commerce Cloud. Installing the Affirm cartridge requires developer access to your SiteGenesis instance.

Before you begin

Before beginning integration, you should review:

Sandbox development

You should have received an email inviting you to create an Affirm account. Click here for information about accessing your account.

Develop and test the Affirm integration in your development environment connected to our sandbox. To use our sandbox, retrieve your sandbox API keys at https://sandbox.affirm.com/dashboard/#/apikeys for use during integration.

After development and testing, you'll need to update your integration to use your live API keys, which you can find at https://affirm.com/dashboard/#/apikeys.

1. Install Affirm

Installing Affirm on Salesforce Commerce Cloud requires importing the Affirm cartridge, importing the required XML files, and enabling Affirm as a payment processor.

Import the Affirm cartridge

  1. Download the cartridge (sign in required)
  2. In the Salesforce UX Studio menu, click File > Import
  3. Click to expand General and click Existing Projects into Workspace
  4. Click Next

Screen Shot 2018-07-30 at 8.43.21 PM.png

  1. Click Browse and navigate to the directory where you downloaded the Affirm cartridge
  2. Click OK
  3. After the window loads the project, click Select All
  4. Click Finish
  5. Right-click the project and click Properties
  6. Click Project References and check all the Affirm references
  7. Click OK

Screen Shot 2018-07-30 at 8.43.41 PM.png

  1. After Salesforce UX Studio builds the workspace, sign in to Business Manager and go to Site > Manage Sites
  2. Select your site and click Settings
  3. At the end of the cartridge path field, add one of the following options:
  • int_affirm (if you're using SiteGenesis based on JavaScript controllers)
  • int_affirm_pipelines:int_affirm (if you’re using SiteGenesis based on Pipelines)
  • Int_affirm_overlay:int_affirm_sfra (if you’re using SiteGenesis based on SFRA)

Import the Affirm XML files

Import the Affirm XML files from the metadata directory of the downloaded cartridge.

  1. In the Business Manager main page, go to Administration > Site Development > Import & Export
  2. In the Import & Export Files section, click Upload

Screen Shot 2018-07-30 at 8.43.52 PM.png

  1. Select affirm_meta.xml
  2. In the Meta Data section, click Import and select affirm_meta.xml

Screen Shot 2018-07-30 at 8.43.59 PM.png

  1. In the Business Manager main page, go to Merchant Tools > Ordering > Import & Export
  2. In the Import & Export Files section, click Upload

Screen Shot 2018-07-30 at 8.44.22 PM.png

  1. Select affirm_payment.xml
  2. In the Payment Methods section, click Import and select affirm_payment.xml

Screen Shot 2018-07-30 at 8.44.34 PM.png

  1. In the Business Manager main page, go to Merchant Tools > Content > Import & Export
  2. In the Import & Export Files section, click Upload

Screen Shot 2018-07-30 at 8.44.44 PM.png

  1. Select affirm_asset.xml
  2. In the Libraries section, click Import and select affirm_asset.xml

Screen Shot 2018-07-30 at 8.44.55 PM.png

  1. In the Business Manager main page, go to Merchant Tools > Online Marketing > Import & Export
  2. In the Import & Export Files section, click Upload

Screen Shot 2018-07-30 at 8.56.59 PM.png

  1. Select affirm_slots.xml
  2. In the Content Slots section, click Import and select affirm_slots.xml

Screen Shot 2018-07-30 at 9.00.04 PM.png

Enable the Affirm payment processor

  1. In the Business Manager main page, go to Merchant Tools > Ordering > Payment Processors
  2. Click NEW
  3. Set ID to AFFIRM_PAYMENT to create the payment processor
  4. Verify Site Preferences Group exists with
  • ID: AFFIRM_PAYMENT
  • Name: Affirm
  1. Verify Payment Method exists with:
  • ID: AFFIRM_PAYMENT
  • Name: Affirm
  1. Click Enable
  2. You can optionally add an image or a text for the payment method by updating the asset affirm-payment-method

2. Configure Affirm as a payment method

After installation, enable Affirm as a payment method by updating these configurations:

  1. In the Business Manager main page, go to Merchant Tools > Site Preferences > Custom Site Preferences > Affirm
  2. Set Affirm Online Status to Yes
  3. Enter the Affirm Public Key and Affirm Private Key (Affirm Financial Product Key is deprecated) you retrieved from the Affirm sandbox merchant dashboard
  4. Set Affirm Mode to Sandbox for testing
  5. If your checkout process automatically captures the charge, set Affirm Payment Action to Authorize and Capture
  6. Enter the dollar amount values for Payment Min Total and Payment Max Total that displays Affirm as a payment option to your customers when checking out
  7. Set Checkout Flow to Redirect (default) or Modal to control the Affirm checkout flow

Screen Shot 2018-07-30 at 8.45.06 PM.png

3. Add Affirm promotional messaging

Add Affirm promotional messaging—which includes monthly payment messaging and educational modals—on your product, category, and cart pages.

  1. In the Business Manager main page, go to Merchant Tools > Site Preferences > Custom Site Preferences > Affirm
  2. Set the following to Yes to display messaging on those pages:
  • Product Promo Message (product pages)
  • PLP Promo Message (category pages)
  • Cart Promo Message (cart page)
  1. Enter a Promo Min Total value to set the minimum threshold dollar amount that will display monthly payment messaging (e.g., setting the Promo Min Total to 100 will only display monthly payment messaging for products above $100)
  2. You can optionally enter a Promo ID value, provided by your Client Success Manager, to customize messaging (prepend the Promo ID value with default|data-promo-id and set Default financing program to default).

Screen Shot 2018-07-30 at 8.45.17 PM.png

Use Multiple Financing Programs

Multiple Financing Programs (MFPs) allow you to offer custom financing programs to your customers based on rules you define in Salesforce Commerce Cloud. To learn more about MFPs and how to set them up in Commerce Cloud, contact your Client Success Manager.

4. Set up your order management functions

Processing orders (authorize, void, refund, and partial refund) in Commerce Cloud updates the order status in the Affirm dashboard. While you can process orders in the dashboard, we strongly recommend using Commerce Cloud to keep order status synced with Affirm.

To set up your order management functions, you’ll need to import XML files from the downloaded cartridge and enable each job (function). Some of these function may not be available in an older version of the cartridge, which only supports Pipelines.

  1. In the Business Manager main page, go to Administration > Operations > Import & Export
  2. In the Import & Export Files section, click Upload

Screen Shot 2018-07-30 at 8.45.26 PM.png

  1. Select affirm_services.xml
  2. In the Services section, click Import and select affirm_services.xml

Screen Shot 2018-07-30 at 8.45.34 PM.png

  1. In the Import & Export Files section, click Upload

Screen Shot 2018-07-30 at 8.45.42 PM.png

  1. Select the affirm_jobs.xml file based on how you’re using SiteGenesis:
  1. In the Job Schedules section, click Import and select the affirm_jobs.xml file you just selected

Screen Shot 2018-07-30 at 8.45.52 PM.png

  1. Go to Administration > Operations > Job Schedules (deprecated).
  2. Verify that each job exists

Screen Shot 2018-07-30 at 8.46.09 PM.png

  1. For each job (shown above), click the job and then click the Sites tab

Screen Shot 2018-07-30 at 8.46.26 PM.png

  1. Check the checkbox for your site and click Apply

Screen Shot 2018-07-30 at 8.46.34 PM.png

Click here for information on processing transactions.

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.

Connect to the live Affirm environment

  1. Retrieve your live API keys at https://affirm.com/dashboard/#/apikeys
  2. In the Business Manager main page, go to Merchant Tools > Site Preferences > Custom Site Preferences > Affirm
  3. Enter the Affirm Public Key and Affirm Private Key you just retrieved from the Affirm merchant dashboard
  4. Set Affirm Mode to Live

Launch to production

After you’ve connected to our live environment and we’ve tested your integration, you’re ready to deploy to your production environment and offer Affirm as a payment option to your customers.