Skip to main content

Merchant Help

 

Affirm Merchant Help

WooCommerce Integration

Overview

The Affirm WooCommerce extension will add Affirm to your site and your WooCommerce administration tools:

  • Enable the Affirm payment method in your checkout
  • Add Affirm promotional marketing to your product and cart pages
  • Manage orders paid with Affirm

Instructions

  1. Purchase the extension: https://www.woothemes.com/products/w...ateway-affirm/
  2. Read the documentation: https://docs.woothemes.com/document/...ateway-affirm/
  3. Enable Affirm Monthly Payment 

Test your Affirm configuration

To test in development mode which points to Affirm sandbox environment, check the Affirm Sandbox checkbox in WooCommerce > Settings > Checkout > Affirm configuration.

Test your configuration to ensure that everything is working before you go live. Email  merchanthelp@affirm.com with a link to your test site so that we can verify your configuration and provide you with production keys.

  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. Affirm cannot test your configuration if the address or phone information is fake.
  4. Select Affirm as the payment option.
  5. Proceed to Affirm's testing environment checkout.

Note: The URL https://sandbox.affirm.com indicates that you are in the testing environment.

6. When prompted for your security PIN, enter 1234.

7. Select terms.

8. Confirm your loan.

 

9. Wait to ensure that you have been redirected to your confirmation page.

10. Verify that the transaction appears in your platform's admin panel and on  sandbox.affirm.com/dashboard

Note: When a customer completes checkout with Affirm as the payment method, Affirm authorizes a charge for the amount of the order. The charge appears in a pending state on the customer’s Affirm account. Authorized transactions expire if they are not captured before the capture deadline. The default capture deadline is specified in your partnership agreement with Affirm. If you did not specify your authorization-period requirements because of inventory, pre-orders, or shipping time in your onboarding form, please email merchanthelp@affirm.com for help with completing this process.


Go live with Affirm financing

After you verify that your configuration is working properly in the Affirm Sandbox environment, your Affirm Client Success Manager will activate your Affirm Live environment access. This will allow you to sign into the Live version of the Merchant Dashboard, as well as access your Live API keys.

Retrieve Live API keys 

  1. Go to the API keys page in the Affirm dashboard.

    Note: The work email address that you use to sign-in to the Affirm Dashboard must be granted access by your Dashboard's administrator or your Affirm contact.
     
  2. Retrieve your live API keys.
  3. Enter the live API keys into your integration/platform.
  4. Uncheck Affirm Sandbox checkbox in WooCommerce > Settings > Checkout > Affirm configuration 

Frequently Asked Questions

  • How do I enable Modal Checkout flow instead of redirecting to Affirm?

Modal Checkout configuration option will be soon available in the Affirm WooCommerce plugin, until then, Affirm checkout can be rendered in a modal by updating class-wc-gateway-affirm.php--plugin file.  

  • In Wordpress admin, go to the Plugin Editor: Admin → Plugins → Editor
  • Select the WooCommerce Affirm plugin from the menu at the top-right, and click 'Select'
  • Edit this file 'Woo_DIR/wp-content/plugins/woocommerce-gateway-affirm/includes/class-wc-gateway-affirm.php'
  • Add 'mode'=>'modal' on line #774 as follows:
    'metadata' => array(
    'mode' => 'modal',
    'order_id' => $order_id,
    
  • Click 'Save'
  • Why don't I see Affirm on the checkout page?

Affirm is currently only available in the US. If your checkout page does not automatically default to 'United States' as the billing address country drop-down selection, Affirm will not be displayed as a payment method by default. As soon as a user selects their billing country as 'United States' in the drop-down during checkout, Affirm will be made available as the page makes an asynchronous request to populate Affirm as a payment method.

  • Why am I seeing Affirm canceled orders in WooCommerce -> Orders?

Orders are created in WooCommerce as soon as a user is redirected to Affirm checkout application. If a user abandons the Affirm checkout at any point or is denied a loan, the associated orders are automatically moved to a 'Cancelled' status.  Once the user completes the Affirm application and gets approved for a loan, they are redirected to the order confirmation page and these orders would then have a 'Pending payment' or 'Processing' status depending on the 'Transaction Mode settings in WooCommerce > Settings > Checkout > Affirm.

  • My site is crashing as soon as I activate the Affirm plugin.

This could usually happen due to various reasons - PHP code syntax, compatibility or memory limit exhaustion issues. Refer to the instructions below on how to troubleshoot this issue:

  1. Enable error debug log 
    • To enable debugging, open the wp-config.php file of your WordPress install. In this file, search for define(‘WP_DEBUG’, false);
    • Replace false with true and save the file
    • Refresh your website. You should now see the message that is causing this error
    • Make the necessary changes by modifying the code as per the error message (refer to the file name and line number in the error message) 
    • Make sure you are debugging this on your test site
    • If you want to write these logs to a log file, add define( 'WP_DEBUG_LOG', true ); in the wp-config.php file and all the debug logs will then be written to /wp-content/debug.log file
  2. Check file and folder permissions for complete installation
    • Files should be 664 or 644
    • Folders should be 775 or 755
    • wp-config.php file should be 660, 600, or 644
  3. Check Memory Limits - If you still see an empty page or get an error complaining about memory limits or exhausted memory, you will need to assign more memory to the application. 

To deactivate the Affirm plugin to get your site back to the previous state:

  • If you are able to access your login to WordPress, yoursite.com/wp-admin, go to the plugins and de-activate the Affirm plugin
  • If you are unable to access your login to WordPressyoursite.com/wp-admin, access your website via FTP and go to /wp-content/themes/ folder. Just rename the Affirm plugin folder to Affirm_something. This will deactivate the Affirm plugin on your site and allow you to access both admin and frontend 
  • Where do I find Affirm related logs?

 API logs related Affirm can be found here - Wordpress Admin → WooCommerce → Status → Logs → woocommerce-gateway-affirm...