Utopia PaymentsDocs

WooCommerce

Accept card payments in a WooCommerce store through Utopia's hosted checkout.

The Utopia Payments plugin adds a card payment method to your WooCommerce checkout:

  • Customers pay on Utopia's secure hosted page, so card details never touch your store.
  • Orders are marked paid from a signed webhook, and confirmed again with the API when the customer returns.
  • Works with the classic and block-based checkout, and with WooCommerce's order tables (HPOS).

Requires WordPress 6.3+, WooCommerce 8.0+ and PHP 8.1+.

Install

  1. Download the plugin zip.
  2. In WordPress, open Plugins → Add New → Upload Plugin, choose the zip and activate it.
  3. In Dashboard → Developers, create a secret API key.
  4. In WooCommerce → Settings → Payments → Utopia Payments, enable the gateway and paste the key.
  5. In the Utopia dashboard, add a webhook endpoint with the URL shown under Webhook signing secret, then paste its whsec_ secret into the plugin settings.

Copy that URL from the settings field rather than typing it. The plugin receives events on a WordPress REST route, and WordPress addresses those two ways: with pretty permalinks the URL ends in /wp-json/utopia/v1/webhook, while a site left on plain permalinks is reachable only at ?rest_route=/utopia/v1/webhook. Both work; the field always shows the one your site answers on. If you change the permalink setting afterwards, update the endpoint in the Utopia dashboard too — deliveries go to the exact URL saved there, and the old one will start returning 404.

Your store must also be reachable from the internet over HTTPS. Utopia refuses endpoints that are plain HTTP or point at a private, loopback or .local address, so a store on your own machine needs a tunnel that gives it a public HTTPS URL.

The plugin is not listed on WordPress.org yet. The zip above is the tested plugin packaged by this project.

Multisite

The plugin works on a WordPress network, per site. It has no network-wide settings screen: the gateway settings, the API key and the webhook secret are stored per site, and each site answers on its own webhook URL. So after activating it (per site, or across the network), configure each store separately, and register a separate webhook endpoint in the Utopia dashboard for each one. A key per site is worth the extra minute: revoking one then stops one store rather than all of them.

Remember the endpoint limit while you plan: each mode holds 16 webhook endpoints, so a network larger than that needs more than one Utopia account.

How orders are paid

  1. At checkout, the plugin creates a checkout session for the exact order total and sends the customer to it.
  2. The customer pays, and payment.succeeded reaches your store's webhook URL.
  3. The plugin checks the signature, that the payment belongs to this order and that the amount matches, then marks the order paid.
  4. When the customer returns to the thank-you page, the plugin confirms the payment with the API as well, so the order is paid even if a webhook is delayed.

Failed, cancelled and abandoned payments leave the WooCommerce order in Pending payment. The plugin marks it paid only after a signed webhook or a successful API confirmation matches the order id, order key, currency and amount.

Test mode

Use an sk_test_ key to keep plugin payments separate from live data. Test checkout creation returns TEST_MODE_UNAVAILABLE until sandbox payments are enabled for the Utopia account. There are no public test card numbers while that mode is unavailable.

Troubleshooting

The payment method is hidden from checkout until it is enabled and an API key starting with sk_ is saved. In WooCommerce, open Status → Logs and select the utopia-payments source to inspect checkout or confirmation errors.

The store currency must be one of the currencies enabled for your account (GET /account lists them); the plugin converts WooCommerce decimal totals to minor units. See Currencies and amounts.

Questions

Which currencies are supported? The currencies enabled for your account, which GET /account lists; the store currency must be one of them.

Does it support WooCommerce Subscriptions? Not yet. One-time payments are supported today.

On this page