Payments
LicenceForge integrates with two payment platforms — WooCommerce and Stripe — to automate license creation, renewal, and lifecycle management when customers purchase your software.
Overview
When a customer completes a purchase through either integration, LicenceForge automatically creates a license record, associates it with the correct product and price tier, and delivers the license key to the customer. Both integrations are idempotent: duplicate orders or webhook deliveries will not create duplicate licenses.
You can run WooCommerce and Stripe side-by-side on the same site. Each integration tracks its own order and subscription references independently on the license record.
WooCommerce
The WooCommerce integration hooks into order lifecycle events to create and manage licenses. Link your WooCommerce products to LicenceForge price tiers via the wc_product_id field, and licenses are generated automatically when orders reach the completed or processing status.
Key features
- Automatic license creation on order completion
- MySQL named locks (
GET_LOCK) to prevent duplicate license creation - Support for both simple products and product variations
- License key displayed on thank-you page, order details, and order emails
- Full WooCommerce Subscriptions support with status mapping
- Refund handling with full vs. partial refund distinction
Stripe
The Stripe integration uses Checkout Sessions for payment collection and webhooks for asynchronous event processing. LicenceForge supports both test and live modes, encrypts API keys at rest, and verifies every incoming webhook with HMAC-SHA256 signatures.
Key features
- Test and live mode with separate key pairs
- AES-encrypted API key storage via
WPLF_Crypto::encrypt_option() - Checkout Sessions for subscriptions (month/year) and one-time payments (lifetime)
- Comprehensive webhook handling for 9 distinct Stripe event types
- Idempotent event processing via
UNIQUEconstraint on event IDs - Exponential backoff retry with up to 5 attempts over ~5 hours
Refunds and Disputes
Both integrations handle refunds and disputes consistently. A full refund suspends the associated license; a partial refund is logged but does not change license status. Stripe disputes suspend the license immediately and resolve based on the dispute outcome.
Read the full refund and dispute handling guide.
Integration Comparison
| Capability | WooCommerce | Stripe |
|---|---|---|
| License creation trigger | Order status hooks | checkout.session.completed webhook |
| Subscription support | Via WC Subscriptions plugin | Native Stripe Billing |
| Duplicate prevention | MySQL GET_LOCK + existence check |
UNIQUE constraint on event_id |
| Refund detection | woocommerce_order_refunded hook |
charge.refunded webhook |
| Dispute handling | Not applicable | Automatic suspend/reactivate |
| Retry mechanism | Relies on WooCommerce order processing | Exponential backoff (5 retries, cron-based) |