mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-08-22 16:47:16 -05:00
feat: add webhook signing key as config variable
This commit is contained in:
@@ -45,7 +45,8 @@ There are no fully required configuration variables, the app can runs minimally
|
||||
| | `PN_WEBSITE_DISCORD_SUPPORTER_ROLE_ID` | Role to give for supporter access | (No role) |
|
||||
| | | | |
|
||||
| Payments | `PN_WEBSITE_STRIPE_SECRET_KEY` | Stripe secret key | - |
|
||||
| (Requires `discord` feature) | `PN_WEBSITE_STRIPE_NOTIFICATION_EMAIL` | Email address to send stripe notifications to | (No notifications) |
|
||||
| (Requires `discord` feature) | `PN_WEBSITE_STRIPE_WEBHOOK_SECRET` | Stripe webhook signing key | - |
|
||||
| | `PN_WEBSITE_STRIPE_NOTIFICATION_EMAIL` | Email address to send stripe notifications to | (No notifications) |
|
||||
| | `PN_WEBSITE_MONGO_CONNECTION_STRING` | MongoDB connection string for account server | - |
|
||||
| | `PN_WEBSITE_SMTP_HOST` | Host for the SMTP server | - |
|
||||
| | `PN_WEBSITE_SMTP_PORT` | Port for the SMTP server | `587` |
|
||||
|
||||
@@ -28,6 +28,7 @@ PN_WEBSITE_DISCORD_SUPPORTER_ROLE_ID=
|
||||
|
||||
# Optional - Donation features + rewards (Requires discord):
|
||||
PN_WEBSITE_STRIPE_SECRET_KEY=
|
||||
PN_WEBSITE_STRIPE_WEBHOOK_SECRET=
|
||||
PN_WEBSITE_STRIPE_NOTIFICATION_EMAIL=notifs@example.com
|
||||
PN_WEBSITE_MONGO_CONNECTION_STRING=mongodb://localhost:27017/account?directConnection=true
|
||||
PN_WEBSITE_SMTP_HOST=localhost
|
||||
|
||||
@@ -33,6 +33,7 @@ export default defineNuxtConfig({
|
||||
|
||||
githubApiToken: '',
|
||||
stripeSecretKey: '',
|
||||
stripeWebhookSecret: '',
|
||||
stripeNotificationEmail: '',
|
||||
hcaptchaSecretKey: '',
|
||||
grpcHost: '',
|
||||
|
||||
@@ -49,7 +49,7 @@ export async function handleStripeEvent(event: H3Event, stripe: Stripe, webhook:
|
||||
return;
|
||||
}
|
||||
|
||||
if (webhook.type === 'customer.subscription.updated' || webhook.type === 'customer.subscription.deleted') {
|
||||
if (webhook.type === 'customer.subscription.updated' || webhook.type === 'customer.subscription.created' || webhook.type === 'customer.subscription.deleted') {
|
||||
const subscription = webhook.data.object;
|
||||
const subscriptionItem = subscription.items.data[0];
|
||||
if (!subscriptionItem) {
|
||||
|
||||
1
src/plugins/types.d.ts
vendored
1
src/plugins/types.d.ts
vendored
@@ -9,6 +9,7 @@ declare module 'nuxt/schema' {
|
||||
githubApiToken: string;
|
||||
|
||||
stripeSecretKey: string;
|
||||
stripeWebhookSecret: string;
|
||||
stripeNotificationEmail: string;
|
||||
|
||||
hcaptchaSecretKey: string;
|
||||
|
||||
Reference in New Issue
Block a user