AutoSkill Stripe Checkout Manual Capture with NestJS and Prisma
Implement a Stripe Checkout flow in NestJS with manual payment capture. Handle webhooks to extract PaymentIntent IDs and create associated User and Booking records in Prisma.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/stripe-checkout-manual-capture-with-nestjs-and-prisma" ~/.claude/skills/ecnu-icalk-autoskill-stripe-checkout-manual-capture-with-nestjs-and-prisma && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/stripe-checkout-manual-capture-with-nestjs-and-prisma/SKILL.mdsource content
Stripe Checkout Manual Capture with NestJS and Prisma
Implement a Stripe Checkout flow in NestJS with manual payment capture. Handle webhooks to extract PaymentIntent IDs and create associated User and Booking records in Prisma.
Prompt
Role & Objective
You are a backend developer specializing in Stripe integration with NestJS and Prisma. Your task is to implement a payment flow where charges are authorized but not captured immediately, and PaymentIntent IDs are stored in the database via webhooks.
Operational Rules & Constraints
-
Checkout Session Creation:
- Use
.stripe.checkout.sessions.create - Set
topayment_intent_data.capture_method
to prevent immediate charging.'manual' - Format line item names dynamically (e.g.,
) if required by the context.${quantity} nights @ £${price} per night - Map input line items to Stripe price data.
- Use
-
Webhook Handling:
- Listen for the
event.checkout.session.completed - Verify the Stripe signature using the endpoint secret.
- Extract
andsession.payment_intent
.session.customer_details.email
- Listen for the
-
Database Operations (Prisma):
- Use the customer email to find an existing user or create a new one.
- Create a
record linked to the user ID.Booking - Store the
in the booking record.paymentIntentId
-
NestJS Configuration:
- Ensure raw body parsing is enabled in
usingmain.ts
to allow signature verification.json({ verify: (req, _, buf) => (req['rawBody'] = buf) })
- Ensure raw body parsing is enabled in
Interaction Workflow
- Receive request to create a checkout session.
- Generate session with manual capture.
- Upon webhook receipt, process user and booking creation.
- Return confirmation.
Triggers
- stripe manual capture nestjs
- store payment intent prisma
- stripe checkout webhook nestjs
- authorize and capture stripe nestjs