Fix/stripe payment intent succeded (#3044)

* Remove conditional that turned off booking payment update

* Added stripe webhook key to env vars

* Update .env.example

Co-authored-by: Omar López <zomars@me.com>
pull/3045/head
alannnc 2022-06-13 13:41:57 -06:00 committed by GitHub
parent f9d05f7a0e
commit 2362133b25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -86,6 +86,7 @@ NEXT_PUBLIC_STRIPE_PRO_PLAN_PRODUCT=
NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE=
NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE=
NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE=
STRIPE_WEBHOOK_SECRET=
# Use for internal Public API Keys and optional
API_KEY_PREFIX=cal_

View File

@ -187,10 +187,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const event = stripe.webhooks.constructEvent(payload, sig, process.env.STRIPE_WEBHOOK_SECRET);
if (event.account) {
throw new HttpCode({ statusCode: 202, message: "Incoming connected account" });
}
const handler = webhookHandlers[event.type];
if (handler) {
await handler(event);