=== PayCoinPro Payment Gateway for WooCommerce ===
Contributors: paycoinpro
Donate link: https://paycoinpro.com
Tags: woocommerce, payment gateway, cryptocurrency, bitcoin, ethereum, crypto payments, accept bitcoin, accept cryptocurrency, btc, eth, litecoin, usdt, crypto checkout
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Requires Plugins: woocommerce
WC requires at least: 6.0
WC tested up to: 8.5
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept cryptocurrency payments on your WooCommerce store. Let customers pay with Bitcoin, Ethereum, Litecoin, USDT, and 50+ other cryptocurrencies via PayCoinPro.

== Description ==

**Accept Bitcoin & Crypto Payments on Your WooCommerce Store**

PayCoinPro Payment Gateway for WooCommerce enables your online store to accept cryptocurrency payments including Bitcoin (BTC), Ethereum (ETH), Litecoin (LTC), Tether (USDT), USD Coin (USDC), and many other popular cryptocurrencies.

Join the growing number of merchants accepting crypto payments and tap into the 400+ million cryptocurrency users worldwide.

= 💰 Why Accept Crypto Payments? =

* **Lower Fees** — Save up to 80% compared to credit card processors (typically 1% vs 2.9% + $0.30)
* **No Chargebacks** — Cryptocurrency transactions are irreversible once confirmed. Say goodbye to fraudulent chargebacks
* **Global Reach** — Accept payments from anywhere in the world without cross-border restrictions
* **Faster Settlement** — Receive funds in minutes, not days. Improve your cash flow
* **Privacy-Focused** — Attract privacy-conscious customers who prefer crypto payments
* **Growing Market** — 400+ million crypto users looking to spend their digital assets

= ✨ Key Features =

* **Easy Setup** — Configure in minutes with just API Key and Webhook Secret
* **Multiple Cryptocurrencies** — Accept BTC, ETH, LTC, USDT, USDC, and 50+ other coins
* **Test Mode** — Full sandbox environment for testing before going live
* **Automatic Order Updates** — Webhooks automatically update order status when payments are confirmed
* **Refund Support** — Process refunds directly from WooCommerce admin
* **HPOS Compatible** — Works with WooCommerce High-Performance Order Storage
* **Secure** — HMAC-SHA256 webhook signature verification with replay attack protection
* **Debug Logging** — Optional detailed logging for troubleshooting

= 🔒 Security First =

Security is paramount when handling payments. PayCoinPro gateway includes:

* **Cryptographic Verification** — All webhooks are signed with HMAC-SHA256
* **Timestamp Validation** — Prevents replay attacks with 5-minute tolerance
* **No Sensitive Data** — Payment details never touch your server
* **Bearer Token Auth** — Secure API authentication

= 🚀 How It Works =

1. Customer selects "Pay with Cryptocurrency" at checkout
2. Customer is redirected to PayCoinPro's secure payment page
3. Customer chooses their preferred cryptocurrency and pays
4. PayCoinPro sends a webhook when payment is confirmed
5. Order automatically updates to "Processing" or "Completed"

= 📋 Requirements =

