ReviewOS

also looking at this

stacks/uplink

feat(billing): issue the license from Stripe, not only from the thank-you page

#49
Merged glennmichael123 wants to merge feat/stripe-webhook into main
9 files +439 -2
config/saas.tsmodified+6-2
Changes to config/saas.ts
@@ -1,4 +1,5 @@
11import type { SaasConfig } from '@stacksjs/types'
2import process from 'node:process'
23import { PLANS, PRODUCT_NAME, SIX_MONTHS_FREE } from '../app/Billing/plans'
34
45/**
@@ -27,9 +28,12 @@ export default {
2728 },
2829 },
2930 ],
31 // Where Stripe sends what happened. `STRIPE_WEBHOOK_SECRET` is the signing
32 // secret Stripe shows when the endpoint is created; without it the endpoint
33 // verifies nothing and refuses every delivery, which is the safe direction.
3034 webhook: {
31 endpoint: 'your-webhook-endpoint',
32 secret: 'your-webhook-secret',
35 endpoint: '/api/billing/webhook',
36 secret: process.env.STRIPE_WEBHOOK_SECRET ?? '',
3337 },
3438 currencies: ['usd'],
3539 // Six months of Monthly, free: 100% off six monthly invoices. The code is