=== Crypto Checkout ===
Contributors: paygatenow
Tags: crypto, bitcoin, woocommerce, payment gateway, usdt
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.1
Requires Plugins: woocommerce
Stable tag: 0.4.24
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept Bitcoin, Ethereum, USDT, USDC, Solana and Litecoin in WooCommerce. QR checkout, paid out automatically to your own wallet.

== Description ==

**Crypto Checkout** is a WooCommerce cryptocurrency payment gateway by [PayGate Now](https://paygatenow.io/). Your customers pay by scanning a QR code at checkout, the payment is confirmed on-chain, and the full order total is forwarded automatically to the wallet you choose. The WooCommerce order updates itself.

= Why stores use Crypto Checkout =

* **100% of the order total to you.** A 1.5% processing fee and the blockchain network fee are shown to the customer and paid by them on the payment page. Your WooCommerce cart total is never marked up.
* **Paid to your own wallet.** Paste a receive address for each coin — an exchange deposit address, a hardware wallet or your treasury. Your store never holds private keys.
* **A unique deposit address per order.** Payments are matched to orders exactly, with no shared addresses.
* **Fair amount handling.** Overpayments go to the merchant. Small shortfalls such as exchange rounding are absorbed so the order is still paid in full. Larger underpayments are forwarded and the order is put On hold with a clear note.
* **No chargebacks.** Confirmed crypto payments are final.
* **Native WooCommerce orders.** Orders move to Processing on their own, with the deposit address, amounts and transaction IDs recorded in order notes. Works with the classic checkout and the Cart & Checkout blocks, and supports HPOS.
* **Demo Mode.** Run the full checkout and payment page without sending any crypto.

= Supported cryptocurrencies =

* Bitcoin (BTC)
* Ethereum (ETH)
* Tether (USDT) on Ethereum (ERC-20)
* USD Coin (USDC) on Ethereum (ERC-20)
* Solana (SOL)
* Litecoin (LTC)

Each coin has a minimum order amount so network fees stay reasonable; checkout shows it before the order is placed.

= How it works =

1. Create a free account at [paygatenow.io](https://paygatenow.io/signup/) and generate your API key.
2. Install the plugin, paste the API key under WooCommerce → Settings → Payments → Crypto Checkout and click **Test connection**.
3. Enable the coins you want and paste a payout address for each one.
4. Customers choose a coin at checkout and pay the exact amount shown with the QR code. When the payment is confirmed, the order total is sent to your wallet and the order is marked paid.

== External services ==

This plugin relies on the **PayGate Now payment processor** (`https://api.paygatenow.io`) to price, create and confirm crypto payments. It cannot take payments without it.

What is sent and when:

* **When you click Test connection or open the settings screen:** your API key, to check that it is valid, and a request for the list of supported coins and their minimums.
* **At checkout:** the cart total and store currency, to quote the amount in the selected coin.
* **When a customer places an order with Crypto Checkout:** the order ID, the order amount in the selected coin, the coin, your payout address for that coin, a random order token and your store's callback URL. No customer name, email, address or IP address is sent.
* **While the payment page is open:** the store asks the processor for the payment status of that order.
* **After payment:** the processor calls your store's callback URL (`/wp-json/crypto-checkout/v1/...`) with the payment status, signed with a secret derived from your API key.

The service is provided by PayGate Now. [Terms of Service](https://paygatenow.io/terms/) · [Privacy Policy](https://paygatenow.io/privacy-policy/)

The payment page links each transaction ID to a public block explorer (mempool.space, litecoinspace.org, etherscan.io, solscan.io) so you and your customer can verify it. These links are opened only when clicked.

== Installation ==

**Requirements:** WordPress 6.4+, WooCommerce 8.0+, PHP 8.1+ with the **bcmath** extension (exact payment amounts; the plugin deactivates itself with a notice if bcmath is missing) and the **sodium** extension (verifies signed plugin updates; standard in PHP 8).

1. In WordPress go to **Plugins → Add New**, search for **Crypto Checkout** and click **Install Now**, then **Activate**. (Or upload the zip under Plugins → Add New → Upload Plugin.)
2. Create a free account at [paygatenow.io/signup](https://paygatenow.io/signup/) and click **Generate API key**.
3. Go to **WooCommerce → Settings → Payments → Crypto Checkout**, paste the API key and save. Click **Test connection**.
4. Enable the coins you want to accept and paste a receive address for each one. USDT and USDC on Ethereum can use the same 0x address as ETH.
5. Optional: tick **Demo Mode** and place a test order. Turn Demo Mode off before taking real payments.
6. Tick **Enable Crypto Checkout** and save.

== Frequently Asked Questions ==

= Do I need an account? =

Yes. The processor needs to know which store a payment belongs to. Creating an account at paygatenow.io is free and gives you an API key for your store. You can regenerate the key at any time from your account page.

= How much does it cost? =

There is no setup fee. A 1.5% processing fee is added to the amount the customer pays, together with the blockchain network fee, and both are shown on the payment page before they pay. Your store receives the full order total.

= Where do the funds go? =

Each order gets its own deposit address. Once the payment is confirmed, the order total is forwarded automatically to the payout address you saved for that coin.

= What if a customer pays too much or too little? =

Overpayments go to the merchant. Small shortfalls are absorbed so the order is still paid in full. If the customer underpays by a larger amount, the amount received is forwarded, the order is set On hold and a note explains what happened.

= What happens if the customer does not pay in time? =

The payment window ends, the order is cancelled and the customer is returned to checkout with their cart restored.

= How do refunds work? =

Crypto payments cannot be reversed by the customer. To refund, send the refund from your own wallet and record it in WooCommerce as usual.

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

Yes. Crypto Checkout supports the classic checkout, the Cart & Checkout blocks and High-Performance Order Storage (HPOS).

= Can I test without sending crypto? =

Yes. Turn on Demo Mode in the settings. A shop manager can complete a demo payment from the order screen. Turn Demo Mode off before real payments.

== Changelog ==

= 0.4.24 =
* Bank transfer and card orders show the normal thank-you line again.

= 0.4.23 =
* Faster checkout page: the pay card scripts load only on the pay page.
* Lighter background checks and unused code removed.

= 0.4.22 =
* A detected (On hold) order is completed by the 5-minute check once the processor has settled it, even if the customer closed the pay page.
* The payment received message says larger payments can take up to 30 minutes to confirm.

= 0.4.21 =
* The expiry check pauses until its next run when the processor is down.

= 0.4.20 =
* A double order submit reuses the first payment address.
* Repeated "not enough sent" notices no longer add the same note again.
* Overpayment note also when the pay page completes the order.
* Refused payment notices are logged.
* One failing order no longer stops the expiry check.
* Below-minimum message shows the real minimum.
* Payment page disclosure shows the full breakdown or the total only.
* The pay page checks less often after 10 minutes and stops 2 hours after expiry.
* Unused code removed; release zips carry no hidden files.

= 0.4.19 =
* Changelog cleanup only. No code change.

= 0.4.18 =
* Crypto orders hold their stock for the whole payment window (105 minutes).
* Unpaid crypto orders are cancelled within 5 minutes of the window ending.
* Pay pages pause processor lookups for 30 seconds after a failure.
* Only the PayGate Now API is accepted as the processor address.
* Warning when an old wp-config key overrides the saved key.

= 0.4.17 =
* A settled payment notice for an unpaid order is always acted on, even if an earlier notice arrived with a newer timestamp.
* The pay-page status check only trusts an answer that names the order's own invoice.

= 0.4.15 =
* The API key saved in the settings now takes priority over an old shared key in wp-config.php, so a store can switch to its own PayGate Now key from the settings page.

= 0.4.14 =
* PayGate Now now records each order's cart total and currency with the payment, for the PayGate Now dashboard. Prices and payouts are unchanged.

= 0.4.13 =
* Removed the "Customer pays blockchain fees" setting, which had no effect. A disabled USDC coin no longer switches itself back on. Internal clean-up of unused code.

= 0.4.12 =
* Plugin updates no longer fail with a false signature error when a new release comes out shortly after the last one. Internal release checks now test the payment notification logic end to end.

= 0.4.11 =
* A crypto order that is still unpaid 24 hours after a payment was detected (or after an underpayment) is noted on the order and emailed to the shop admin once.

= 0.4.10 =
* A payment that arrives for an order already paid, refunded or trashed is noted on the order and emailed to the shop admin. Clear overpayments get an order note. A slow pay-page check no longer hides crypto checkout for other shoppers. Unused public quote endpoint removed.

= 0.4.9 =
* Release of the 0.4.8 changes below (0.4.8 itself was never published). Build self-checks fixed.

= 0.4.8 =
* Once a crypto payment is seen on the network, the order is placed On hold and the customer gets the normal order email; it moves to Processing automatically when the network confirms. The pay page shows "Payment received ... you can close this page" with the order number instead of a spinner. The on-hold email explains that the crypto payment was detected. French, German and Spanish translations added. A customer who pays less than the total is told exactly how much is missing and gets 30 minutes to top up (order note email included, order stays pending); after that the page points to WhatsApp or the contact page. An underpayment settled early by the processor keeps the 30 minute window open, and a top-up that completes the amount finishes the order automatically. New settings: Support WhatsApp number and Support page URL.

= 0.4.7 =
* Updates only install when the signed package is newer than the installed version (no rollback). A failed processor lookup never cancels an order. Quote rate limit uses the real connection address. Pay-page status check is faster and shared between visitors. Expired-looking pay pages confirm with the server before redirecting. Scientific-notation amounts, same-second callbacks and the processor URL check are fixed. New French, German and Spanish translations.

= 0.4.6 =
* Pay page: no "Pending payment" on success, held orders say "being checked, do not pay again", server-only expiry, Woo hold-stock cancel no longer beats the crypto window, status reply not cached.

= 0.4.5 =
* Pay page timer uses server time; a wrong customer clock no longer shows "Payment received" or hides the address. Honest wording when no payment has arrived yet.

= 0.4.4 =
* Security and payment-safety release: per-order lock and replay guard on payment notifications, order edits after invoicing put the order on hold, signed self-updates, local QR codes, processor-outage cache, quote rate limit, API key never shown in settings, bcmath required.

= 0.4.3 =
* Cleaner Transaction ID row with a compact Copy button on the thank-you page; Copy works in wallet in-app browsers.

= 0.4.1 =
* New: automatic updates from paygatenow.io. New versions appear under Plugins and Dashboard → Updates and can update automatically, replacing the plugin in place.

= 0.4.0 =
* New: per-store API keys. Create a free account at paygatenow.io, generate a key and paste it into the settings.
* New: the API key is the first setting, with links to get one, and Test connection now checks that the key is valid.
* New: payment callbacks are verified with a secret derived from your own API key, so no separate IPN secret is needed.
* New: setup reminder on the Plugins screen until an API key is saved. The payment method stays hidden at checkout until a key is set.
* Improved: the processor URL and legacy IPN secret fields are hidden unless they are already in use.
* Tested with WordPress 7.1.

= 0.3.55 =
* Underpaid orders are settled automatically and put On hold with a clear note.

= 0.3.54 =
* Small payment shortfalls are absorbed; the store owner is always paid in full.

= 0.3.53 =
* Exchange rounding from the network charge is accepted when confirming a payment.

= 0.3.50 – 0.3.52 =
* Simpler checkout: coin selection only, with the amount and QR code on the payment page and the fee breakdown in Payment details.
* Checkout shows a short note when the cart is below the selected coin's minimum.

= 0.3.0 – 0.3.49 =
* Beta releases: Instant Payout to the merchant wallet, per-order deposit addresses, Demo Mode, WooCommerce Blocks and HPOS support.

== Upgrade Notice ==

= 0.4.1 =
Adds automatic updates from paygatenow.io.

= 0.4.0 =
Crypto Checkout now uses a per-store API key. Create a free account at paygatenow.io, generate your key and paste it into the settings. Stores already set up with a key in wp-config.php keep working.
