=== Cryptain for WooCommerce ===
Contributors: cryptain
Tags: crypto, bitcoin, usdt, payment gateway, woocommerce
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept Bitcoin, USDT, USDC, Ethereum and other cryptocurrencies in your WooCommerce store with the Cryptain payment gateway.

== Description ==

Cryptain for WooCommerce adds a "Pay with crypto" payment method to your store. At checkout your customer is sent to a secure Cryptain payment page, chooses a coin, scans the QR code and pays from any wallet or exchange. When the payment is confirmed on the blockchain, the order is marked as paid automatically.

= Features =

* Accept Bitcoin, Ethereum, USDT, USDC, BNB, Litecoin, Dogecoin, Solana, TON, XRP and more (the coins you enable in your Cryptain store)
* Works with the classic checkout and the block-based Cart and Checkout
* Compatible with High-Performance Order Storage (HPOS)
* Prices stay in your store currency; the customer sees the crypto amount at the live exchange rate
* Orders update automatically: paid, partially paid (order on hold), expired (unpaid order cancelled) or refunded
* Secure: webhooks are signed with HMAC-SHA256 and a timestamp, and the plugin re-checks every invoice with the Cryptain API before it changes an order
* Optional debug log in WooCommerce → Status → Logs

= Requirements =

* A Cryptain account (free to create at [cryptain.net](https://cryptain.net/register)) with a store and an API key
* WooCommerce 7.0 or newer

== External services ==

This plugin connects your store to the Cryptain payment service (https://cryptain.net), which creates the crypto invoices and confirms the payments on the blockchain. The plugin cannot take crypto payments without it.

What is sent and when:

* **When a customer places an order with this payment method**, the plugin sends the order total and currency, the order number, the customer's billing email address, the store's return and cancel links, the webhook address of your store and the WooCommerce order ID to the Cryptain API (by default `https://cryptain.net/api/v1/invoices`, or the Cryptain address you set in the settings) to create an invoice. The customer is then redirected to the Cryptain payment page.
* **When Cryptain sends a payment notification (webhook)** to your store, the plugin asks the Cryptain API for the invoice's current status (the invoice ID is sent) before it changes the order.

Requests are authenticated with your Cryptain API keys. No data is sent until you enter your keys and enable the payment method, and nothing is sent for orders paid with other payment methods.

* Cryptain Terms of Service: https://cryptain.net/legal/terms
* Cryptain Privacy Policy: https://cryptain.net/legal/privacy

== Installation ==

1. Install the plugin from Plugins → Add New (search for "Cryptain"), or upload the zip in Plugins → Add New → Upload Plugin, and activate it.
2. In your Cryptain dashboard, create a store and an API key.
3. In WooCommerce → Settings → Payments → Cryptain, enter your public key, secret key and webhook secret (the Cryptain URL is https://cryptain.net unless you use your own Cryptain installation).
4. Copy the Webhook URL shown in the plugin settings (it ends in /wp-json/cryptain/v1/webhook) into your Cryptain store's Webhook URL.
5. Click "Send test webhook" in the Cryptain dashboard to check the connection, then enable the payment method.

== Frequently Asked Questions ==

= Do I need a Cryptain account? =

Yes. Cryptain creates the invoices, watches the blockchain and confirms the payments. Creating an account is free; see https://cryptain.net/pricing for fees.

= Which cryptocurrencies can my customers use? =

Every coin you enable in your Cryptain store, for example BTC, ETH, USDT and USDC on several networks, BNB, LTC, DOGE, SOL, TON and XRP. The current list is at https://cryptain.net/currencies.

= Do my customers need a Cryptain account? =

No. They pay from any wallet or exchange by scanning a QR code or copying the address.

= What happens if a customer pays too little or too late? =

A partial payment puts the order on hold with a note, and the customer can send the rest. Payments that arrive after the invoice expired are still matched to the order, and it is marked as paid.

= Does it work with the new block checkout? =

Yes. It supports both the classic checkout and the WooCommerce Cart and Checkout blocks.

= Where do I get help? =

Contact Cryptain support at https://cryptain.net/contact, or use the chat on cryptain.net.

== Screenshots ==

1. The customer chooses a coin on the secure Cryptain payment page.
2. The customer scans the QR code or copies the address and amount; the page updates when the payment arrives.

== Changelog ==

= 1.0.0 =
* First release: hosted crypto checkout, classic and block checkout support, HPOS compatibility, signed webhooks with API re-check, refunds and partial payments reflected on orders.
