=== SwapSS Pay for WooCommerce ===
Contributors: swapss
Tags: woocommerce, crypto, payment gateway, cryptocurrency
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept cryptocurrency payments in your WooCommerce store via SwapSS Pay.

== Description ==

SwapSS Pay for WooCommerce lets you accept crypto payments from customers worldwide. After placing an order, the customer is redirected to a secure hosted payment page. Your store is notified via a signed webhook when payment is confirmed.

**How it works:**

1. Customer selects "Crypto (via SwapSS Pay)" at checkout and places the order.
2. The plugin creates a payment invoice via the SwapSS Pay API.
3. The customer is redirected to a secure hosted payment page.
4. SwapSS Pay sends a signed webhook to your store confirming payment.
5. The order is marked as paid automatically.

**Features:**

* Redirect-based hosted checkout — no sensitive data touches your server.
* Signed webhook verification (HMAC-SHA256) — payment truth is never trusting a redirect.
* Idempotent invoice creation — safe to retry without creating duplicate invoices.
* WooCommerce HPOS (High-Performance Order Storage) compatible.
* WooCommerce Blocks checkout compatible.
* Supports WooCommerce 8.0+, PHP 8.1+, WordPress 6.0+.

**Requirements:**

* A SwapSS Pay merchant account — [sign up at swapss.lol/for-business](https://swapss.lol/for-business).
* An API key and webhook secret from your SwapSS Pay dashboard.

**Webhook configuration:**

Set your webhook endpoint in the SwapSS Pay dashboard to:
`https://your-store.com/wp-json/swapss-pay/v1/webhook`

The exact URL is shown in the plugin settings page.

== External Services ==

This plugin requires a SwapSS Pay merchant account and connects to the SwapSS Pay API (https://swapss.lol) to process payments. This connection is the plugin's core function — SwapSS Pay is the payment processor; without it the plugin does nothing.

When a customer places an order and selects SwapSS Pay at checkout, the plugin sends the following to the SwapSS Pay API to create a payment invoice: the order total and the crypto asset/network you configured, your WooCommerce order ID and order key, the customer's WordPress user ID (if logged in), an order description containing your site name and order number, the checkout return URL, and your store's site URL. No card numbers, customer addresses, passwords, or private keys are ever sent to or stored by this plugin. SwapSS Pay sends a signed webhook back to your store to confirm payment status; the plugin collects no analytics or browsing data.

This data is sent on every checkout attempt that uses the SwapSS Pay payment method, and when you use the "Test connection" button in the plugin settings (which sends only your API key for verification).

Service provider: SwapSS Pay — [Terms of Service](https://swapss.lol/tos), [Privacy Policy](https://swapss.lol/privacy). Review both before enabling the gateway on a live store.

== Installation ==

1. Upload the `swapss-pay-for-woocommerce` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **WooCommerce > Settings > Payments** and enable **SwapSS Pay**.
4. Enter your **API Key** and **Webhook Secret** from your SwapSS Pay dashboard.
5. Configure your SwapSS Pay dashboard to send webhooks to the URL shown in the settings.

== Frequently Asked Questions ==

= Where do I get an API key? =

Sign up for a merchant account at [swapss.lol/for-business](https://swapss.lol/for-business). Your API key and webhook secret are in the merchant dashboard.

= Which cryptocurrencies are supported? =

Supported assets and networks depend on your SwapSS Pay account configuration. Check your dashboard for the current list.

= What happens if a payment is underpaid? =

The order is put on hold and an order note is added. Review and handle manually via your WooCommerce admin or SwapSS Pay dashboard.

= Is this compatible with the WooCommerce Blocks checkout? =

Yes. The plugin declares full WooCommerce Blocks compatibility and registers a block payment method type.

= Is the plugin compatible with HPOS (High-Performance Order Storage)? =

Yes. All order data access uses the WC_Order API.

= Where is the webhook endpoint? =

`https://your-store.com/wp-json/swapss-pay/v1/webhook` — the exact URL is shown in the plugin settings page.

= How are payments verified? =

Payments are verified via a signed webhook from SwapSS Pay using HMAC-SHA256. The plugin verifies the signature and timestamp before updating any order. Redirect parameters are never trusted for payment status.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
