=== WooCommerce Redsys Gateway ===
Contributors: j.conti
Tags: Redsys, Gateway, WooCommerce
Requires at least: 5.4
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 31.0.1
License: GPLv3 or later License
URI: http://www.gnu.org/licenses/gpl-3.0.html


== Agentic Commerce ==

This plugin exposes WooCommerce stores to AI agents (ChatGPT, Claude, Gemini,
Perplexity) via two parallel protocols:

 * ACP (OpenAI/Stripe Agentic Commerce Protocol). Enabled by default.
 * UCP (Universal Commerce Protocol, NRF 2026). Disabled by default.

Configure them under WooCommerce → Settings → Agentic Commerce.

Discovery URLs:

 * ACP: https://your-site.com/.well-known/agent-commerce.json
 * UCP: https://your-site.com/.well-known/ucp.json

See `desarrollo/ACP-API-DOCS.md` and `desarrollo/UCP-API-DOCS.md` in the
plugin folder for full API references (endpoints, OAuth/Bearer auth,
webhook signatures and supported events).


== Installation ==

 * Unzip the files and upload the folder into your plugins folder (wp-content/plugins/) overwriting old versions if they exist
 * Activate the plugin in your WordPress admin area.
 * Open the settings page for WooCommerce and click the "Payment Gateways" tab
 * Click on the sub tab for "Redsys/Servired"
 * Configure your Redsys settings.
 * Configure Sequential Invoice Number
 * Activate Sequencial Invoice Number


== Changelog ==

= 31.0.1 =
 * FIX: Bizum en página de pago (Bizum InSite) no enviaba la descripción
   a Redsys. El cobro real del modal usa la API REST (trataPeticionREST)
   y esa petición no incluía DS_MERCHANT_PRODUCTDESCRIPTION, por lo que la
   "Descripción Redsys" configurada (p. ej. "ID Pedido") llegaba vacía al
   panel de Redsys. Ahora se calcula con el ajuste seleccionado y se envía
   en la petición REST.
 * FIX: La cuenta atrás del modal de Bizum en página de pago mostraba
   7 minutos. Ahora muestra 5 minutos y el control de tiempo en servidor
   que redirige al checkout se ajusta en consecuencia (60 iteraciones *
   5 segundos = 5 minutos).

= 31.0.0 =
 * NEW: Agent2Agent (A2A) protocol surface. Opt-in (disabled by default).
   Publishes an Agent Card at `/.well-known/agent-card.json` and a
   JSON-RPC 2.0 endpoint at `/wp-json/wc-redsys-a2a/v1/rpc` with seven
   skills: `query_payment_status`, `create_payment`, `capture_payment`,
   `refund_payment`, `list_payments`, `tokenize_card` and
   `recurrent_charge`. Authentication reuses the UCP OAuth 2.1 + PKCE
   authorization server with `a2a:payments:*` scopes (and an optional
   sandbox bearer for testing under WP_DEBUG).
 * NEW: Resumable Server-Sent Events stream at
   `/wp-json/wc-redsys-a2a/v1/tasks/{taskId}/stream` for live task
   updates, with `Last-Event-ID` resume and 15s heartbeats.
 * NEW: Signed outbound push notifications to a client-registered
   `push_url`. `X-A2A-Signature: sha256=<hmac>` over
   `<timestamp>.<body>`, retries 1m/5m/30m/2h (4 max), delivered via
   Action Scheduler.
 * NEW: Admin tab "A2A (Agent2Agent)" under Redsys Advanced → Agentic
   Commerce. Status / Clients (create / revoke / rotate sandbox
   bearers) / Limits & modes (`max_amount`, `sensitive_threshold` and
   exposed payment modes) / Confirmaciones (approve refunds or
   recurrent charges parked at `input-required`).
 * NEW: Per-skill ceilings — `max_amount` is a hard cap that fails the
   task with `limit_exceeded`; `sensitive_threshold` parks the task at
   `input-required` until an admin confirms it. Both default to no cap
   (opt-in).
 * NEW: Append-only audit log at `wp_redsys_a2a_audit_log`. Raw payloads
   are never stored — only a SHA-256 hash plus a sanitized one-line
   summary that masks PAN, tokens, secrets and email local-parts.
 * NEW: Self-healing storage. The four A2A tables are recreated on
   demand by every store's `ensure_table()` so a dropped table never
   fatally errors.
 * INTERNAL: New hook `redsys_post_authorization` fires after a
   successful preauthorization capture (TransactionType 1 → 2).
   `redsys_post_refund` continues to fire after refunds.
 * INTERNAL: UCP OAuth server gained an `a2a_*` client type and
   accepts dynamic registration with `client_type=a2a_*`.
 * DOCS: New `docs/A2A.md`, `docs/A2A-skills.md`, `docs/A2A-auth.md`,
   `docs/A2A-webhooks.md`, `docs/A2A-troubleshooting.md`. Working
   reference client under `examples/python-client/`.

= 30.4.1 =
 * NEW: Agentic Commerce support. ACP (OpenAI/Stripe Agentic Commerce
   Protocol) is enabled by default and exposes `/.well-known/agent-commerce.json`,
   the `redsys-acp/v1` REST namespace (checkout sessions, payment delegation,
   product feed, webhook subscriptions) and a Woo Agentic-compatible mirror
   under `wc/agentic/v1`. UCP (Universal Commerce Protocol, NRF 2026) ships
   alongside, disabled by default, and exposes `/.well-known/ucp.json`,
   OAuth 2.0 with PKCE under `redsys-ucp/oauth/v1` and the Checkout, Catalog
   and Orders capabilities under `redsys-ucp/{capability}/v1`. Both
   protocols share Redsys/Bizum HPP for the actual payment authorization.
 * For the full per-release notes including security and bug fixes, see
   `changelog.txt`.
