=== Layer Flow Gateway Payments for WooCommerce ===
Contributors: layerflowgateway
Tags: usdc, base, stablecoin, payments, checkout
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept USDC on Base in WooCommerce through Layer Flow Gateway hosted checkout.

== Description ==

Add "Pay by Layer Flow Gateway" to your WooCommerce checkout. Customers are redirected to Layer Flow Gateway's hosted checkout, pay in USDC on Base, and are sent back to your store. Orders are marked paid automatically from Layer Flow Gateway's signed webhook.

* Works with the Cart & Checkout blocks and the classic shortcode checkout.
* Compatible with High-Performance Order Storage (HPOS).
* Wallet screening and confirmation are handled by Layer Flow Gateway.
* Non-custodial: funds settle to your Layer Flow Gateway business wallet.
* Test mode takes USDC on Base Sepolia (testnet).

**Requirements:** a Layer Flow Gateway business account on a monthly plan (API keys are part of monthly plans), and a store currency of USD.

== Installation ==

1. Plugins → Add New → Upload Plugin, choose `layer-flow-gateway-woocommerce.zip`, then Activate.
2. In the Layer Flow Gateway dashboard, go to Settings → API Keys and create a key. Copy the **API key** and the **webhook signing secret** — each is shown only once.
3. In WooCommerce → Settings → Payments → Layer Flow Gateway Payments, paste both values, tick Enable, and Save. The plugin checks the key with Layer Flow Gateway and shows "Layer Flow Gateway API key verified."

No webhook configuration is needed: the plugin sends its webhook URL with every payment.

== Frequently Asked Questions ==

= Which currencies and networks are supported? =

USDC on Base. Turn on Test mode to take USDC on Base Sepolia (testnet) while you set up.

= Why doesn't the payment method appear at checkout? =

The store currency must be USD, and an API key must be saved. An admin notice explains when the currency is the reason.

= How do order statuses change? =

* Payment confirmed → Processing (or Completed for virtual/downloadable orders).
* Underpaid, overpaid, wrong token/network, or manual review → On hold, with a note.
* Wallet screening failed → Failed.
* Expired → a note only; a late payment can still complete the order.

= What happens if I revoke the API key? =

New checkouts stop immediately: customers see "Layer Flow Gateway is currently unavailable", and saving the settings shows why. Create a new key and paste it in to resume.

= The customer paid but the order is still Pending =

Check WooCommerce → Status → Logs (source `layer-flow-gateway`). If your site can't receive webhooks (e.g. behind a firewall or on localhost), the order is still updated when the customer returns to the order-received page.

= Can I refund from WooCommerce? =

Not yet. Refunds are handled from the Layer Flow Gateway dashboard.

== Changelog ==

= 0.2.1 =
* Removed the API base URL setting. The plugin always connects to Layer Flow Gateway's production API.

= 0.2.0 =
* Sends the order's billing email, so the hosted checkout sends the verification code right away and opens on the code step. Links without an email keep the normal email step.
* A pending order only reuses its payment link if it was created with the currently configured API key (after rotating keys, customers get a fresh link).

= 0.1.0 =
* First release: hosted checkout redirect, signed webhooks, return-page reconcile, API key check on save, blocks + HPOS support.
