=== web3escrow Payments ===
Contributors: web3escrow
Tags: woocommerce, payment-gateway, escrow, web3, polygon, usdc, crypto, smart-contract
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 0.3.6
License: MIT
License URI: https://opensource.org/licenses/MIT

Non-custodial on-chain escrow for WooCommerce. Buyers lock USDC in audited smart contracts on Polygon. Funds release on confirmed delivery, refund after deadline.

== Description ==

**web3escrow Payments** turns your WooCommerce store into a Web3-friendly shop with a built-in trust layer:

* **Non-custodial.** The plugin never holds keys, signers or funds. Each order deploys a fresh smart-contract escrow on Polygon — that contract is the custodian.
* **Milestone release.** Funds release to the seller only when the buyer confirms receipt on-chain.
* **Deadline-enforced refunds.** If the deadline passes without a release, the buyer can refund themselves on-chain — no support ticket required.
* **USDC settlement.** Stable, predictable amounts on a low-fee EVM chain.
* **Drop-in payment method.** Sits alongside cards/PayPal in your WooCommerce checkout. Customers without a Web3 wallet just pick a different method.

= Customer flow =

1. Customer places order, picks "Pay with web3escrow".
2. They're redirected to a wallet screen, sign 3 transactions: deploy escrow, approve USDC, deposit.
3. Order goes to **on-hold** the moment the deposit is confirmed on-chain.
4. After delivery, customer goes to *My Account → My Escrows* and presses **Confirm receipt** (one signature). Order moves to **completed**, seller receives USDC.
5. If delivery is missed, after the deadline the customer can press **Refund** — funds return to their wallet.

= Shop owner flow =

* Set your seller wallet address once in *WooCommerce → Settings → Payments → web3escrow*.
* Confirm network: Polygon mainnet.
* Set the default deadline (default 14 days).
* That's it. Each order shows the escrow contract address, on-chain status, and a link to the explorer.

= Why this is safe =

* The platform (web3escrow.net) **cannot move your funds**. The arbiter role can only enforce the contract's rules; it cannot sweep balances.
* Even if this plugin disappears tomorrow, your escrow is still on-chain and settles via the contract directly.
* All contract source is public; addresses default to the audited deployment on Polygon.

== Installation ==

1. Upload the plugin zip via *Plugins → Add New → Upload Plugin*.
2. Activate it.
3. Go to *WooCommerce → Settings → Payments → web3escrow*.
4. Enable, paste your **seller wallet address**, save.
5. Confirm you're on Polygon mainnet. This is live, real-money settlement in USDC — run a small end-to-end order first.

== Frequently Asked Questions ==

= Do you ever hold customer funds? =

No. The plugin redirects the buyer to their own wallet, which signs the on-chain calls. The deposit goes straight into the escrow contract.

= What chains are supported? =

Polygon mainnet (USDC). Other EVM chains are on the roadmap.

= What does it cost? =

The plugin is free. Customers pay Polygon gas (cents). There is no built-in protocol fee in v0.1.0.

= What if my customer doesn't have a Web3 wallet? =

They simply pick a different payment method at checkout. web3escrow appears alongside your other gateways.

= How are disputes handled? =

The arbiter role is configurable. By default it points to web3escrow.net's arbiter. Disputes are off-chain coordination; the arbiter can only enforce the contract.

== Changelog ==

= 0.3.6 =
* Thank-you page is now a proper "welcome / next steps" panel: confirms funds are locked, explains what happens next, shows the escrow address, and gives two ways to manage the escrow — here in WooCommerce (My Escrows) or on web3escrow.net with the buyer's wallet.
* After funding, the buyer is redirected to the welcome page almost immediately (was an 800ms wait, now 250ms).
* My Escrows tab and order emails now link to web3escrow.net, where buyers connect their wallet to see all escrows and on-chain transactions.
* Release / refund now show a gradual, descriptive step checklist (connecting → approve in wallet → on-chain → done) instead of a single terse line.
* Release / refund now flip the WooCommerce order status immediately ("Escrow released" / "Escrow refunded"), verified on-chain, instead of waiting for the indexer webhook or cron.
* Every lifecycle phase now maps to a WooCommerce status, including a new "Escrow created" phase (contract deployed, awaiting funding): placed → created → funded → released/refunded.
* My Escrows status badges are now colour-coded per phase (created = indigo, funded = violet, released = green, refunded = red, disputed = amber).
* All status transitions now go through one shared, forward-only on-chain state mapper used by the checkout, the My Escrows page, the REST endpoints, the polling cron, AND the inbound webhook — so an order stays in sync no matter where the action happens (WooCommerce or web3escrow.net) and a retried/out-of-order event can never move an order backward.

= 0.1.1 =
* Updated the Polygon factory address to the new audited factory (`0x824AB0Aa…`).
* Polygon safety: factory and arbiter are required; until set, the gateway is hidden from checkout.
* Admin UI: added a readiness banner that flags missing factory/arbiter and warns when real USDC is at stake.
* Updated field descriptions on Network, Factory override and Arbiter override to make the requirements explicit.

= 0.1.0 =
* Initial release.
* WooCommerce payment gateway with 3-tx checkout flow.
* My Account → My Escrows tab with confirm-receipt and refund actions.
* Order admin meta box with escrow address + explorer link.
* 1-minute cron poller that syncs on-chain state to WC order status.
* HPOS-compatible.

== Upgrade Notice ==

= 0.1.1 =
Recommended upgrade. The old factory address is replaced with the audited one; checkout is now refused until factory + arbiter are configured.

= 0.1.0 =
First release. Live on Polygon, settled in USDC.
