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 (it ends in /wp-json/utopia/v1/webhook), then paste its whsec_ secret into the plugin settings.

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

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 its API key starts with sk_live_ or sk_test_. In WooCommerce, open Status → Logs and select the utopia-payments source to inspect checkout or confirmation errors.

The store currency must be enabled for the selected Utopia key. KWD, BHD and OMR use three minor-unit digits; the plugin converts WooCommerce decimal totals accordingly. See Currencies and amounts.

Questions

Which currencies are supported? The currencies enabled for your Utopia account. The order is charged in the store currency.

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

On this page