=== AulsPay for WooCommerce ===
Contributors: aulspay
Tags: crypto, payments, woocommerce, usdc, bitcoin
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept USDC, EURC, ETH, USDT, BTC, LTC, DOGE and SOL at your WooCommerce checkout through AulsPay.

== Description ==

Adds a "Pay with crypto" payment method. At checkout the plugin creates an AulsPay invoice for the order and sends the customer to the AulsPay payment page, where they choose the coin. AulsPay sends a signed webhook when the payment is seen, confirmed, underpaid or expired, and the plugin updates the order.

* Works with the classic and the block-based checkout, and with WooCommerce order tables (HPOS).
* Every webhook signature is checked (HMAC-SHA256, at most 5 minutes old); repeated deliveries are ignored.
* An order is marked paid only by AulsPay's answer, never because the customer opened the "thank you" page.
* Your store keeps no wallet keys. Funds go to the wallets connected to AulsPay.

== Installation ==

1. Plugins → Add New → Upload Plugin, choose aulspay-woocommerce.zip, Install, Activate.
2. In the AulsPay merchant panel, Integrations → Websites: add your store's domain.
3. Integrations → API keys: create a key for that website with the invoices:write and read scopes (cg_test_ for test networks, cg_live_ for live).
4. WooCommerce → Settings → Payments → AulsPay: paste the API key. Test mode on for a cg_test_ key.
5. Copy the webhook URL shown under "Webhook secret" (https://your-store.com/wp-json/aulspay/v1/webhook). In AulsPay, Integrations → Webhooks, save it as the endpoint and copy the signing secret (whsec_…) into the plugin.
6. Send a test event from AulsPay (Integrations → Webhooks) and check it is delivered. Then place a small test order.

The store currency must be USD or EUR.

== Order statuses ==

* Waiting for payment: Pending payment.
* Payment seen on the network: an order note; the order stays pending until confirmed.
* Paid (also overpaid or paid late): Processing, or Completed if chosen in the settings.
* Underpaid: On hold. The customer can send the rest to the same address before the link expires.
* Expired: Cancelled. A payment that still arrives later is credited and the order is marked paid.

== Troubleshooting ==

= The order stays on "Pending payment" after paying =
The webhook did not reach the store. In AulsPay, Integrations → Webhooks → Recent deliveries: 401 means the webhook secret is wrong; 404 or a timeout means the URL is wrong or a security plugin or firewall blocks /wp-json/. Logs: WooCommerce → Status → Logs, source "aulspay".

= "Pay with crypto" does not show at checkout =
The settings are incomplete (a notice in the WordPress admin says what is missing), test mode does not match the key, or the store currency is not USD or EUR.

== Changelog ==

= 1.0.0 =
* First release.
