Stripe
For selling on your own site with Payment Links or Checkout. A paid checkout issues a license, and the success page shows the key straight away.
Setup
- SunLicense: Integrations → Stripe → Connect. Map products by Payment Link ID (
plink_…) or by asunlicense_productvalue you put in the Checkout Session'smetadata; or*. - Stripe Developers → Webhooks → Add endpoint: URL = the hook URL. Events:
checkout.session.completed,checkout.session.async_payment_succeeded,charge.refunded,charge.dispute.created,charge.dispute.closed,customer.subscription.deleted. - Copy the endpoint's signing secret (
whsec_…) into the integration. - Payment Link → After payment → Don't show confirmation page → redirect to the redeem URL with
?session_id={CHECKOUT_SESSION_ID}(the integration page shows it ready to copy). For Checkout, use the same value assuccess_url.
The buyer lands on the redeem page, which waits a few seconds for the webhook and then shows the key. The Checkout Session ID is unguessable, so no email is asked.
Behaviour
| Stripe event | SunLicense does |
|---|---|
checkout.session.completed (paid) / async_payment_succeeded | One license per session |
charge.refunded (fully refunded) | Revokes; partial refunds keep the license |
charge.dispute.created | Suspends; charge.dispute.closed won → reinstates, lost → revokes |
customer.subscription.deleted | Suspends the subscription's license |
Stripe-Signature is verified (HMAC-SHA256, 5-minute tolerance). Test-mode and live-mode endpoints have different secrets: connect one integration per mode.
