Paid apps to use new env variable
This commit is contained in:
parent
5dc3065a47
commit
6e253f280a
|
@ -76,6 +76,8 @@ STRIPE_CLIENT_ID= # ca_...
|
|||
PAYMENT_FEE_FIXED=10 # Take 10 additional cents commission
|
||||
PAYMENT_FEE_PERCENTAGE=0.005 # Take 0.5% commission
|
||||
|
||||
# Used to allow apps to be paid for via Stripe
|
||||
STRIPE_WEBHOOK_SECRET_FOR_APPS=
|
||||
# - TANDEM
|
||||
# Used for the Tandem integration -- contact support@tandem.chat for API access.
|
||||
TANDEM_CLIENT_ID=""
|
||||
|
|
|
@ -83,13 +83,13 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||
throw new HttpCode({ statusCode: 400, message: "Missing stripe-signature" });
|
||||
}
|
||||
|
||||
if (!process.env.STRIPE_WEBHOOK_SECRET) {
|
||||
throw new HttpCode({ statusCode: 500, message: "Missing process.env.STRIPE_WEBHOOK_SECRET" });
|
||||
if (!process.env.STRIPE_WEBHOOK_SECRET_FOR_APPS) {
|
||||
throw new HttpCode({ statusCode: 500, message: "Missing process.env.STRIPE_WEBHOOK_SECRET_FOR_APPS" });
|
||||
}
|
||||
const requestBuffer = await buffer(req);
|
||||
const payload = requestBuffer.toString();
|
||||
|
||||
const event = stripe.webhooks.constructEvent(payload, sig, process.env.STRIPE_WEBHOOK_SECRET);
|
||||
const event = stripe.webhooks.constructEvent(payload, sig, process.env.STRIPE_WEBHOOK_SECRET_FOR_APPS);
|
||||
|
||||
const handler = webhookHandlers[event.type];
|
||||
if (handler) {
|
||||
|
|
|
@ -334,6 +334,7 @@
|
|||
"ZOHOCRM_CLIENT_ID",
|
||||
"ZOHOCRM_CLIENT_SECRET",
|
||||
"ZOOM_CLIENT_ID",
|
||||
"ZOOM_CLIENT_SECRET"
|
||||
"ZOOM_CLIENT_SECRET",
|
||||
"STRIPE_WEBHOOK_SECRET_FOR_APPS"
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user