=== CircusPay Payment ===
Contributors: circuspay
Tags: payment, circuspay, checkout, card, crypto
Requires at least: 5.6
Tested up to: 6.6
Stable tag: 1.6.3
Requires PHP: 7.4
WC requires at least: 6.0
WC tested up to: 9.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept payments through CircusPay on WordPress and WooCommerce (card & crypto). WooCommerce gateway, shortcode and webhooks. Available in English, Spanish and French.

== Description ==

* **WooCommerce**: "Card / Crypto (CircusPay)" payment gateway — classic checkout AND Blocks. The customer pays on a CircusPay-hosted page; the order is confirmed automatically by webhook.
* **WordPress** (without WooCommerce): a payment button via the shortcode [circuspay_checkout]
* Configure your API key and webhook secret once
* **Test mode** switch: try your own checkout with your products and design, without charging anything, then go live from the same settings page
* HPOS compatible (WooCommerce High-Performance Order Storage)
* Translation-ready — ships with English, Spanish (es_ES) and French (fr_FR)

== Installation (WooCommerce) ==

1. Upload `circuspay-payment.zip` in Plugins → Add New → Upload, then activate.
2. Go to WooCommerce → Settings → Payments → **CircusPay** → "Manage".
3. Enable the gateway, paste your **API key** (sk_live_oni_… / sk_test_oni_…, API tab of the CircusPay dashboard) and your **Webhook secret** (Webhooks tab).
4. In the CircusPay dashboard (Webhooks), register the webhook URL shown in the gateway settings (of the form https://yoursite.com/?circuspay_webhook=1) and the event payment.succeeded.
5. Run a test payment (sk_test_… key): the order should move to "Pending" then "Processing/Completed" after payment.

== Installation (shortcode) ==

1. Upload the `circuspay-payment` folder to /wp-content/plugins/
2. Activate the plugin from the "Plugins" screen
3. Go to Settings → CircusPay and enter your API key (sk_live_oni_... or sk_test_oni_...)
4. Use the shortcode [circuspay_checkout amount="29.99" product_name="My product"] in a page or post

== Shortcode ==

[circuspay_checkout amount="29.99" product_name="My product" order_id="ORD-001" success_url="https://yoursite.com/thank-you" cancel_url="https://yoursite.com/cart" button_text="Pay"]

* amount (required): amount in units (e.g. 29.99 for €29.99) unless "Amount in cents" is checked in the settings
* currency: EUR by default
* product_name: product label
* order_id: order reference (auto-generated otherwise)
* success_url: page after a successful payment
* cancel_url: page on cancellation
* customer_email: customer email (optional)
* button_text: button text

== Webhook ==

In CircusPay (dashboard): Settings → Webhooks, add the URL shown in Settings → CircusPay and paste the secret into the "Webhook secret" field.

== Languages ==

The plugin ships translated into English (default), Spanish (es_ES) and French (fr_FR). WordPress loads the right translation automatically based on the site language (Settings → General → Site Language). Additional locales can be added under /languages.

== Changelog ==

= 1.6.3 =
* Switching WooCommerce from test to live requires at least one successful sandbox transaction on the authenticated CircusPay account. Existing live gateways retain their current configuration.

= 1.6.2 =
* Guided WooCommerce setup, with separate evidence for test checkout creation and confirmation received by the store.

= 1.6.1 =
* Test mode is selected at first WooCommerce setup. Previously saved gateway settings keep their mode, including older live configurations without a test switch.

= 1.6.0 =
* Test mode switch in the gateway settings: orders open your CircusPay checkout in test mode (simulated payments, test card 4242 4242 4242 4242), then untick to go live. Works with the live API key.
* The checkout summary now shows the ordered products (name, image, quantities) instead of a generic order label.
* Test orders are flagged and noted "TEST"; a test payment can never complete or fail a live order.
* Admin notice while test mode is on.

= 1.3.0 =
* Full internationalization: English source + bundled Spanish (es_ES) and French (fr_FR) translations (.po/.mo), Domain Path declared.

= 1.1.0 =
* WooCommerce payment gateway (classic checkout + Blocks)
* Order confirmation via payment.succeeded webhook + fallback polling on return
* HPOS compatibility; direct link to WooCommerce settings

= 1.0.0 =
* Initial version: shortcode, settings, payment.succeeded webhook


= 1.3.2 =
CircusPay API default; legacy API URL migration; WooCommerce billing address prefill; paid-order protection. Order currency is preserved, including GBP. Routing is selected securely by the merchant account.
