=== mistKET for WooCommerce ===
Contributors: mistket
Tags: crypto, usdt, bitcoin, payment gateway, woocommerce
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
WC requires at least: 7.0
WC tested up to: 9.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept USDT, BTC, ETH, TRX and other crypto payments in WooCommerce through the mistKET hosted payment page.

== Description ==

mistKET for WooCommerce adds a "Pay with crypto" payment method. At checkout the plugin creates a mistKET invoice
for the order and redirects the customer to the secure mistKET payment page (`/pay/{invoice}`). The customer picks a
coin and network there and pays. mistKET then notifies your shop with a signed webhook and the order is updated
automatically.

* Works with the classic checkout and the Cart/Checkout blocks.
* Compatible with High-Performance Order Storage (HPOS).
* Every webhook is verified with your signing secret (HMAC-SHA256); unsigned or stale requests are rejected.
* The plugin re-reads the invoice from the mistKET API before changing an order, compares the amount and currency
  with the order and processes each status only once.
* English and Turkish included.

Order status mapping:

* `confirmed`: order is marked paid (Processing / Completed).
* `overpaid`: order is marked paid and a note about the overpayment is added.
* `paid` (transaction seen, waiting for confirmations): order is put On hold with a note. It is not marked paid yet.
* `underpaid`: order is put On hold with the received and remaining amount. The customer can send the rest to the
  same address while the invoice is open; after expiry you can accept the received amount in the mistKET dashboard,
  which then sends `confirmed`.
* `expired`: order becomes Failed (the customer can pay again; a new invoice is created).
* `cancelled`: order becomes Cancelled.
* If an expired/cancelled invoice had a partial payment, the order is put On hold for review instead.

Supported shop currencies: USD, EUR, TRY, RUB, GBP, AED. The payment method is hidden for other currencies.

== Installation ==

1. In WordPress go to Plugins > Add New > Upload Plugin, choose `mistket-woocommerce.zip` and activate it.
2. In the mistKET merchant dashboard open "API & webhook":
   * "API keys" > "New key": copy the API Key and API Secret (the secret is shown only once).
   * "Webhook" > "Signing secret": copy the signing secret (starts with `whsec_`).
3. In WooCommerce > Settings > Payments > mistKET (crypto) paste the API Key, API Secret and Webhook signing secret,
   enable the method and save.
4. The webhook URL (`https://your-shop/?wc-api=mistket`, shown on the settings page) is sent with every invoice
   automatically. Optionally enter it as the project webhook URL in the dashboard and use "Send test notification".

Your mistKET project must be approved before invoices can be created. If you use an IP allowlist for the API, add
your shop server's IP address.

== Frequently Asked Questions ==

= The order stays "On hold" =

The payment was seen but is waiting for blockchain confirmations, or the customer underpaid. The order is updated
automatically when the invoice is confirmed. The order notes show the details.

= Webhooks are rejected with 401 =

Check the Webhook signing secret and that your server clock is correct. If you rotated the secret in the dashboard,
paste the new one.

= Can I use the same mistKET project for several shops? =

Yes. Give every shop a different "Order reference prefix" so order references do not collide.

== Changelog ==

= 1.0.0 =
* First release.
