=== NakoPay for WooCommerce ===
Contributors: nakopay
Tags: bitcoin, crypto payments, lightning, usdt, payment gateway
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: MIT
License URI: https://opensource.org/licenses/MIT

Accept Bitcoin, Lightning, USDT and other crypto at checkout. Non-custodial: payments go straight to your own wallet.

== Description ==

NakoPay adds a crypto payment method to WooCommerce. The customer pays in Bitcoin (on-chain or Lightning), USDT or another supported coin, and the money arrives in the wallet you connected in your NakoPay account. NakoPay never holds your funds.

* Works with the classic checkout and the Cart and Checkout blocks.
* Compatible with High-Performance Order Storage (HPOS).
* The receipt page shows the amount, address and QR code on your own store, with a link to the NakoPay checkout for other coins and networks.
* Orders are completed by a signed webhook (HMAC-SHA256, 5-minute replay window). The plugin also polls while the receipt page is open, so orders complete even if your host blocks incoming webhooks.
* Safety checks: an order is only completed when the paid amount and currency match the order total, and a test-mode payment never completes an order on a live store.
* Test mode with `sk_test_` keys: simulate a payment from the NakoPay checkout, nothing moves on-chain.
* WooCommerce Subscriptions: NakoPay subscription events update the matching subscription.

Pricing: 1% + $0.05 per payment, and your first payments are free. There is no monthly fee. See [nakopay.com/pricing](https://nakopay.com/pricing).

If you only need pay buttons or donation forms on a WordPress site without WooCommerce, install "NakoPay Crypto Payment Buttons" instead.

== External services ==

This plugin connects to the NakoPay API to create and check crypto payments. A NakoPay account is required.

* **What is sent and when:** when a customer chooses NakoPay at checkout, the plugin sends the order total, currency, order number, the customer's billing email and the store's return URL to `https://api.nakopay.com/v1/invoices-create`. While the receipt page is open, it asks `https://api.nakopay.com/v1/invoices-get` for the payment status every few seconds. "Test connection" in the settings calls `https://api.nakopay.com/v1/keys-list` with your API key.
* **What is received:** NakoPay sends signed webhook events (payment received, expired, subscription changes) to your store's webhook URL shown in the settings.
* **Links on the receipt page:** "Pay with another coin or network" opens the NakoPay hosted checkout at `https://nakopay.com/pay/...`.

NakoPay [Terms of Service](https://nakopay.com/terms) and [Privacy Policy](https://nakopay.com/privacy).

== Installation ==

1. Install from Plugins, Add New (search "NakoPay"), or upload the zip in Plugins, Add New, Upload Plugin. Activate it.
2. Sign up at [nakopay.com](https://nakopay.com/signup), connect your wallet, and create an API key in Dashboard, API keys.
3. In WooCommerce, Settings, Payments, open NakoPay and paste the API key.
4. Copy the Webhook URL shown there into your NakoPay dashboard (Settings, Webhooks, Add endpoint), then paste the signing secret back into the plugin settings. Save.
5. Click "Test connection", then place a test order with a `sk_test_` key.

== Frequently Asked Questions ==

= Does NakoPay hold my money? =

No. Payments go straight to the wallet you connected in NakoPay. NakoPay's fee is charged to a prepaid credit balance in your NakoPay account, never taken from the payment.

= Which coins can customers use? =

The coins you switch on in your NakoPay dashboard. Bitcoin (on-chain and Lightning), Litecoin, Dogecoin and USDT are typical. The current list is at [nakopay.com](https://nakopay.com).

= Does it work with the block checkout? =

Yes. NakoPay appears in both the classic checkout and the Cart and Checkout blocks.

= How do I test without real money? =

Use a `sk_test_` API key. Place an order, open the NakoPay checkout from the receipt page and press "Simulate payment". The order completes within a few seconds.

= Can I refund from WooCommerce? =

Refund crypto payments from your NakoPay dashboard, then mark the WooCommerce order refunded. The plugin has no refund button.

= What happens if my host blocks webhooks? =

The receipt page also checks the payment status every few seconds, so the order still completes while the customer keeps the page open. Webhooks remain the reliable path.

== Screenshots ==

1. The NakoPay payment method at checkout.
2. The receipt page with amount, address and QR code.
3. The gateway settings in WooCommerce.

== Changelog ==

= 1.2.0 =
* Compatibility: WordPress 6.0 to 7.1, WooCommerce 7.0 to 11.2, PHP 7.4 to 8.4.
* Text domain is now nakopay-for-woocommerce.
* Block checkout: the payment method label and description render correctly and load after WooCommerce settings.
* Orders table is checked on admin pages, so updates by zip upload add new columns.
* Receipt page wording updated; wallet links accept each coin's own URI scheme.
* The plugin can run beside "NakoPay Crypto Payment Buttons" (no shared class names).

= 1.1.2 =
* Release packaging.

= 1.1.1 =
* Order notes say how an invoice was paid. A payment made in test mode never completes an order on a live store. The paid amount and currency are checked against the order total.

= 0.2.0 =
* Default API base URL is https://api.nakopay.com/v1/.

= 0.1.0 =
* Initial release.

== Upgrade Notice ==

= 1.2.0 =
Adds WooCommerce 11 and PHP 7.4 support and fixes a conflict when both NakoPay plugins are active.

== Third-party code ==

The receipt page bundles QRious 4.0.2 by Alasdair Mercer (GPL-3.0) to draw the QR code. Source: https://github.com/neocotic/qrious
