> ## Documentation Index
> Fetch the complete documentation index at: https://docs.momentco.io/llms.txt
> Use this file to discover all available pages before exploring further.

# WooCommerce

> Accept payments in your WooCommerce store with the Moment Payments plugin

WooCommerce is a free, open source e-commerce plugin for WordPress that turns a website into a full online store. The Moment Payments plugin connects WooCommerce to Moment so you can accept payments without building an integration yourself.

At checkout, your customer is redirected to a Moment hosted payment page, completes the payment, and returns to your store. Order status is updated automatically from signed webhooks, so there is nothing to poll or reconcile by hand.

## What you get

* One-time payments through Moment hosted checkout
* Card, EFT, and wallet payment methods
* Recurring subscriptions with the [WooCommerce Subscriptions](https://woocommerce.com/products/woocommerce-subscriptions/) extension
* Full and partial refunds from the WooCommerce admin
* Support for both block checkout and the classic shortcode checkout
* Signed webhooks with HMAC-SHA256 verification and replay protection

***

## Before you begin

You will need a store that meets these minimums and a Moment merchant account.

| Requirement    | Minimum                  |
| -------------- | ------------------------ |
| WordPress      | 6.0                      |
| WooCommerce    | 8.0                      |
| PHP            | 7.4                      |
| Store currency | ZAR (South African Rand) |

<Note>
  The plugin supports the South African Rand (ZAR). If your store uses another base currency, Moment does not appear as a payment option at checkout.
</Note>

You also need your Moment API keys. See [Authentication](/api-reference/getting-started/authentication) to understand how test and live keys work. If you do not have keys yet, contact the [Moment team](/documentation/support).

***

## Install the plugin

<Steps>
  <Step title="Open the plugin installer">
    In your WordPress admin, go to **Plugins → Add New**.
  </Step>

  <Step title="Find Moment Payments">
    Search for **Moment Payments** in the plugin directory, then click **Install Now**.
  </Step>

  <Step title="Activate">
    Once installed, click **Activate**.
  </Step>
</Steps>

<Note>
  If Moment provided you with a plugin ZIP file, click **Upload Plugin** on the **Add New** screen, choose the file, then install and activate it.
</Note>

***

## Configure the plugin

<Steps>
  <Step title="Open the Moment Payments settings">
    Go to **WooCommerce → Settings → Payments**, then select **Moment Payments**.
  </Step>

  <Step title="Add your API keys">
    Under **API Credentials**, enter your **Secret Key** (`sk_test_…` or `sk_live_…`), **Public Key** (`pk_test_…` or `pk_live_…`), and **Webhook Signing Secret** (`whsec_…`).
  </Step>

  <Step title="Register your webhook endpoint">
    Copy the read-only **Webhook Endpoint** URL shown on the settings page and register it in your Moment account. It looks like `https://yourstore.com/?wc-api=moment_webhook`. See [Setting up webhooks](/api-reference/webhooks/setup) for details.
  </Step>

  <Step title="Test the connection">
    Click **Test Connection** to confirm your Secret Key can reach the Moment API.
  </Step>

  <Step title="Enable and save">
    Tick **Enable Moment Payments**, set the **Title** and **Description** your customers will see at checkout, then click **Save changes**.
  </Step>
</Steps>

### Settings reference

| Setting                | Description                                                            |
| ---------------------- | ---------------------------------------------------------------------- |
| Enable / Disable       | Turns the gateway on or off at checkout.                               |
| Title                  | Payment method name shown to customers. Defaults to `Pay with Moment`. |
| Description            | Short line shown below the title at checkout.                          |
| Secret Key             | Server-side key (`sk_test_…` or `sk_live_…`). Keep this private.       |
| Public Key             | Client-side publishable key (`pk_test_…` or `pk_live_…`).              |
| Webhook Signing Secret | Signing secret (`whsec_…`) used to verify incoming events.             |
| Webhook Endpoint       | Read-only URL to register in your Moment account.                      |
| Test Connection        | Checks that your Secret Key can reach the Moment API.                  |

### Advanced settings

The defaults are safe for most stores. Adjust these only if you have a specific need.

| Setting                           | Default | Description                                                                                                  |
| --------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| Show payment details panel        | Off     | Displays the card scheme and last four digits on the order edit screen.                                      |
| Verify payment on customer return | Off     | Confirms payment through the API as soon as the customer returns, rather than waiting for the webhook alone. |
| API POST timeout                  | 30s     | Timeout for outgoing POST requests such as creating a session or a refund.                                   |
| API GET timeout                   | 15s     | Timeout for outgoing GET requests such as fetching a session or the connection test.                         |
| Debug logging                     | Off     | Writes verbose logs for troubleshooting. Leave off in production.                                            |

<Tip>
  Debug logs appear under **WooCommerce → Status → Logs**, tagged with the source `moment-payments`.
</Tip>

***

## How payments work

<Steps>
  <Step title="Customer places an order">
    The plugin creates a Moment payment session for the order total and redirects the customer to the hosted checkout page.
  </Step>

  <Step title="Customer pays on the hosted page">
    Card, EFT, and wallet details are entered on Moment's secure pages. No card data touches your store.
  </Step>

  <Step title="Moment confirms the result">
    Moment sends a signed webhook to your store. The plugin verifies the signature and moves the order to the matching status. A paid order becomes **Processing** or **Completed**, and a pending method such as EFT is held **On hold** until it clears.
  </Step>
</Steps>

### Refunds

Issue full or partial refunds from the WooCommerce order screen. The plugin sends the refund to Moment and records it on the order. Refunds you issue from your Moment dashboard also sync back to WooCommerce automatically.

### Subscriptions

With the WooCommerce Subscriptions extension installed, the plugin handles [recurring payments](/documentation/collect/payment-sessions/mandates/overview). The first payment runs through the hosted checkout, and renewals are charged automatically without any customer interaction.

***

## Test your integration

Test mode moves no real money, so you can run through the full flow safely before going live.

<Steps>
  <Step title="Switch to test keys">
    In the plugin settings, use your test API keys (`sk_test_…` and `pk_test_…`).
  </Step>

  <Step title="Place a test order">
    Add a product to the cart, go to checkout, and choose **Moment** as the payment method.
  </Step>

  <Step title="Pay with a test card">
    On the hosted page, use one of the [test cards](/api-reference/getting-started/testing) to simulate a success or a decline.
  </Step>

  <Step title="Check the order status">
    Confirm the order updates in WooCommerce to match the result of the payment.
  </Step>
</Steps>

***

## Go live

<Steps>
  <Step title="Swap in your live keys">
    Replace the test keys with your live **Secret Key**, **Public Key**, and **Webhook Signing Secret**.
  </Step>

  <Step title="Register your production webhook">
    Add your live store's webhook endpoint (`https://yourstore.com/?wc-api=moment_webhook`) in your Moment account.
  </Step>

  <Step title="Serve your store over HTTPS">
    Moment requires HTTPS for live webhook delivery. Make sure your store has a valid certificate.
  </Step>

  <Step title="Confirm your currency">
    Check that your store currency is set to ZAR.
  </Step>
</Steps>

<Warning>
  Live mode moves real funds. Complete your testing in test mode before switching keys.
</Warning>

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Moment does not appear at checkout">
    Check that the plugin is activated, the gateway is enabled under **WooCommerce → Settings → Payments**, a Secret Key is set, and your store currency is ZAR.
  </Accordion>

  <Accordion title="Orders stay pending or on hold">
    Confirm your webhook endpoint is registered in your Moment account and the Webhook Signing Secret matches. Some methods such as EFT stay on hold until the payment clears. Enable Debug logging and review **WooCommerce → Status → Logs** for verification errors.
  </Accordion>

  <Accordion title="Where do I find my API keys?">
    Your Secret and Public keys identify your Moment account. See [Authentication](/api-reference/getting-started/authentication) for how test and live keys work. If you do not have keys, contact the [Moment team](/documentation/support).
  </Accordion>

  <Accordion title="A refund failed">
    A refund needs a captured Moment payment on the order. If the payment is still pending or the order has no Moment payment recorded, the refund cannot be processed. Check the order notes and the WooCommerce logs for the specific error.
  </Accordion>

  <Accordion title="Does the plugin support subscriptions?">
    Yes. Install and activate the WooCommerce Subscriptions extension and the plugin detects it automatically. Initial payments use the hosted checkout, and renewals are charged server side without customer interaction.
  </Accordion>
</AccordionGroup>

***

## Need help?

Reach out to the [Moment team](/documentation/support) if you get stuck or have a question about your integration.
