# WooCommerce

> The Intents Checkout plugin for WooCommerce, block and classic checkout, set up in test mode first.

**[Download Intents Checkout for WooCommerce](https://intents.fi/integrations/woocommerce/download)** (always the latest version)

| Build | File | Released | Tested on | SHA-256 |
|---|---|---|---|---|
| WooCommerce 0.1.1 | [`intents-checkout-crypto-payments-for-woocommerce-0.1.1.zip`](https://intents.fi/integrations/woocommerce/download/intents-checkout-crypto-payments-for-woocommerce-0.1.1.zip) | 2026-11-26 | WordPress 6.5+, WooCommerce 8.9+, PHP 8.0+ | `867bec09c1c4cfec897c25764e29655288385b5248fa1c0a71dce60da5a5fe61` |

Each versioned file never changes once published, so its link and checksum are safe to pin.

The zip is the build WordPress.org is reviewing. Once the directory listing is approved you can
install it from **Plugins → Add New** by searching for Intents Checkout instead.

1. **Install the plugin.** **Plugins → Add New → Upload Plugin**, choose the zip you downloaded,
   then activate **Intents Checkout**. WooCommerce must be active first.
2. **Click Connect intents.fi.** In **WooCommerce → Settings → Payments → Intents Checkout**,
   press **Connect intents.fi**, sign in to the [dashboard](https://dashboard.intents.fi) (or sign
   up: a business name and a country are enough to start) and approve. You land back in WordPress
   showing **Connected as _your business_ · Test mode** and **Payment notifications: connected
   ✓**. The plugin made its test key and registered its own webhook: nothing to copy. How it
   works: [Plugin Connect](/docs/checkout/connect).
3. **Pick your payout.** USDC or USDT on the chain you choose, to your own wallet: the payout
   wallet is a row of the dashboard's go-live checklist (see [Settlement](/docs/checkout/settlement)).
   Test mode needs no wallet, so you can do this last.
4. **Place a test order.** Tick **Enable Intents Checkout**, save, and press **Place a test
   order**. The hosted page shows a **Complete the test payment** button for a test invoice; press
   it, and the order moves to **Processing** when the webhook says the invoice is paid.

When the go-live checklist is done, press **Go live** in the plugin. It gets live keys and a live
webhook the same way, and only then switches off test mode.

**Disconnect** (in the plugin, or **Integrations** in the dashboard) revokes the store's keys and
webhooks at once.

### Entering keys manually

Connect needs your WordPress admin and your store on the same `https://` address. If they are not,
or you prefer to paste keys:

1. In [the dashboard](https://dashboard.intents.fi), copy your **test** API key (`ik_test_…`).
2. Under **Enter keys manually**, paste it into **Test API key**, and copy the **Webhook URL** the
   settings page shows.
3. Add that URL as a webhook endpoint for your test key, subscribed to the `invoice.*` events,
   either on the dashboard's **Webhooks** page or with the API, and paste the `whsec_…` secret it
   returns into **Test webhook secret**:



```bash title="curl"
curl https://api.intents.fi/v0/webhooks \
  -X POST \
  -H 'authorization: Bearer $INTENTS_SECRET_KEY' \
  -H 'content-type: application/json' \
  -d '{
       "url": "https://northwood.example/hooks/intents"
     }'
```

```ts title="TypeScript"
const response = await fetch("https://api.intents.fi/v0/webhooks", {
  method: "POST",
  headers: {
    authorization: `Bearer ${process.env.INTENTS_SECRET_KEY}`,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "url": "https://northwood.example/hooks/intents"
  }),
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();
```

```python title="Python"
import os
import httpx

response = httpx.post(
    "https://api.intents.fi/v0/webhooks",
    headers={"authorization": f"Bearer {os.environ['INTENTS_SECRET_KEY']}"},
    json={
        "url": "https://northwood.example/hooks/intents"
    },
)
response.raise_for_status()
data = response.json()
```



4. **Save changes**, then press **Test connection**: it checks the saved key for the selected mode
   and shows the merchant, the mode and the settlement address it belongs to.

The plugin needs WordPress 6.4+, PHP 8.0+ and WooCommerce 8.9+. It supports High-Performance Order
Storage (HPOS) and both the Cart and Checkout **blocks** and the classic shortcode checkout.

**The store currency must be USD.** Invoices are priced in USD, so the payment method stays hidden
at checkout while the store currency is anything else (the settings page says so), and also while
no API key is saved for the selected mode.

## How a payment runs

1. The customer chooses the payment method (titled **Pay with crypto** unless you change it). The
   plugin creates an invoice for the order total with `reference = order_<id>-<site code>` and
   sends the customer to the hosted payment page.
2. The customer pays there; the plugin has no checkout UI of its own.
3. intents.fi sends signed `invoice.*` webhooks to `/wp-json/intentsfi/v1/webhook`, and the
   plugin updates the order.

`reference` is the API's idempotency key, so a retried checkout lands on the same invoice. The
site code is a short hash of your store's address, so two stores on one intents.fi account never
share a reference even when their order numbers match. As a backstop, the plugin only uses an
invoice created for this order on this store (its `metadata.wc_order_key` and `wc_site_url`): one
made for any other order is never used, even if it is paid, and the order gets a reference of its
own instead, with a note saying so. If the order total changes, or its invoice expires or is
cancelled, the order gets a new invoice (`…-r2`, then `-r3`) and the old one is cancelled through the API. A payment that still
lands on a replaced invoice puts the order **On hold** with a note and an admin notice, so a person
decides. The customer coming back to the store never marks an order paid. Only the webhook does.

Test and live invoices never share a `reference`, so an order first sent to a test invoice and
paid after you switch to live mode gets a new live invoice; the test one is never reused.

## What each event does

The plugin reads `data`, the invoice as it is when the webhook is delivered, not only the event
type. An order is marked paid only when the event is `invoice.paid` **and** `data.status` is
`paid`.

| Event | Order |
|---|---|
| `invoice.paid` | `payment_complete()`: **Processing** (or **Completed** for virtual goods) |
| `invoice.paid` with `late: true` (paid after the invoice expired or was canceled) | **On hold**, with a note and an admin notice, even if the order was already **Cancelled**: the money is in your wallet, so you decide whether to fulfil it or refund it from your wallet |
| `invoice.paid` whose `data.status` is not `paid` | never marked paid: an order note and an admin notice, for a person to check |
| `invoice.paid` for an invoice the order has moved off (`-r2`, `-r3`) | **On hold**, with a note naming both amounts and an admin notice |
| `invoice.expired`, `invoice.canceled` | **Cancelled**, if nothing was paid. Never an order that is paid, **On hold** or **Refunded**, and never when `data.status` shows the invoice was paid after all |
| `invoice.processing`, `invoice.underpaid` | an order note; the order stays unpaid |
| `invoice.needs_review` | an order note and an admin notice |

Deliveries can repeat and arrive out of order. The plugin remembers each event ID on the order and
ranks events, so a duplicate does nothing, and a late `invoice.processing` or `invoice.expired`
after `invoice.paid` only adds a note. A webhook whose `data.mode` is not the mode of the secret
that verified it is ignored.

## Settings

| Setting | Notes |
|---|---|
| Enable/Disable | offers the payment method at checkout |
| Test mode | uses the test key and test secret; no real money moves |
| Test / Live API key | `ik_test_…` / `ik_live_…`, stored as passwords |
| Test / Live webhook secret | the `whsec_…` returned when the endpoint was registered for that mode |
| Webhook URL | read-only, with a copy button: `https://<your store>/wp-json/intentsfi/v1/webhook` |
| Title, Description | what the customer sees at checkout |
| Connection: **Test connection** | checks the saved key for the selected mode and reports the merchant and settlement address. Save first |

Endpoints are per mode: register the URL once for the test key and once for the live key, and
paste each one's own secret. A webhook is checked against the secret of the mode in effect and
then the other one, so an invoice created just before you switch modes still completes its order.

## Going live

1. Register the webhook URL with the **live** key and paste its secret into **Live webhook secret**.
2. Paste the live API key, then turn **Test mode** off.
3. Place a real $5 order from a phone, on the network your customers use, and check it reaches
   Processing and the money reaches your address.

## Troubleshooting

- **Orders stay Pending payment.** The webhook is not arriving or not verifying. Check the secret
  matches the mode, and that the store is reachable over `https` from the internet: intents.fi
  delivers only to public `https` URLs, and the settings page warns when the site is not served
  over HTTPS. A delivery whose signature does not verify gets a `401` and is retried. **WooCommerce → Status → Logs**, source
  `intentsfi-checkout`, shows each delivery.
- **"Test connection" fails with `UNAUTHORIZED`.** The key is wrong for the mode, or it is a
  publishable `pk_` key. The plugin needs a secret `ik_` key. It checks the *saved* key, so save
  the settings first.
- **The payment method does not show at checkout.** The store currency is not USD, the method is
  not enabled, or no API key is saved for the selected mode.

---

Source: https://intents.fi/docs/checkout/woocommerce · The whole corpus: https://intents.fi/docs/llms-full.txt
