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

Take crypto payments on payment.zx's hosted payment page. Orders are marked paid when payment.zx confirms the payment.

== Description ==

payment.zx is a crypto payment gateway. With this plugin, customers choose Crypto at checkout and pay on payment.zx's payment page, in the coin and network they pick from the ones your payment.zx account accepts. payment.zx tells your shop when the payment is confirmed, and the order moves to Processing (or Completed for virtual and downloadable orders).

* Works with the block checkout and the classic checkout.
* Works with WooCommerce's order tables (HPOS).
* Signed webhooks, checked in constant time. The plugin then reads the invoice back from payment.zx before it changes an order, so a replayed or forged webhook can't mark an order paid.
* Each payment is applied to its order once, even when payment.zx sends an event more than once.
* If your shop can't receive webhooks, the order is still updated when the customer comes back to the order-received page.
* Clear messages for customers, and notes on each order for you.

Your store currency must be US dollars: payment.zx invoices are priced in USD.

= What happens to an order =

* **Paid** (or overpaid): Processing, with payment.zx's invoice code as the transaction ID. Overpaid crypto stays in your payment.zx balance.
* **Payment seen, confirming**: Pending payment, with a note, until it confirms. WooCommerce won't cancel the order meanwhile.
* **Part paid**: Pending payment, with a note. The customer can send the rest until the payment page expires. If they don't, payment.zx credits what arrived and the order goes On hold with a note, so you can ask for the rest or refund.
* **Expired unpaid**: Failed. The customer can pay again from their account, and gets a new payment page.

Refunds aren't made through the plugin. Send a refund as a payout from your payment.zx dashboard, then record it in WooCommerce as a manual refund.

== External services ==

This plugin connects to the payment.zx API (https://payment.zx.xyz, or the address set in the plugin's settings) to take payments.

* When a customer places an order with payment.zx, the plugin sends the order total in US dollars, a reference such as "WC-1042-1", the text "Order #1042", the order-received page address and the shop's webhook address. It sends no customer names, emails or addresses.
* When payment.zx calls the shop's webhook, and when a customer opens the order-received page, the plugin asks the API for that invoice's status.
* To know the smallest and largest amount payment.zx takes, the plugin asks the API at most once every ten minutes, when the checkout lists payment methods. It sends nothing about the shop's orders or customers.
* The customer's browser is sent to payment.zx's payment page to pay.

payment.zx is run by ZX: [terms of service](https://zx.xyz/terms), [privacy policy](https://zx.xyz/privacy).

== Installation ==

1. In WordPress, go to Plugins > Add New > Upload Plugin, upload the zip and activate it. WooCommerce must be active.
2. In your payment.zx dashboard, open API and webhooks:
   * Create an API key for Payments.
   * Set the webhook endpoint URL to the address shown in the plugin's settings (it ends in `?wc-api=zxpay` or `/wc-api/zxpay/`) and save. Copy the signing secret it shows.
3. In WooCommerce > Settings > Payments > payment.zx, tick Enable, paste the API key and the signing secret, and save. The plugin checks the key with payment.zx when you save.
4. Place a test order.

== Frequently Asked Questions ==

= Which coins can customers pay with? =

The ones your payment.zx account accepts. Customers pick the coin and network on the payment page.

= My store isn't in US dollars. =

payment.zx invoices are in USD, so the payment method is hidden at checkout until the store currency is USD.

= Where are the logs? =

WooCommerce > Status > Logs, source payment-zx. Errors are always logged; turn on Debug log to see every event. API keys and secrets are never logged.

= Can I connect two shops to one payment.zx account? =

Yes. Give each shop its own Order ID prefix. Each invoice tells payment.zx which shop to notify.

== Changelog ==

= 1.1.0 =
* payment.zx isn't offered at checkout for totals payment.zx doesn't take (below its minimum, say). The plugin asks payment.zx for its limits and keeps them for ten minutes.
* The note for a payment that's being confirmed no longer shows a received amount of 0.

= 1.0.0 =
* First release.
