Affirm is a financial services company that offers installment loans to consumers at the point of sale. Its aim is to improve the banking industry to be more accountable and accessible to consumers.
Founded in 2012, Affirm lets shoppers pay for purchases across multiple months with transparent, fairly-priced fees built into every payment, and increases conversion and basket size for e-tailers at less than the cost of credit cards.
The integration of Affirm with your Spree Commerce store can be done quickly and easily following the guidelines mentioned below.
The benefits of using Affirm for your eCommerce business
Large customer network
When you partner with Affirm, you’ll reach the company’s rapidly growing network of millions of customers.
Zero risk to you
Affirm settles within one business day and takes on risk, from costly chargebacks to fraud.
Flexibility to fit your business
With Affirm, you have the power to tailor your shopping experience to any customer, channel, or price point.
How to integrate Affirm with Spree
Before you begin
Sandbox development
1. Install the Spree extension
- Download the Spree extension
- Add the following line to your Spree Gemfile:
1 | gem 'spree_affirm', :github => "affirm/spree_affirm" |
- Install the gem with Bundler:
1 | bundle install |
2 | bundle exec rails g spree_affirm:install |
- Restart your Spree server
2. Configure Affirm as a payment method
- Sign in to the Spree admin page
- Go to Configurations > Payment Methods
- Click New Payment Method
- Set PROVIDER to Spree::Gateway::Affirm
- Enter Affirm Monthly Payments for NAME
- Click Create
- Keep SERVER set to sandbox.affirm.com for testing
- Check the TEST MODE box for testing
- Enter the API Key (public key) and Secret Key (private key) you retrieved from the Affirm sandbox merchant dashboard
- If your checkout process automatically captures the charge, set AUTO CAPTURE to Yes
- Set ACTIVE to Yes to enable Affirm as a payment method.
- Click Update
4. Review your order management functions
Processing orders (authorize, void, refund, and partial refund) in Spree updates the order status in the Affirm dashboard. While you can process orders in the dashboard, we strongly recommend using Spree to keep order status synced with Affirm. For more information on processing orders in Spree, refer to their documentation.
7. Deploy to production
Coordinate testing with Affirm
Connect to the live Affirm environment
- Retrieve your live API keys at https://affirm.com/dashboard/#/apikeys
- In the Spree admin panel, go to Configurations > Payment Methods
- Select Affirm Monthly Payments
- Set SERVER set api.affirm.com
- Enter the API Key (public key) and Secret Key (secret key) you just retrieved from the Affirm merchant dashboard
- Uncheck the TEST MODE box
- Click Update