WooCommerce
For WordPress sellers with their own WooCommerce shop, e.g. the paid "Pro" version of a plugin.
Setup
- SunLicense: Integrations → WooCommerce → Connect. Map WooCommerce product IDs to policies, or
*. SunLicense creates a webhook secret. - WooCommerce Settings → Advanced → Webhooks → Add webhook: status Active, topic Order updated (add a second one for Order created if you like), delivery URL = the hook URL, secret = the one on the integration page, API version WP REST API v3.
- Link the integration's redeem page in your order emails. Buyers enter the order number and their billing email.
Check it in your plugin with the PHP SDK (see SDKs).
Behaviour
| Order status | SunLicense does |
|---|---|
processing, completed | One license per product line (once, however many updates follow) |
refunded, cancelled | Revokes |
| anything else | Logged |
X-WC-Webhook-Signature (base64 HMAC-SHA256 of the body) is checked. The unsigned ping WooCommerce sends when you save the webhook is acknowledged.
