WooCommerce
A sample plugin that checks each order before payment, holds the risky ones and reports fraud refunds.
What you get
One PHP file to read and adapt. It is a sample, not a WordPress.org plugin.
Install
- In WordPress, open Plugins, Add Plugin, Upload Plugin. Choose the zip and activate it.
- Open WooCommerce, Signet. Paste your test keys.
- Choose what happens on review and on deny, and save.
| Setting | Choices |
|---|---|
| Site key, secret key | pk_ and sk_. The page never shows a saved secret. |
| On review | Put the order on hold (default), or a note only. |
| On deny | Stop before payment (default), put on hold, or a note only. |
| Sandbox result | With test keys, every order gets this result. |
How it decides
The tag runs on shop, product, cart, checkout and account pages. Just before payment, the plugin sends this:
POST /v1/assess
{ "session_id": "s_...", "event": "PAYMENT", "email": "buyer@example.com", "account_id": "wp-42",
"amount": 49.90, "currency": "USD", "transaction_id": "1042", "ip": "203.0.113.7", "user_agent": "..." }
| Answer | Order |
|---|---|
allow | Continues. The decision is added as a note. |
review | Is paid, then stays On hold. |
deny | Becomes Failed. No payment is taken. |
| No answer in two seconds | Continues, with a note. |
The order keeps _signet_decision, _signet_reason_codes and _signet_session_id. When you refund an order and the reason mentions “fraud”, the plugin sends POST /v1/feedback.
It works with the checkout block and the shortcode checkout. The block sends no form, so the session ID also travels in a cookie named signet_session_id that ends with the browser session. Name it in your cookie notice.
Photos of damage
Open the order and choose the action Signet: ask for photos. The plugin makes a photo proof and emails the customer its link. Signet: read photos adds the result as a note. One ID verification when the customer finishes.
POST /v1/photo-proofs
{ "reference": "1042", "customer": "wp-42", "prompt": "Show the damage, and the whole item.", "shots": 2 }
Test mode
Use test keys and set Sandbox result to Review. Place an order: it is paid and stays on hold. Set it to Deny: the checkout shows a message and takes no payment. Test calls use no quota.
Limits
- Payment methods that set their own order status may skip the hold. Cash on delivery is covered; test any other method you use.
- Orders made in the admin, by subscription renewals or through the REST API have no browser and are not checked.
- The plugin does not translate text, work with multisite network settings or update itself.
Checked against WooCommerce’s developer documentation and source code on November 24, 2026.