=== PatSaTECH's Opayo Direct Gateway for WooCommerce ===
Contributors: patsatech
Tags: ecommerce, payment gateway, woocommerce,opayo direct,opayo go
Requires at least: 6.0
Tested up to: 6.9.4
WC tested up to: 10.6.1
Stable tag: 1.3.2
License: GPLv2 or later

Accept Opayo Direct card payments in WooCommerce with on-site checkout, Checkout Block support, and HPOS compatibility.

== Description ==

This plugin adds **Opayo Direct** as a WooCommerce payment gateway so customers can pay by card without leaving your store.

**Highlights**

* On-site card entry using the standard WooCommerce credit card form (customisable card fields).
* Supports **WooCommerce Checkout Block** (cart/checkout blocks) in addition to classic checkout.
* Declares compatibility with **WooCommerce HPOS** (High-Performance Order Storage / custom order tables).
* **PSD2**, Strong Customer Authentication (**SCA**), and **3D Secure v2** flows for eligible transactions.
* Vendor test and live modes, configurable card types, and optional shipping data to Opayo.

Opayo Direct is a server-to-server integration: you control branding and the checkout experience while card data is handled according to your PCI scope. You need an **Opayo** merchant account with Direct integration enabled.

**Requirements**

* WordPress and **WooCommerce** installed and up to date.
* A valid **SSL certificate** (HTTPS) on your checkout site.
* **PCI DSS** compliance is your responsibility for how you collect and transmit card data; consult Opayo and your QSA as needed.

More information: http://www.patsatech.com/

== Installation ==

1. **Prerequisites:** Install and activate **WooCommerce**. Ensure your site uses **HTTPS** and you have Opayo Direct credentials (vendor name, integration passwords, and access to the Opayo dashboard).

2. **Install the plugin**
   * **Upload ZIP:** In WordPress go to **Plugins → Add New → Upload Plugin**, choose the plugin zip, then click **Install Now** and **Activate**; or
   * **FTP/SFTP:** Unzip the package and upload the plugin folder to `wp-content/plugins/`, then activate under **Plugins**.

3. **Configure the gateway:** Open **WooCommerce → Settings → Payments**, find **Opayo Direct**, and click **Manage** (or **Set up**).

4. Enter your **Vendor name**, choose **test** or **live** mode, set the transaction type and any other options your account requires, then **Save changes**.

5. Run a **test transaction** in test mode before switching to live. If you use the **Checkout block**, verify payment and 3D Secure redirects on a staging site first.

== Changelog ==

= 1.0.0 =
* Initial Release

= 1.2.5 =
* Have added woocommerce credit card form for seemless integration.
* Updated to support WooCommerce 2.6+
* Added card logos.

= 1.2.6 =
* Have resolved a bug which was preventing redirection to 3D Authorizatoin page.

= 1.2.7 =
* Updated the plugin to support latest version of WooCommerce 3.0+ and Wordpress.

= 1.3.0 =
* Updated the plugin to support latest version of WooCommerce 3.7+ and Wordpress 5.2+
* Added support for SagePay Payment Services Directive 2, Strong Customer Authentication and 3D Secure v2

= 1.3.1 =
* Updated the url as per the notification from Elavon.
* Updated to add support WooCommerce HPOS system.

= 1.3.2 =
* **Checkout Block:** Fixed payment method registration so Opayo Direct shows and processes correctly (WooCommerce Blocks requires React elements for `label`, `content`, and `edit`; settings loaded via `getPaymentMethodData` / `paymentMethodData`).
* **Checkout Block:** Card expiry auto-formats as MM/YY while typing (e.g. 1233 → 12/33); submitted value is normalised to the `MM / YY` format the gateway expects.
* **3D Secure:** On-page challenge iframe is centered horizontally with intro and fallback text aligned to the same column.
* **Order notes:** After a successful payment, the private order note includes the Opayo **Transaction ID** (VPSTxId).
* **Stability:** Runtime hooks (receipt page, API callbacks, etc.) register only once if the gateway class is instantiated multiple times—avoids duplicate 3DS iframes or receipt output.
* **Logging:** Optional **debug logging** to **WooCommerce → Status → Logs** (source `opayo-direct`); summaries exclude card numbers, CV2, and security keys.
* Declares **cart/checkout blocks** compatibility for WooCommerce feature checks alongside existing HPOS declaration.
