=== CryptoPayIn for WooCommerce ===
Tags: crypto, bitcoin, usdt, cryptocurrency, payment gateway
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept Bitcoin, USDT, Ethereum, Monero, Solana and more in WooCommerce. No KYC, 1% flat fee, set up in two minutes.

== Description ==

**CryptoPayIn for WooCommerce** adds crypto payments to your store in about two minutes: paste one API key, and the plugin does the rest. It is free; [CryptoPayIn](https://cryptopayin.com) charges a flat 1% per payment received, nothing else.

= Set up in one step =

1. Create a free CryptoPayIn account (about 30 seconds: no email, no ID).
2. Create an API key in Developers.
3. Paste it in WooCommerce > Settings > Payments > CryptoPayIn.

The plugin checks the key, registers its webhook on CryptoPayIn by itself, sends a signed test event to prove the round trip, and turns crypto on at checkout. No URL to copy, no signing secret to paste.

= A payment page your customers understand =

Customers pay without leaving your store, inside your theme:

* every accepted coin with its approximate amount, in two columns, in one tap
* the exact amount locked, a QR code their wallet reads, copy buttons and an "Open in wallet app" button
* a countdown, a live "payment detected" screen with network confirmations and an estimate of the time left
* automatic redirect to the order confirmation once paid
* clear warnings when they matter: the right network for tokens, the exact amount when it identifies the payment
* "Pay with another coin" at any time until they pay, and a one-click new quote when the price lock ends
* partial payments handled: the page shows the remainder, a QR code for it, and the deadline
* works without JavaScript, on mobile, in light, dark or automatic mode, in your brand colour

Prefer CryptoPayIn's hosted checkout? Switch to it in one click.

= 13 coins, 30 currencies =

Bitcoin, Ethereum, Tether USDT (TRON and Ethereum), USD Coin, Dai, Monero, Litecoin, Solana, TRON, Dogecoin, Shiba Inu and Pepe. Prices stay in your store currency: USD, EUR, GBP, CAD, AUD, CHF, JPY and 23 more are converted at a live, independently verified rate. Coins whose minimum is above the order total are simply not offered.

= Orders that look after themselves =

* Paid orders move to Processing (or Completed, your choice) once the payment is confirmed on-chain.
* A partial payment puts the order on hold and emails the customer what is left to send; the order completes by itself when the rest arrives.
* An invoice nobody paid is closed a few hours after the time to pay (a payment sent a little late still completes the order until then); the order is then cancelled and its stock released. Money that arrives even later is credited to your CryptoPayIn balance and the order is put on hold with a note, so you decide what to do.
* Every step is written in the order notes, with the transaction and a link to the payment in your CryptoPayIn dashboard.
* Signed webhooks (HMAC-SHA256) update orders instantly. The plugin still re-reads each payment from the API before changing an order, so a forged, replayed or out-of-order event can never ship an order. A background check every five minutes covers stores whose webhooks cannot get through.

= Built for WooCommerce =

* Block-based Cart & Checkout and the classic shortcode checkout
* High-Performance Order Storage (HPOS)
* Coin picker at checkout, or on the payment page (default)
* Translated into French, German (informal and formal), Spanish, Italian, Brazilian Portuguese, Russian, Turkish, Simplified Chinese and Japanese; regional variants such as French (Canada), Spanish (Mexico) or Swiss German use the closest translation
* No external scripts, fonts or trackers; the QR code is drawn on your server

= Privacy =

The plugin only sends CryptoPayIn what a payment needs: the order total, its currency and the order number. The customer's email is not shared unless you turn that on. See "External services" below.

== Installation ==

1. In WordPress, go to Plugins > Add New, search for "CryptoPayIn" and install the plugin. Or upload the zip in Plugins > Add New > Upload Plugin.
2. Activate it. WooCommerce 8.2 or newer must be active.
3. Open WooCommerce > Settings > Payments > CryptoPayIn and follow the three steps on screen.

To keep the secret key out of the database, define it in wp-config.php instead:

`define( 'CRYPTOPAYIN_API_KEY', 'csk_live_...' );`

== Frequently Asked Questions ==

= Is the plugin free? =

Yes. There is no paid version and no feature behind a paywall. CryptoPayIn charges a flat 1% on each payment received; there is no monthly fee.

= Do I need to verify my identity? =

No. A CryptoPayIn account is created with one click and protected by a 16-digit account key. You can add two-factor authentication.

= Where does the money go? =

To your CryptoPayIn balance, in the coin the customer paid. Withdraw it to your own wallet from the dashboard whenever you want, or set up automatic withdrawals.

= What permissions does the API key need? =

"Payments: read" and "Payments: write". Nothing else: the plugin never needs to move funds, and it warns you if the key you paste can.

= What if a customer sends too little, too much, or too late? =

Too little: the order goes on hold and the customer is shown (and emailed) the remainder to send to the same address. Too much: the order is paid and the difference noted on the order. A little late: the address is still watched for a few hours after the time to pay, so the payment is detected and the order completed, even if the customer asked for a new price in the meantime. Much later: CryptoPayIn credits the money to your balance and the plugin puts the order on hold with a note, for you to fulfil or refund.

= How do refunds work? =

Blockchain payments cannot be reversed automatically. To refund, send a withdrawal from your CryptoPayIn balance to an address the customer gives you, then record the refund in WooCommerce.

= My site is on http or on localhost. Does it work? =

Yes. CryptoPayIn can only deliver webhooks to a public https address, so on such sites orders are updated by polling instead: while the customer is on the payment page, and every five minutes in the background.

= Does it work with the block checkout and HPOS? =

Yes, both are supported and declared compatible.

= Can I change the texts or the payment page? =

Every setting has a sensible default and can be changed in the settings. Developers can copy templates/cryptopayin/payment.php and summary.php to yourtheme/woocommerce/cryptopayin/ and use these hooks:

* `cryptopayin_payment_request` (filter): the body sent to POST /v1/payments
* `cryptopayin_payment_window_minutes` (filter): the price lock per coin
* `cryptopayin_order_ref` (filter): the reference shown in your dashboard
* `cryptopayin_payable_assets` (filter): the coins offered for an order
* `cryptopayin_payment_page_args` (filter): everything the payment page template receives
* `cryptopayin_payment_created`, `cryptopayin_payment_status_changed`, `cryptopayin_payment_completed`, `cryptopayin_webhook_received` (actions)

= Where are the logs? =

In WooCommerce > Status > Logs, source "cryptopayin". Errors are always logged; turn on "Debug log" in the settings for more. Secrets are never written to the logs. WooCommerce > Status also shows a CryptoPayIn section with the connection and webhook health.

== External services ==

This plugin connects to the CryptoPayIn API (https://cryptopayin.com/v1), operated by CryptoPayIn, to accept crypto payments. Without it, the plugin cannot work.

* When you connect the plugin and when you click "Test connection": the API key is checked (GET /v1/account) and the plugin registers, tests or removes its webhook endpoint (/v1/webhook_endpoints). This sends your store's webhook URL.
* At checkout and on the payment page: the list of available coins and currencies is read (GET /v1/assets, /v1/currencies).
* When a customer chooses a coin: a payment is created (POST /v1/payments) with the order total, its currency, the chosen coin, the order number and the order confirmation URL. The customer's email is sent only if you enable "Share the customer's email with CryptoPayIn".
* While the payment is open: its status is read (GET /v1/payments/{id}) and, when the customer switches coin or the order is cancelled, it is cancelled (POST /v1/payments/{id}/cancel).
* CryptoPayIn sends signed events about the payment to your store's webhook URL.
* If you choose the hosted payment page, the customer is sent to https://cryptopayin.com/i/{payment}.
* For updates of the copy downloaded from cryptopayin.com: when WordPress checks for updates (about twice a day), the plugin reads https://cryptopayin.com/downloads/cryptopayin-for-woocommerce.json, which sends no store or order data. When you update, WordPress downloads the new zip from the same folder.

The customer's browser never talks to CryptoPayIn directly unless the hosted payment page is used or the customer follows a link to it. Links to blockchain explorers (mempool.space, etherscan.io, tronscan.org, solscan.io, litecoinspace.org, blockchair.com, xmrchain.net) are shown so customers can look up their transaction; they are opened only if clicked.

CryptoPayIn terms of service: https://cryptopayin.com/terms
CryptoPayIn privacy policy: https://cryptopayin.com/privacy

== Screenshots ==

1. The payment page: exact amount, QR code, copy buttons and live countdown, inside your theme.
2. Every accepted coin with its approximate amount, one tap to choose.
3. Payment detected: network confirmations and the time left.
4. Partial payment: the remainder, its QR code and the deadline.
5. Settings: one key to paste, then a live health checklist.
6. The coin picker inside the block checkout.
7. The order screen: payment, transaction, confirmations and a link to the CryptoPayIn dashboard.

== Changelog ==

= 1.0.1 =
* Fix: on a store restored from a backup, a new order could get the number of a lost order and be matched with that order's payment. Each payment request now names the order itself, so a new order always gets its own payment.
* Expired payments: one clear explanation with an "Order the same items again" button, the same on the page left open and after a reload, and on stores without webhooks too. WooCommerce's generic "cannot be paid for" error no longer appears next to it, and an order that can still be paid (status Failed) no longer shows it.
* Large crypto amounts are grouped with a narrow space on stores that write prices with a decimal comma ("4 389 735 SHIB" instead of "4,389,735 SHIB"). The amount to send is spaced by the page's styles only: selecting it by hand copies the exact number, without the coin symbol.

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.0.1 =
Recommended: a store restored from a backup can no longer match a new order with the payment of a lost one.

= 1.0.0 =
First release.
