## Overview

This guide describes how to add the Affirm Telesales Add-on module for Adobe Commerce. The module allows your phone representatives and administrators to provide Affirm as a payment option when creating orders in Adobe Commerce. When they create an order using the Telesales option, Affirm sends the customer a link via email and SMS to begin their loan application process.

**Before you begin**

Before adding the module, [you should have already installed and configured Affirm for Adobe Commerce](🔗).

[Click here to review the Adobe Commerce Telesales module release notes](🔗).

**Sandbox development**

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.

Note that we only send SMS messages with the checkout link from the Affirm Live environment. During Sandbox environment testing, use email messages for the checkout link.

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

## 1. Install the Adobe Commerce Telesales module

[Download the Adobe Commerce Telesales Add-on module here](🔗)

### Install using Composer

  1. Go to **MAGENTO_ROOT** and run the following command:


  1. Update the module by running the following commands:



\*\*

## 2. Configure the Adobe Commerce Telesales module

After installing the Adobe Commerce Telesales module, enable it by updating Adobe Commerce configurations:

  1. Sign in to your Adobe Commerce admin portal.

  2. Go to **Stores > Configuration > Sales > Payment Methods > Affirm > Affirm Telesales Extension**.

  3. Set **Enabled** to **Yes**.

  4. Under Affirm, keep **Mode** set to **Sandbox** (for development and testing) and make sure the rest of the settings are configured, such as the **Public API** Key and **Private API Key** you retrieved from the Affirm sandbox merchant dashboard.

  5. If your checkout process automatically captures the charge, set **Payment Action** to **Authorize and Capture**.






## 3. Test the module

We only send SMS messages with the checkout link from the Affirm Live environment. During Sandbox environment testing, use email messages for the checkout link.

  1. In your order management system, create an order.

  2. Enter a valid U.S. address and mobile phone number (Affirm will not work with a fake address or phone number).

  3. Select **Affirm** as the payment option.



  1. Click **Submit Order** to place it in a pending state.

  2. Under **Payment Information**, click **Send Affirm Checkout Link** button.



  1. Find the email with the checkout link and click it.

  2. If you have an existing account, click **Sign In**.

  3. If you do not have an existing account, create one with the following:

  • Any first and last name.

  • An email address with a valid format.

  • A valid U.S. 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.

  1. Enter **1234** for the verification code and click **VERIFY CODE**.

  2. Complete checkout flow and click **CONFIRM LOAN**.

  3. Verify that the order is processed or complete in your order management dashboard.

  4. Verify that the transaction appears in your platform's admin panel and on [sandbox.affirm.com/dashboard](🔗).




## 4. Go live

### Step 1: Sandbox development

Before going live with your Affirm integration, we suggest testing in 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 will need to update your integration to use your live API keys, which you can find at <https://affirm.com/dashboard/#/apikeys>.

### Step 2: Connect to the live Affirm environment

  1. Retrieve your live API keys at <https://affirm.com/dashboard/#/apikeys>.

  2. In the Magento 2 admin panel, go to **Stores > Configuration > Sales > Payment Methods > Affirm**.

  3. Set **Mode** to **Production**.

  4. Enter the **Public API Key** and **Secret Key** (private key) you just retrieved from the Affirm merchant dashboard.

### Step 3: Go live!

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




## FAQ & other known issues

  1. How to solve compatibility issues with Magento 2.2.x Magento 2.2.x version or lower will need to have the following functions replaced: `addCommentToStatusHistory` --> `addStatusHistoryComment`



Changes related to CsrfAwareActionInterface will need to be removed: `class Confirm extends Action implements CsrfAwareActionInterface` --> `class Confirm extends Action`


  1. How to solve blank admin error page issue when installing under `MAGENTO_ROOT/app/code/` Magento 2.2.x:



Magento 2.3.x: