=== ChainPay Payment Gateway ===
Contributors: chainpay
Tags: crypto, bitcoin, woocommerce, payments, blockchain, non-custodial
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept Bitcoin, Litecoin & 12+ cryptocurrencies in WooCommerce. Free: 50 payments/month with BTC+LTC. Pro license ($49/yr) unlocks unlimited payments, all 14 coins, per-domain activation. Powered by chainpay.store

== Description ==

ChainPay is a fully non-custodial crypto payment gateway for WooCommerce. Funds go directly to YOUR wallet using xPub HD derivation — no middleman, no custody.

= FREE PLAN (no license needed) =
* Bitcoin (BTC) + Litecoin (LTC)
* xPub HD wallet derivation
* 50 payments per month
* 1.0% platform fee

= PRO LICENSE ($49/year) =
* All 14 cryptocurrencies
* Unlimited payments per month
* 0.25% platform fee
* Domain-locked activation (one key per domain)
* Smart coin routing (hides high-fee coins automatically)
* Webhook IPN notifications
* Full API access
* Priority support

Purchase at: https://chainpay.store/pricing

= HOW DOMAIN LOCKING WORKS =
Each Pro license key is tied to one domain upon first activation. The key will only work on that domain. To move it to another domain: go to ChainPay → License → Deactivate, then activate on the new domain.

== Installation ==
1. Download the plugin ZIP from chainpay.store/plugins
2. Go to WP Admin → Plugins → Add New → Upload Plugin
3. Activate the plugin
4. Go to WooCommerce → Settings → Payments → Enable ChainPay
5. Go to WP Admin → ChainPay to configure:
   - Add your xPub key for BTC (and LTC) under Wallets tab
   - Optionally enter your chainpay.store API key
   - Activate your Pro license key if you have one

== Frequently Asked Questions ==

= Does ChainPay hold my funds? =
No. All payments go directly to your wallet via xPub HD derivation. We never touch your funds.

= What is the 50 payment limit? =
Free plan users can process up to 50 crypto payments per month. This resets on the 1st of each month. Upgrade to Pro for unlimited payments.

= Can I use the same license on multiple sites? =
No — Pro licenses are domain-locked. Each domain needs its own license. Contact sales@chainpay.store for multi-site pricing.

= What coins are free? =
Bitcoin (BTC) and Litecoin (LTC) are always free. A Pro license unlocks all 14 coins.

= How do I get a license? =
Purchase at https://chainpay.store/pricing — $49/year.

== Changelog ==

= 1.1.0 =
* NEW: 50 payments/month free limit enforced at checkout, invoice creation, and AJAX
* NEW: Domain-locked Pro licensing — one key per domain
* NEW: Monthly usage meter in admin panel with visual progress bar
* NEW: Limit warning banner when free plan limit is reached
* NEW: Payment page shows proper error UI for limit/license issues
* NEW: API syncs real usage count on every license verify
* NEW: `CHAINPAY_FREE_LIMIT` and `CHAINPAY_FREE_COINS` global constants
* IMPROVED: License class tracks domain, monthly count, offline grace period
* IMPROVED: Invoice class increments monthly counter on every payment
* IMPROVED: Gateway blocks at `woocommerce_checkout_process` + `process_payment` (two layers)

= 1.0.3 =
* Complete clean rebuild — fixed directory structure
* Payment page fully self-contained (all CSS/JS/QR inline)
* Zero theme CSS conflicts on any WordPress theme

= 1.0.2 =
* Self-contained payment page to fix theme CSS conflicts

= 1.0.1 =
* Domain update to chainpay.store
