=== CrptoX for WooCommerce ===
Contributors: crptox
Tags: woocommerce, cryptocurrency, usdt, usdc, payments
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept USDT and USDC using CrptoX hosted checkout.

== Description ==

* Classic and block checkout; legacy order storage and HPOS.
* Separate Test and Live API keys and webhook signing secrets.
* Store currency conversion using a merchant-entered rate, frozen for each order.
* USD, EUR, IRR, IRT (Iranian toman), and other WooCommerce currencies.
* Exact decimal arithmetic; the token quote rounds upward to six decimals.
* Idempotent invoice creation and authenticated server-to-server payment verification.
* Signed webhooks, background reconciliation and an order-admin refresh action.
* English, Persian, French, Arabic, German, Spanish, Portuguese, Japanese, Korean and Chinese.

Payment processing uses the external CrptoX service at the HTTPS address configured by the merchant (default https://crptox.com). Creating an invoice sends its token amount, selected network/token, order number, expiry, checkout language and the store return URL. The return URL contains the WooCommerce order key. Billing names, email addresses, card details and wallet private keys are not sent by this plugin. The merchant API key authenticates requests; webhook secrets verify inbound notifications. API calls occur during checkout, reconciliation and the administrator's connection test.

== Installation ==

1. Upload the ZIP through WordPress > Plugins > Add New > Upload Plugin.
2. Activate WooCommerce and CrptoX for WooCommerce.
3. Open WooCommerce > Settings > Payments > CrptoX.
4. Start in Test mode. Set the CrptoX HTTPS address and Test API key.
5. Select a network and token enabled in your CrptoX merchant account with an active wallet.
6. Choose the exchange-rate currency matching the WooCommerce store currency. Enter how many store currency units equal ONE selected token.
7. Save, then use Test connection.
8. Register the displayed TEST/LIVE webhook addresses in the CrptoX merchant panel. Subscribe to the payment events listed in settings. Copy each signing secret into the corresponding plugin field.
9. Place a test order and verify the signed callback updates the order. Switch to Live only with matching Live credentials.

== Currency conversion ==

The store currency remains controlled by WooCommerce. The plugin adds IRT if not already present. Rates are merchant-controlled, not live market quotes. Illustrative example only: a rate of 100000 IRT per token converts an order of 200000 IRT into 2 USDT. IRR and IRT are distinct currencies and must not be confused. USD is not automatically priced at a market rate; its initial example rate is 1 and must be reviewed by the merchant. Quotes and order totals cannot change after invoice creation. An expired invoice is not silently replaced; create a new order or review it with the customer.

== Operations ==

WordPress Action Scheduler/WP-Cron must run for background reconciliation. Webhooks are recommended. No successful return URL or unconfirmed webhook payload can mark an order paid. The plugin reads the authenticated CrptoX invoice and matches its UUID, amount, network and asset. Only invoice status paid completes payment. Underpaid, overpaid and confirming remain on hold. Payments reported for cancelled/refunded orders require manual review. Automatic blockchain refunds and subscriptions are not supported.

The CrptoX backend must include the optional return_url and checkout_locale API fields from the corresponding integration release for automatic return and hosted-checkout language. Existing clients without those fields continue to work.

== Changelog ==

= 0.1.0 =
Initial integration.