* WordPress 5.8 or higher
* WooCommerce 6.0 or higher
* PHP 7.4 or higher
* SSL certificate (HTTPS required)
* PayCoinPro merchant account — [Sign up free](https://paycoinpro.com)

= 📚 Documentation =

Comprehensive documentation is included in the `docs/` folder:

* [Getting Started](docs/README.md) — Quick start guide and overview
* [Installation Guide](docs/INSTALLATION.md) — Step-by-step setup instructions
* [Configuration](docs/CONFIGURATION.md) — Detailed settings reference
* [Webhooks](docs/WEBHOOKS.md) — Webhook setup and troubleshooting
* [FAQ](docs/FAQ.md) — Frequently asked questions
* [Troubleshooting](docs/TROUBLESHOOTING.md) — Debug guide and solutions

= 🌐 Supported Cryptocurrencies =

Accept payments in the most popular cryptocurrencies:

* Bitcoin (BTC)
* Ethereum (ETH)
* Litecoin (LTC)
* Bitcoin Cash (BCH)
* Tether (USDT) — ERC-20 and TRC-20
* USD Coin (USDC)
* Dogecoin (DOGE)
* And many more...

The available cryptocurrencies depend on your PayCoinPro account settings.

== Installation ==

= Automatic Installation (Recommended) =

1. Log in to your WordPress admin panel
2. Navigate to **Plugins → Add New**
3. Search for "PayCoinPro Payment Gateway"
4. Click **Install Now** and then **Activate**
5. Go to **WooCommerce → Settings → Payments → PayCoinPro** to configure

= Manual Installation =

1. Download the plugin zip file
2. Log in to your WordPress admin panel
3. Navigate to **Plugins → Add New → Upload Plugin**
4. Choose the zip file and click **Install Now**
5. Click **Activate**

= FTP Installation =

1. Download and extract the plugin zip file
2. Upload the `paycoinpro-gateway` folder to `/wp-content/plugins/`
3. Activate the plugin through the **Plugins** menu in WordPress

= Configuration =

1. Navigate to **WooCommerce → Settings → Payments**
2. Click **Manage** next to PayCoinPro
3. Enable the payment gateway
4. Enter your PayCoinPro **API Key**
5. Enter your **Webhook Secret**
6. Add the webhook URL to your PayCoinPro dashboard:
   `https://yoursite.com/wp-json/paycoinpro/v1/webhook`
7. (Optional) Enable **Test Mode** for sandbox testing
8. Click **Save changes**

= Getting Your API Credentials =

1. Log in to [PayCoinPro Dashboard](https://paycoinpro.com)
2. Navigate to **Settings → API Keys** to get your API Key
3. Navigate to **Settings → Webhooks** to get your Webhook Secret

== Frequently Asked Questions ==

= Where do I get my API Key and Webhook Secret? =

Log in to your [PayCoinPro merchant dashboard](https://paycoinpro.com). Navigate to **Settings → API Keys** to find your API Key and **Settings → Webhooks** to generate a Webhook Secret.

= How do I test the integration? =

Enable "Test Mode" in the plugin settings. This uses PayCoinPro's sandbox environment where you can make test payments without real cryptocurrency.

= Why isn't the payment option showing at checkout? =

Common reasons:
1. Gateway not enabled — Check **WooCommerce → Settings → Payments**
2. API Key not configured — Enter your API Key in settings
3. Cart conditions not met — Check minimum order amounts
4. Plugin conflict — Try deactivating other plugins temporarily

See the [Troubleshooting Guide](docs/TROUBLESHOOTING.md) for more solutions.

= What cryptocurrencies are supported? =

PayCoinPro supports Bitcoin (BTC), Ethereum (ETH), Litecoin (LTC), USDT, USDC, and many other cryptocurrencies. The available options depend on your PayCoinPro account settings.

= How long do payments take to confirm? =

Payment confirmation times vary by cryptocurrency:
* Bitcoin: 10-30 minutes (1-3 confirmations)
* Ethereum: 2-5 minutes (12+ confirmations)
* Litecoin: 2-5 minutes (6 confirmations)

The plugin automatically updates your order when the payment is confirmed on the blockchain.

= Is this plugin secure? =

Yes. All webhook communications are verified using HMAC-SHA256 signatures with timestamp validation. The plugin never stores sensitive payment information on your server.

= Does this plugin support refunds? =

Yes, refunds can be initiated from the WooCommerce order admin page. The refund request is sent to PayCoinPro for processing.

= Is the plugin compatible with WooCommerce HPOS? =

Yes, the plugin is fully compatible with WooCommerce High-Performance Order Storage (HPOS).

= Can I customize the payment method title? =

Yes, go to **WooCommerce → Settings → Payments → PayCoinPro** and edit the "Title" and "Description" fields to customize what customers see at checkout.

= What happens if a customer underpays? =

If a customer sends less than the required amount, the order is placed "On Hold" with a note showing the received vs expected amounts. You can then decide to request the remaining amount or issue a partial refund.

= How do I check if webhooks are working? =

1. Enable **Debug Log** in the plugin settings
2. Create a test order (with Test Mode enabled)
3. Complete the payment
4. Check **WooCommerce → Status → Logs** and select the `paycoinpro` log

= Where can I get support? =

* Documentation: [docs.paycoinpro.com](https://docs.paycoinpro.com/woocommerce)
* Support Portal: [support.paycoinpro.com](https://support.paycoinpro.com)
* Email: support@paycoinpro.com

== External services ==

This plugin connects to the PayCoinPro API to process cryptocurrency payments. When a customer chooses to pay with cryptocurrency at checkout, the plugin communicates with PayCoinPro servers to create payment invoices and process transactions.

= What data is sent and when =

**During checkout (when customer selects cryptocurrency payment):**
* Order amount and currency
* Order ID and order key
* Customer email address (for payment receipts)
* Store name (for invoice description)
* Success/cancel redirect URLs
* Webhook callback URL

**During refund processing:**
* Invoice ID
* Refund amount
* Refund reason

**No sensitive data is sent:**
* Customer passwords are never transmitted
* Full shipping addresses are not sent
* Payment card details are not applicable (crypto only)

= Service provider =

This plugin relies on PayCoinPro (https://paycoinpro.com) as the payment processor:

* **Service website:** [https://paycoinpro.com](https://paycoinpro.com)
* **Terms of Service:** [https://paycoinpro.com/terms](https://paycoinpro.com/terms)
* **Privacy Policy:** [https://paycoinpro.com/privacy](https://paycoinpro.com/privacy)

By using this plugin, you agree to PayCoinPro's Terms of Service and Privacy Policy. Please review these documents to understand how your data and your customers' data is handled.

== Screenshots ==

1. **Settings Page** — Configure your API Key, Webhook Secret, and other options in WooCommerce
2. **Checkout Page** — PayCoinPro payment option displayed at WooCommerce checkout
3. **Payment Page** — Secure PayCoinPro page where customers select cryptocurrency and pay
4. **Order Confirmation** — Order details showing PayCoinPro invoice information
5. **Order Notes** — Automatic order notes with payment confirmation details

== Changelog ==

= 1.0.0 (2026-02-24) =

**Initial Release**

* 🎉 WooCommerce payment gateway integration
* 💳 Support for 50+ cryptocurrencies via PayCoinPro
* 🔐 Webhook handling with HMAC-SHA256 signature verification
* ⏰ Timestamp validation with 5-minute tolerance (replay attack protection)
* 🧪 Test mode support for sandbox testing
* 🔄 Automatic order status updates via webhooks
* 💸 Refund support through WooCommerce admin
* 📦 WooCommerce HPOS (High-Performance Order Storage) compatibility
* 📝 Comprehensive debug logging
* 🔗 Order metadata storage (invoice ID, transaction hash, crypto amount)
* 📧 Email notification integration
* 🏪 Thank you page integration with invoice details
* 🌐 Localhost detection (prevents invalid callback URLs in development)

**Webhook Events Supported:**
* `invoice.paid` — Payment received
* `invoice.confirmed` — Payment confirmed on blockchain
* `invoice.expired` — Invoice timed out
* `invoice.cancelled` — Invoice cancelled
* `invoice.underpaid` — Partial payment received
* `invoice.overpaid` — Excess payment received

== Upgrade Notice ==

= 1.0.0 =
Initial release of PayCoinPro Payment Gateway for WooCommerce. Start accepting cryptocurrency payments today!

== Privacy Policy ==

This plugin sends order information to PayCoinPro servers to create payment invoices. Data sent includes:

* Order amount and currency
* Customer email address (for payment receipts)
* Order ID (for reference)
* Site name (for invoice description)

The plugin does NOT send:
* Customer passwords
* Full shipping addresses
* Payment card details

Please review PayCoinPro's privacy policy at [paycoinpro.com/privacy](https://paycoinpro.com/privacy) for details on how payment data is handled.

== Additional Info ==

**GitHub Repository:** Coming soon

**Contributing:** We welcome contributions! Please submit issues and pull requests.

**Translations:** The plugin is translation-ready. Help us translate it into your language!

== Support ==

For support, please visit:

* **Documentation:** [docs.paycoinpro.com/woocommerce](https://docs.paycoinpro.com/woocommerce)
* **Support Portal:** [support.paycoinpro.com](https://support.paycoinpro.com)
* **Email:** support@paycoinpro.com

When contacting support, please include:
* WordPress version
* WooCommerce version
* PayCoinPro plugin version
* PHP version
* Error messages or logs
* Steps to reproduce the issue
