checkout.paid webhook, confirm the payment, and refund. It runs on PHP 7.4 or later and adapts directly to a WooCommerce payment gateway (process_payment for step 2, a woocommerce_api_* endpoint for step 3).
Keep your API key and webhook secret in your server’s configuration, never in the browser.
1. A small API helper
Authorization header: the API key goes only in X-API-Key (see Authentication).
2. Create a checkout and redirect
start_payment again with the same attempt number: the Idempotency-Key returns the first checkout instead of creating a second.
3. Receive the webhook
Registerhttps://shop.example.com/?wc-api=platnova (or your own URL) under Settings → Webhooks in the dashboard and copy its secret.
4. Verify, then fulfil once
Never fulfil from the webhook body alone. Ask Platnova:success_url, so the order shows paid even if the webhook is still on its way.
5. Refund
checkout.refunded or checkout.refund_failed. Codes and rules are on Refunds.
Checklist before you ship
- Keys only on the server;
X-API-Keyonly, noAuthorizationheader. - Every create and refund carries an idempotency key tied to the order.
- Webhook signature checked over the raw body with
hash_equals; non-2xx on failure. - Orders marked paid only after
POST /v1/payments/verify, compared on amount and currency (case-insensitive), and only once per checkout id. - A clear message when a merchant’s calls answer
entity_not_active(see Going live).

