Skip to main content

Merchant Help

 

Affirm Merchant Help

3dcart Integration

Retrieve keys

  1. Sign in to https://sandbox.affirm.com/dashboard
  2. Retrieve API keys
    1. Hover over the profile icon area at the lower-left of the page.
      Screen Shot 2016-03-22 at 7.56.58 AM-2.png
    2. Click the API Keys link that appears.
      Screen Shot 2016-03-22 at 7.56.20 AM.png
    3. Copy the public, private, and financial product keys.

Install Affirm

  1. Open the 3dcart Online Store Manager
  2. Go to Settings >Payment
  3. Click Select Payment Methods

    3dcart-1-new.png

  4. Click Add New

    3dcart-2-new.png

  5. Enter the following information:
    • Payment Method: Affirm 
    • Country: United States (Affirm is currently only supported in the U.S.)
    • State: All 
    • Order Amount: Enter a minimum and maximum Affirm order size if you want those parameters.
    • Customer Group: None (or choose a customer group to limit Affirm availability to that group)

    3dcart-3-new.png

  6. Enter your Affirm account information and then click Add New
  7. Configure the following Affirm settings:
    • Caption: Affirm Monthly Payments
    • ON: Check this box to make Affirm visible on your site 
    • Test Mode: Check this box when you test with Sandbox API keys. Clear this box when you input your Production API keys
    • Public Key: Retrieved from Affirm Dashboard
    • Private Key: Retrieved from Affirm Dashboard
    • Financial Product Retrieved from Affirm Dashboard
    • Authorize-only: Check this box to authorize only when the order is created

      Note: Affirm recommends that you use this setting to authorize when the order is created and then capture when you ship the item.

    3dcart-4-new.png


 Add Affirm "As Low As" messaging to a product page

Add the as low as messaging to all of the product and cart pages.

Sample code based on as low as messaging integration for product pages:

 <script>
  _affirm_config = {
    public_api_key:  "XXXXXXXXXXXXXXXX",
    script:          "https://cdn1-sandbox.affirm.com/js/v2/affirm.js"
  };
  (function(l,g,m,e,a,f,b){var d,c=l[m]||{},h=document.createElement(f),n=document.getElementsByTagName(f)[0],k=function(a,b,c){return function(){a[b]._.push([c,arguments])}};c[e]=k(c,e,"set");d=c[e];c[a]={};c[a]._=[];d._=[];c[a][b]=k(c,a,b);a=0;for(b="set add save post open empty reset on off trigger ready setProduct".split(" ");a<b.length;a++)d[b[a]]=k(c,e,b[a]);a=0;for(b=["get","token","url","items"];a<b.length;a++)d[b[a]]=function(){};h.async=!0;h.src=g[f];n.parentNode.insertBefore(h,n);delete g[f];d(g);l[m]=c})(window,_affirm_config,"affirm","checkout","ui","script","ready");
  // Use your live public API Key and https://cdn1.affirm.com/js/v2/affirm.js script to point to Affirm production environment.
 </script>
 
 <div class="affirm-as-low-as" data-amount="" id="as-low-as-refreshable"></div>
 
<script>
 affirm.ui.ready(function(){
    var refreshable = document.getElementById('as-low-as-refreshable');
    var amount = "[price]".replace(/[^0-9]+/g,"");
    refreshable.setAttribute('data-amount', amount);
    affirm.ui.refresh();  
  });
</script>

Note: [price] variable for listing page can be found here.


Test your 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.
  2. Retrieve your live API keys.
  3. Enter the live API keys into your integration/platform.

Note: The email address that you use to access the dashboard must be registered as a Google account. Check to see if your existing email address is a Google account or create a new Google account. You can link your existing work email address to a Google account by signing up without Gmail.

Update Affirm URL and script references

  1. Affirm JS URL: https://cdn1.affirm.com/js/v2/affirm.js
  2. Affirm API base URL: https://api.affirm.com

Note: Ensure that the "Test Mode" checkbox is unchecked in the Affirm Payment method configuration when production API keys are used.