Skip to main content

 

Affirm Merchant Help

OpenCart 2.x Integration

Overview

This guide describes how to integrate Affirm into OpenCart 2.x so that you can provide Affirm as a payment option to your customers. After integrating Affirm, your OpenCart 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
  2. Configure Affirm as a payment method
  3. Add Affirm promotional messaging
  4. Review your order management functions
  5. Add the Confirmation Page function
  6. Test your integration
  7. Deploy to production

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 OpenCart

  1. Download the extension here.
  2. Go to Extensions > Extension Installer and click Upload. Browse to the extension file downloaded in Step 1.
  3. Go to Extensions and select Payments from the dropdown
  4. Find the "Affirm" payment method and click the green "Install" button.

2. Configure Affirm as a payment method

  1. In the OpenCart admin, browse to Extensions > Extensions
  2. Under "Choose Extension Type", select Payments from the dropdown
  3. Find the "Affirm" payment method and click the Edit icon
  4. Configure the following settings:
    1. Enable Affirm - Set to True to enable Affirm as a payment method.
    2. Public API Key - Enter the public key from your Affirm sandbox dashboard.
    3. Private API Key - Enter the public key from your Affirm sandbox dashboard.
    4. Sandbox or Live Mode - Set to Sandbox for testing.
    5. Enable Affirm Modal Checkout - Set to True to have Affirm checkout in a modal window. Set to False to have the customer redirect to Affirm at checkout.
    6. Enable Affirm Enhanced Analytics - When a customer completes their purchase, you can send their order and product information to Affirm for A/B testing, which will help you optimize your site. Send this information by adding the Confirmation Page function to your payment confirmation page. 
    7. Transaction Method - Authorize Only: Obtains payment authorization only.  Authorize + Capture: Obtains authorization and automatically captures funds.
    8. Authorization Order Status - If Transaction Method is Authorize Only, what order status should authorized Affirm orders have in OpenCart.
    9. Capture Order Status - If Transaction Method is Authorize + Capture, what order status should captured Affirm orders have in OpenCart.
    10. Minimum Order Total (optional) - The minimum order total for Affirm to be available at checkout. If blank, will default to $50.
    11. Maximum Order Total (optional) - The maximum order total for Affirm to be available at checkout. If blank, there is no maximum threshold.
    12. Default Currency - Set to USD.
    13. Debug/Logging - Set to False.
    14. Affirm Payments Accepted In - Set to USA.
    15. Sort Order - Refers to the order which Affirm will be placed at checkout (1 means it will be the top option).
  5. Click Save before proceeding to the Promotional Messaging settings.

3. Add Affirm promotional messaging

  1. Check the checkbox next to "Promotional Messaging Settings"
  2. Review the following settings:
    1. Promo Messaging Type - Select Logo, Symbol, or Text (default is Logo).
    2. Promo Messaging Color - Select color of Logo or Symbol (does not apply to Text).
    3. Enable Product Messaging - Set to True (required).
    4. Enable Shopping Cart Messaging - Set to True (required).
    5. Enable Mini Cart Messaging - Set to True to enable Affirm As Low As messaging on the mini-cart (optional).
    6. Enable Category Product Messaging - Set to True to enable Affirm As Low As messaging on the category page (optional).
    7. Enable Featured Product Messaging - Set to True to enable Affirm As Low As messaging on the featured product section (optional).
    8. Enable Best Selling Product Messaging - Set to True to enable Affirm As Low As messaging on the best selling product section (optional).
    9. Enable Latest Product Messaging - Set to True to enable Affirm As Low As messaging on the latest product section (optional).
    10. Enable Specials Product Messaging - Set to True to enable Affirm As Low As messaging on the specials page (optional).
    11. Enable Product Comparison Messaging - Set to True to enable Affirm As Low As messaging on the product comparison page (optional).
    12. Enable Manufacturer Product Messaging - Set to True to enable Affirm As Low As messaging on the manufacturer product page (optional).
    13. Enable Related Product Messaging - Set to True to enable Affirm As Low As messaging on the related product section (optional).
    14. Enable Checkout Confirmation Messaging - Set to True to enable Affirm As Low As messaging on the checkout confirmation (optional).
    15. Enable Homepage Banner - Set to True to place an Affirm banner on your homepage (optional).
    16. Set a Homepage Banner - If Enable Homepage Banner is true, select the appropriate sized banner to display on the home page (optional).
  3. Click Save 

4. Review your order management functions

Processing orders (capture, void, refund, and partial refund) can be done through your Affirm dashboard as outlined here.

If you prefer, it's possible to update the process these orders through your OpenCart settings. Instructions on enabling this and processing these orders through OpenCart can be found here.

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

Connect to the live Affirm environment

  1. Retrieve your live API keys at https://affirm.com/dashboard/#/apikeys
  2. Sign in to your OpenCart admin
  3. In the OpenCart admin, browse to Extensions > Extensions
  4. Under "Choose Extension Type", select Payments from the dropdown
  5. Find the "Affirm" payment method and click the Edit icon
  6. Enter the Public API Key and Private API Key you retrieved from the live merchant dashboard
  7. Change Sandbox or Live Mode to Live
  8. Save

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.

 

  • Was this article helpful?