Integrations
WordPress / WooCommerce

WordPress / WooCommerce

The Lunixi for WordPress plugin connects your WordPress site to Lunixi. It provides a card payment method for WooCommerce; the card form is shown by Lunixi Checkout, and card data never reaches your server.

  • WooCommerce payment method: card payments with 3D Secure; works with the classic and the block-based checkout and is compatible with HPOS (High-Performance Order Storage).
  • Pre-authorization (preauth): hold the amount at checkout and capture it when you complete the order, or release it by cancelling the order.
  • Refunds: full or partial refunds from the WooCommerce admin.
  • Signed webhooks: the order state is set by signature-verified webhooks, not by the browser return.
  • Encrypted storage: the private key and the webhook secret are stored encrypted in the database.
  • PCI SAQ-A: the card form is shown and tokenised by Lunixi.

Requirements

WordPress6.4 or newer
WooCommerce8.0 or newer (for the payment method)
PHP7.4 or newer
ComposerFor installing from source

Source code: GitHub (opens in a new tab) · Release: v0.2.4 (opens in a new tab)

Installation

Install the plugin from source

The plugin is installed from its source repository on GitHub. The repository is not an installation package for the WordPress admin's "Upload Plugin" screen: the plugin loads the PHP SDK (lunixi/php-sdk) from its vendor/ folder, so when you install from source you install the dependencies with Composer.

cd wp-content/plugins
git clone --branch v0.2.4 https://github.com/Lunixi-Payment/lunixi-wordpress.git lunixi
cd lunixi
composer install --no-dev

If your server has no Composer, run these steps on your own machine and upload the whole lunixi folder to your site's wp-content/plugins folder. Then activate Lunixi for WordPress on the Plugins screen; a Lunixi entry appears in the admin menu.

Enter your API credentials

On the Lunixi → Settings screen enter:

FieldValue
EnvironmentLive or Test
Key IDThe id of the API key you created in the Lunixi dashboard
Private Key (PEM)The key's private key (starts with -----BEGIN PRIVATE KEY-----)
Webhook SecretThe secret of your webhook endpoint

The private key and the webhook secret are stored encrypted; after saving, the fields appear empty, and leaving them empty keeps the stored value. Use the Test connection button on the Lunixi → Payments screen to check that the credentials work.

Register the webhook URL

Register the webhook URL shown on the Lunixi → Settings screen as a webhook endpoint in the Lunixi dashboard, and enter the endpoint's secret in the Webhook Secret field. The URL has this form:

https://your-site.com/wp-json/lunixi/v1/webhook

→ Webhook Setup

Enable the payment method

Enable Lunixi under WooCommerce → Settings → Payments.

Payment method settings

SettingDescription
Enable/DisableTurns the payment method on or off
TitleThe name shown at checkout (default: Credit / Debit Card)
DescriptionThe text shown under the name at checkout
CaptureCapture immediately: the amount is taken at checkout (recommended). Pre-authorization (preauth): the amount is held and taken later.

The API credentials are shared by all Lunixi modules and are entered only on the Lunixi → Settings screen.

Order flow

  1. The buyer picks Lunixi at checkout and enters the card in the Lunixi Checkout form, completing 3D Secure when needed.
  2. The signature-verified webhook decides whether the order becomes paid or failed. The browser return alone never marks the order paid.
  3. The Lunixi payment box on the order screen shows the payment id, the 3D Secure state and the instalment count.

Pre-authorization

When Capture is Pre-authorization (preauth) the amount is held on the card, not taken:

  • Setting the order to Completed captures the held amount.
  • Setting the order to Cancelled releases the hold.

The result of either action is added to the order as a note.

Refunds

Use the refund button on the WooCommerce order screen for a full or partial refund; the refund is sent to Lunixi.

Missed webhooks

Lunixi retries a failed delivery. If your site was unreachable for a long time, a scheduled task of the plugin runs every 15 minutes, reads from Lunixi the payment of orders pending for more than 20 minutes and updates the order accordingly. The task runs on WordPress cron; make sure WP-Cron runs on your site.

Non-card methods such as promissory notes appear in Lunixi Checkout when you enable them in your form settings; the plugin needs no extra setting.

Related