Skip to main content

Affirm

This plugin lets your customers in the United States and Canada pay over time with Affirm: they choose Affirm at the end of the checkout, apply for the loan on Affirm's page in a few seconds, and you are paid by Affirm in full while they pay Affirm back in installments.

Features
  • Offers the payment plans of your Affirm account: Pay in 4, Pay in 30 and monthly installments, as Affirm approves them for each customer.
  • Shows Affirm only to the orders Affirm can lend for: in US dollars with addresses in the United States for a US account, in Canadian dollars with addresses in Canada for a Canadian account, and within the minimum and maximum totals you set.
  • Sends Affirm the content of the order (products, shipping, discount, tax) and the customer's addresses, so the customer does not type them again.
  • Confirms the order as soon as the customer has signed the loan, and checks that what Affirm approved is the order's total and currency: a loan for another amount is cancelled at once.
  • Takes the payment when you ship the order, or at once if you prefer. When the order has a tracking number, Affirm gets it with the payment.
  • Cancelling an order not shipped yet releases the loan; moving a paid order to the refunded status refunds it on Affirm.
  • A sandbox setting runs the whole flow on your Affirm sandbox, where no real loan is made.
Affirm offered among the payment methods of the HikaShop checkout How it works
  • 1. The customer chooses Affirm and confirms the order.
  • 2. They are sent to Affirm's page, where they choose a payment plan and sign the loan.
  • 3. Back on your shop, the order is authorized and the customer gets the confirmation email.
  • 4. When you set the order to shipped, Affirm is told to charge the loan and pays you.
  • 5. A cancellation before shipping releases the loan, a refund after it pays the customer back on Affirm.
Installation
  • 1) Get an Affirm merchant account at affirm.com/business. Affirm works with businesses based in the United States or Canada.
  • 2) In your Affirm sandbox dashboard (sandbox.affirm.com for the United States, sandbox.affirm.ca for Canada), open Settings, API Keys, and note the public and the private API key. Your live dashboard has its own pair, for real orders.
  • 3) Install this plugin and enable it in Extensions > Plugins.
  • 4) In HikaShop, go to System > Payment methods, click "New" and select Affirm.
  • 5) Choose the country of your Affirm account, paste the two keys and save: the plugin checks them with Affirm and says whether they were accepted.
  • 6) Make sure your shop has the currency of your account (US dollar or Canadian dollar) published, and that your customers can enter an address in the United States or Canada with its state or province.
  • 7) In System > Order statuses, check the "Capture" column: the payment is taken when an order reaches one of the statuses ticked there (shipped by default).
  • 8) Place a test order with Affirm's test identity, then set Sandbox to No and paste your live keys.
Configuration The settings of the Affirm payment method in HikaShop
  • Country of the Affirm account: United States or Canada, the country your Affirm account was opened in. It decides the currency and the addresses Affirm is offered to.
  • Sandbox: Yes with the keys of your sandbox dashboard, to test without real loans. No with the live keys.
  • Public API key and Private API key: the pair of Settings, API Keys in the Affirm dashboard of the mode you chose. Without them Affirm is not offered.
  • Shop name shown at Affirm: the name of your shop on Affirm's page. Empty, the name of your site is used.
  • Minimum order total and Maximum order total: Affirm is only offered between these totals, in the currency of your account. 50 and 30000 are Affirm's usual limits; use those of your Affirm contract. An empty maximum means no maximum.
  • Capture the payment: "On shipment" takes the payment when the order reaches one of the capture statuses of System > Order statuses, which is what Affirm recommends; "At once" takes it as soon as the customer signs. An authorization not captured within 30 days is lost.
  • Debug: writes every call to Affirm to the HikaShop payment log file.
  • Authorized status: the status of an order whose loan is signed and waits to be captured (confirmed by default).
  • Captured status: the status of an order captured at once. An order captured on shipment keeps its shipped status.
  • Invalid status: the status of an order whose loan did not match it, and which was cancelled on Affirm. Setting an order not captured yet to this status, or to cancelled, releases its loan.
  • Refunded status: setting a captured order to this status refunds what is left of it on Affirm.
Troubleshooting
  • "Affirm refused the API keys" on save: the keys are wrong, or they do not match the Sandbox setting (sandbox keys need Sandbox on Yes) or the country of the account.
  • Affirm is not offered at the checkout: the order is not in the currency of your account, an address is outside its country, the total is outside your minimum and maximum, or the keys are missing.
  • "Affirm did not capture the payment": the order history and the payment log say why. An authorization expires after 30 days, after which the order can no longer be charged.
  • A refund or a cancellation refused by Affirm keeps the order in its previous status and shows Affirm's reason.
  • Refunds made in the Affirm dashboard are not reported to the shop: make them from HikaShop.
Use
  • Compatible with all the editions of HikaShop
  • Requires an Affirm merchant account in the United States or Canada
  • Requires the PHP cURL extension
  • Compatible with Joomla and WordPress
  • No limit of time
  • No limit of use
Changelog

1.0.0 on the 18th of October 2026

  • First version.
Free
Affirm
The add to cart button will appear once you select the values above
Type
Payment plugin