test: adding confirmed payment test cases on Stripe (#10243)

Co-authored-by: Joe Au-Yeung <[email protected]>
Co-authored-by: Joe Au-Yeung <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-08-21 11:12:39 +02:00
1 parent 0ddab30340
commit d66095bf9c
4 files changed
+95 -11

No files matched your search

+3 -1
View File
@@ -398,7 +398,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const event = stripe.webhooks.constructEvent(payload, sig, process.env.STRIPE_WEBHOOK_SECRET);
if (!event.account) {
// bypassing this validation for e2e tests
// in order to successfully confirm the payment
if (!event.account && !process.env.NEXT_PUBLIC_IS_E2E) {
throw new HttpCode({ statusCode: 202, message: "Incoming connected account" });
}