charanjit-singh/lovable-skills/stripe-one-time-payment-webhooks

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when webhooks for one-time Stripe payments: Checkout mode payment, Payment Links, payment_intent.succeeded, orders table, credits, or lifetime purchases. Not for recurring subscriptions (use stripe-payment-webhooks and pricing-and-billing).

Install

npx vskill@latest install charanjit-singh/lovable-skills/stripe-one-time-payment-webhooks

SKILL.md

Stripe one-time payment webhooks

Separate orders / purchases from subscriptions. Different events and tables.

Checkout mode: "payment"

Handle checkout.session.completed:

  • session.mode === "payment"
  • session.payment_intent — retrieve for amount, status
  • client_reference_id / metadata.user_id → app user
ts
case "checkout.session.completed": {
const session = event.data.object as Stripe.Checkout.Session;
if (session.mode !== "payment") break;
const userId = session.client_reference_id ?? session.metadata?.user_id;
if (!userId || !session.payment_intent) break;
await upsertOrder({
user_id: userId,
stripe_payment_intent_id: session.payment_intent as string,
stripe_checkout_session_id: session.id,
amount_total: session.amount_total,
currency: session.currency,
status: "paid",
});
break;
}

Also handle payment_intent.succeeded if you create PaymentIntents without Checkout — same upsert keyed on payment_intent.id (idempotency).

Schema

sql
create table public.orders (
id uuid primary key default gen_random_uuid(),
user_id uuid not null references auth.users(id),
stripe_payment_intent_id text unique,
stripe_checkout_session_id text unique,
amount_total bigint,
currency text,
status text not null check (status in ('paid', 'refunded', 'failed')),
product_id text,
created_at timestamptz default now()
);

Refunds

  • charge.refunded or payment_intent.canceled → set orders.status = 'refunded'; revoke credits if applicable.

Credits / lifetime license

Grant in webhook after idempotency check:

ts
await supabase.rpc("grant_credits", { p_user_id: userId, p_amount: 100 });

RPC must be idempotent or guarded by stripe_payment_intent_id unique constraint.

Avoid

  • Storing one-time purchase only in subscriptions table.
  • Fulfilling order on success_url without webhook.
  • Double grant on checkout.session.completed + payment_intent.succeeded without shared idempotency key (use same payment_intent_id unique key).

Related

  • stripe-payment-webhooks — signature and hosting
  • payment-webhook-idempotency — duplicate events

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
10
Repository forks
9
7-day trend score
12

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/charanjit-singh/lovable-skills/stripe-one-time-payment-webhooks/badge)](https://verified-skill.com/skills/charanjit-singh/lovable-skills/stripe-one-time-payment-webhooks)

Something wrong with this skill or its page? Tell us.