=== SnapEX Pay for WooCommerce ===
Contributors: snapexpay
Tags: crypto, usdt, payment gateway, woocommerce, tron
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
WC requires at least: 8.2
WC tested up to: 11.2
Stable tag: 1.2.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept crypto in WooCommerce: USDT on TRON, Ethereum, BSC and other networks, or other coins converted to USDT.

== Description ==

The customer picks SnapEX Pay — crypto at checkout, pays on the SnapEX Pay page and the order is marked paid automatically.

* No wallets or nodes to run; funds arrive in your SnapEX Pay merchant balance.
* Checkout block and classic checkout, "Pay for order" links, HPOS compatible.
* Three independent ways an order gets marked paid: the signed webhook, the customer returning from the payment page and a check every 5 minutes. A lost webhook never leaves a paid order unpaid, and an order is never completed twice.
* Partial payments and payments arriving after an order was cancelled put the order On hold for review.
* Test mode with test invoices that confirm without real money, visible only to shop managers.
* Stores in EUR, GBP and other currencies: SnapEX Pay converts each order to USD at the current rate, nothing to update by hand.

== External services ==

This plugin connects to the SnapEX Pay merchant API (https://snapex.pro/api/v1/merchant), run by SnapEX, to take crypto payments. It is required for the payment method to work.

* When a customer places an order with this payment method, the plugin creates a SnapEX Pay invoice. It sends the order amount (in USD, or in the store currency for SnapEX Pay to convert), the order ID, the shop name and order number as the invoice description, the return and cancel URLs of your shop, the payment window and the fee and test-mode settings, authenticated with your API key. No customer name, e-mail, address or IP address is sent. The customer is then redirected to the SnapEX Pay payment page.
* For stores not in USD with the automatic exchange rate, the plugin asks SnapEX Pay for the rate of the store currency (at most once an hour) to check the currency is covered and to show the rate in the settings.
* To settle orders, the plugin requests the status of those invoices: when the customer returns, when SnapEX Pay sends a webhook, and every 5 minutes for recent unpaid orders.
* SnapEX Pay sends signed webhooks to your shop (/wc-api/snapexpay_webhook/) if you configure the webhook in the SnapEX Pay merchant cabinet.

Terms of use: https://snapex.pro/p/soglashenie
Privacy policy: https://snapex.pro/p/privacy

== Installation ==

1. Upload and activate the plugin.
2. WooCommerce → Settings → Payments → SnapEX Pay (crypto).
3. Paste the merchant API key (starts with smk_) from the SnapEX Pay cabinet → Merchant → Developers (scopes invoices.read and invoices.write). The exchange Partner API key (spx_) does not work here; the settings page says so if one is pasted.
4. Recommended: set the webhook URL shown under "Webhook secret" in the cabinet and paste the whsec_… secret.
5. If the store currency is not USD, nothing else is needed: the Exchange rate setting is Auto by default. Choose Manual to use a fixed rate of your own.

== Frequently Asked Questions ==

= Which currencies can the store use? =

SnapEX Pay invoices are in USD. USD stores work as is. For other currencies the Exchange rate setting is Auto by default: SnapEX Pay converts each order at its current rate (ECB rates, refreshed hourly) when the payment page opens, and the order note shows the rate used. You can switch to Manual and enter a fixed rate, or convert with the snapexpay_wc_amount_usd filter. With Auto, a rate typed into USD for 1 … is used as a fallback while SnapEX Pay has no rate for the currency. The settings page shows the current rate, or says if SnapEX Pay has none for your currency.

= Can I refund from WooCommerce? =

No. Refunds are made from the SnapEX Pay cabinet.

== Changelog ==

= 1.2.2 =
* Checkout title now includes the SnapEX Pay brand by default: "SnapEX Pay — crypto (USDT and other coins)".
* Existing stores: a title left at the old default "Crypto (USDT and other coins)" is updated once on upgrade. A title you changed yourself is kept as it is; edit it in WooCommerce → Settings → Payments → SnapEX Pay if you want the brand shown.

= 1.2.1 =
* The settings page says when the API key is the exchange Partner API key (spx_…) or a cut/masked key, and where to get the merchant key (smk_…). Such a key hides the method at checkout instead of failing on payment.
* An enabled method hidden at checkout (no key, wrong key, no exchange rate) is now explained in a notice on every admin page, not only in its settings.
* Auto exchange rate: a rate typed into USD for 1 … is used as a fallback while SnapEX Pay has no rate for the store currency.

= 1.2.0 =
* New: automatic exchange rate for stores not in USD (EUR, GBP and others). SnapEX Pay converts each order at its current rate; no daily rate updates by hand. The settings page shows the rate in use.
* Stores that already had a fixed rate keep it (Exchange rate: Manual) until you switch to Auto.
* The settings page now says why the method is hidden at checkout when no rate is available.

= 1.1.0 =
* New: optional Partner ID setting for the SnapEX Pay referral program (the integrator who set up the plugin).

= 1.0.1 =
* Fix: a customer can get a new payment page after the previous one expired or the order total changed. Each SnapEX Pay invoice now gets its own external ID; invoices created by 1.0.0 are still settled.

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.2.2 =
The checkout title now shows the SnapEX Pay brand. A title left at the old default is updated; a custom title is kept.
