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:
4 files changed
+95
-11
No files matched your search
@@ -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" });
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user