=== FlatCryptoPay for WooCommerce ===
Contributors: flatcryptopay
Tags: crypto, usdt, bitcoin, woocommerce, payment gateway
Requires at least: 6.0
Tested up to: 6.7
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 USDT, USDC, Bitcoin, Litecoin and card payments in WooCommerce. Non-custodial, flat monthly price, no percentage platform fee.

== Description ==

FlatCryptoPay is a non-custodial crypto payment gateway. Crypto payments go straight from your customer to your own wallet: FlatCryptoPay never holds your funds or your private keys. You pay a flat monthly price (including a free Starter plan) and there is no percentage platform fee on any plan.

At checkout, customers are redirected to a secure hosted payment page where they can:

* **Pay with crypto** - USDT on TRON (TRC-20), Ethereum (ERC-20), Polygon, BNB Smart Chain (BEP-20) and Solana; USDC on Ethereum, Base, Polygon, BNB Smart Chain and Solana; Bitcoin (on-chain); Litecoin.
* **Pay with card, Apple Pay or Google Pay** - processed by independent licensed card processors, with the proceeds settled as USDC to your own EVM address. Card processing fees are set by the card processor, and customers may be asked for a quick ID check under the processor's rules.

Features:

* Works with the classic checkout and the Cart and Checkout blocks.
* Compatible with WooCommerce High-Performance Order Storage (HPOS).
* Signed webhooks (HMAC-SHA256) with timestamp checks and duplicate protection.
* Every status update is re-checked against the FlatCryptoPay API before the order changes.
* Orders also update when the customer returns to your store, so payments are recorded even before the webhook is configured.
* Test mode with fcp_test_ keys.
* Invoice currencies: USD, EUR, GBP, CAD, AUD.

Network (blockchain) fees are paid by the customer when sending. Crypto payments are push-only, so refunds are sent from your own wallet.

== External services ==

This plugin connects to the FlatCryptoPay API (https://flatcryptopay.com/api/v1) to create payment invoices and to check their status. It is required for the payment method to work.

* When a customer places an order with this payment method, the plugin sends: the order amount, order currency, order number and order id, the store name (in the invoice description), the customer's billing email address, the order key, your site URL, and the return and cancel URLs of your store. The customer is then redirected to the FlatCryptoPay hosted payment page.
* When a webhook arrives, or when the customer returns to your store, the plugin requests the invoice status from the API using your API key.
* FlatCryptoPay sends signed webhook notifications to your site's REST endpoint (/wp-json/flatcryptopay/v1/webhook) when an invoice changes status.

The service is provided by FlatCryptoPay: [Terms of Service](https://flatcryptopay.com/terms/), [Privacy Policy](https://flatcryptopay.com/privacy/).

== Installation ==

1. Upload the plugin through Plugins > Add New > Upload Plugin, or extract it into /wp-content/plugins/, and activate it. WooCommerce must be active.
2. Create a free account at https://flatcryptopay.com and add your payout addresses (an EVM address is required for card payments).
3. In the FlatCryptoPay dashboard, create an API key (fcp_live_... or fcp_test_...).
4. In WooCommerce > Settings > Payments > FlatCryptoPay, enable the method and paste the API key.
5. Copy the Webhook URL shown on the settings page, add it as a webhook endpoint in the FlatCryptoPay dashboard, and paste the signing secret (whsec_...) into the "Webhook signing secret" field.
6. Place a test order with a fcp_test_ key and use "Simulate payment" on the payment page.

== Frequently Asked Questions ==

= Does FlatCryptoPay hold my money? =

No. Crypto payments go directly to your own wallet addresses. Card payments settle as USDC directly to your EVM address. FlatCryptoPay never holds funds or private keys.

= Are there per-transaction fees? =

FlatCryptoPay charges no percentage platform fee on any plan; you pay a flat monthly price. Customers pay blockchain network fees when sending crypto, and card payments carry a card-processing fee set by the card processor.

= Which store currencies are supported? =

USD, EUR, GBP, CAD and AUD. If your store uses another currency, the payment method is hidden at checkout.

= Do I need to set up the webhook? =

It is strongly recommended. Without it, orders are updated when the customer returns to your store after paying, but a customer who closes the payment page early would only be recorded once the webhook is configured.

= What happens when an invoice expires? =

If the order is still pending payment, it is cancelled with an order note. You can set the invoice expiry (15 minutes to 7 days) in the settings.

= Does it work with the block-based checkout? =

Yes. The plugin supports both the classic checkout shortcode and the Cart and Checkout blocks.

= Where can I see logs? =

Enable "Debug log" in the settings, then open WooCommerce > Status > Logs and choose the "flatcryptopay" source. API keys and secrets are never logged.

== Changelog ==

= 1.0.0 =
* Initial release: hosted invoice checkout, signed webhooks, return-page status check, Cart and Checkout blocks support, HPOS compatibility.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
