In-app payments and webhooks with Stripe.
stripe
object like so:
POST /webhooks/stripe
route in the api
app. This route constructs the event and then switches on the event type to determine how to process the event.
pnpm dev
.
Edit the layout
apps/app/app/layout.tsx
and add <Script src="https://js.stripe.com/v3/" />
after the opening <html>
tag and before the opening <body>
tag. You will also need to add import Script from 'next/script'
Add script to the website
apps/web/app/layout.tsx
.Prevent common fraud patterns with Arcjet
apps/app/app/(authenticated)/layout.tsx
you could add this after the call to aj.protect()
: