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
parent
f9d05f7a0e
commit
2362133b25
|
@ -86,6 +86,7 @@ NEXT_PUBLIC_STRIPE_PRO_PLAN_PRODUCT=
|
||||||
NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE=
|
NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE=
|
||||||
NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE=
|
NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE=
|
||||||
NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE=
|
NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE=
|
||||||
|
STRIPE_WEBHOOK_SECRET=
|
||||||
|
|
||||||
# Use for internal Public API Keys and optional
|
# Use for internal Public API Keys and optional
|
||||||
API_KEY_PREFIX=cal_
|
API_KEY_PREFIX=cal_
|
||||||
|
|
|
@ -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);
|
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];
|
const handler = webhookHandlers[event.type];
|
||||||
if (handler) {
|
if (handler) {
|
||||||
await handler(event);
|
await handler(event);
|
||||||
|
|
Loading…
Reference in New Issue