> For the complete documentation index, see [llms.txt](https://docs.loomgate.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.loomgate.io/en/integrations/woocommerce.md).

# WooCommerce

Accept card payments on your WooCommerce store with the Loomgate for WooCommerce plugin.

The **Loomgate for WooCommerce** plugin adds a card payment method to WooCommerce, for both the classic checkout and the Cart & Checkout Blocks. No code required.

## Requirements

| Component      | Minimum                                                                          |
| -------------- | -------------------------------------------------------------------------------- |
| WordPress      | 6.3                                                                              |
| WooCommerce    | 8.3 (HPOS supported)                                                             |
| PHP            | 7.4                                                                              |
| Store currency | USD or EUR, with **exactly 2 decimal places** (WooCommerce > Settings > General) |
| Website        | Served over HTTPS                                                                |

If any requirement is not met, the payment method hides itself from checkout and the admin shows a warning.

## Installation

{% stepper %}
{% step %}

### Install the plugin

Upload the plugin zip file (provided by Loomgate) in **Plugins > Add New > Upload Plugin** and activate it. WooCommerce must be activated first.
{% endstep %}

{% step %}

### Enter your keys

Go to **WooCommerce > Settings > Payments > Loomgate for WooCommerce**:

| Field               | Value                                                                               |
| ------------------- | ----------------------------------------------------------------------------------- |
| API base URL        | Leave blank (= `https://api.loomgate.io`)                                           |
| Publishable key     | `pk_live_…`                                                                         |
| Secret key          | `sk_live_…` (never shown again; leaving it blank when saving keeps the current key) |
| Title / Description | Text the buyer sees, default "Credit or debit card"                                 |
| loomgate.js URL     | Leave blank (= API base URL + `/partner/v1/loomgate.js`)                            |
| {% endstep %}       |                                                                                     |

{% step %}

### Create a webhook endpoint

In the merchant dashboard, **Webhook** section, add an endpoint with the URL:

```
https://<your-store>/wp-json/loomgate/v1/webhook
```

Leave the event selection empty (all events). Copy the **endpoint ID** (`we_…`) and paste it into the plugin's **Webhook endpoint id** field.
{% endstep %}

{% step %}

### Enable and save

Enable the payment method, save the settings, then place a small test order.
{% endstep %}
{% endstepper %}

## What the plugin does

* **Buyer-paid fees**: if your account has the buyer pay the fees, the cart gets an extra fee line. The amount charged to the card always equals exactly the order total the buyer saw.
* **Payment details**: the plugin sends the items, shipping, tax, discounts, the buyer's name, the order number and the shipping address (orders without a shipping address use the billing address). Carts that contain only virtual or downloadable products count as non-physical goods.
* **Order status**: the order moves to paid when Loomgate confirms it by webhook (the "Order received" page also checks once). If the card is declined, the order stays `pending` and the buyer tries another card.
* **Refunds** right from the order screen (partial, or all of what can still be refunded). Fees are not refunded, so refunding the full order total (including the fee line the buyer paid) is rejected, with the maximum refundable amount. The final result is added as an order note when the webhook arrives.

## Messages the buyer may see

| Message                                                          | Meaning                                                                                                                                       |
| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| The order total changed. Please review your order and try again. | The order total changed after the card form loaded (shipping changed, coupon code…). Nothing was charged; the form reloads with the new total |
| This payment method is not available for this order.             | The account is not allowed to sell non-physical goods, or the order is missing required information                                           |

## Troubleshooting

* **The payment method doesn't show at checkout**: check that both keys are filled in, and that the currency is USD/EUR with 2 decimal places. On the pay-for-order page (order-pay), when the buyer pays the fees, only orders that already had the fee line when they were placed can be paid with Loomgate for WooCommerce.
* **Orders don't move to paid automatically**: security plugins that block the REST API for anonymous visitors also block the webhook. Allow the `/wp-json/loomgate/v1/webhook` route, and check the delivery history in the **Webhook** section of the dashboard.
* **A refund reports "may or may not have been made"**: the outcome is unknown. Check the payment's refunds in the dashboard first; if the refund is there, record it with WooCommerce's **Refund manually** button instead of clicking refund again, so you don't refund twice.

## Privacy

The plugin sends order information (items, name, email, address) to Loomgate, and `loomgate.js` collects device data to prevent fraud. Update your store's privacy policy accordingly.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.loomgate.io/en/integrations/woocommerce.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
