stripe-webhook-integration

stripe-webhook-integration is a skill for Claude Code, Codex from sandeepmvl/rails-skills. It costs 110 tokens per session (1,965 once invoked), scanned A, original, MIT.

A guide to handling Stripe webhooks, which are notifications Stripe sends about payments, refunds, subscriptions, and other events. It covers signature checks, duplicate prevention, background processing, and separate test and live secrets.

In plain words
What is it for?
Use it when a Rails app needs to update orders, subscriptions, invoices, or customer records after Stripe events.
Why use it?
It prevents forged or repeated payment updates and avoids making Stripe retry while Rails performs slow work.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when a Rails app needs to update orders, subscriptions, invoices, or customer records after Stripe events.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sandeepmvl/rails-skills/31-stripe-webhook-integration
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add sandeepmvl/rails-skills --skill 31-stripe-webhook-integration
Clone the repo
git clone --depth 1 https://github.com/sandeepmvl/rails-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for stripe-webhook-integration

README.md
[![agentmods](https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/31-stripe-webhook-integration/github.svg)](https://agentmods.dev/skills/sandeepmvl/rails-skills/31-stripe-webhook-integration)
Your own site
<a href="https://agentmods.dev/skills/sandeepmvl/rails-skills/31-stripe-webhook-integration"><img src="https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/31-stripe-webhook-integration/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for stripe-webhook-integration

Your own site · 80×15
<a href="https://agentmods.dev/skills/sandeepmvl/rails-skills/31-stripe-webhook-integration"><img src="https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/31-stripe-webhook-integration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,965 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00110 $0.01965
Opus 5 $0.00055 $0.00983
Sonnet 5 $0.00022 $0.00393
Haiku 4.5 $0.00011 $0.00197

Measured 11d ago against content hash 3d43d012fbac, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

stripe-webhook-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/31-stripe-webhook-integration/SKILL.md · 242 lines

How it starts

The opening of the file, as written. The whole thing — 242 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Stripe Webhook Integration

Stripe webhooks are the most common webhook integration in Rails. Get them right: signature + timestamp verification, idempotency by event.id, handle the events you actually need (not every event in the catalog), retry safely.

The opinion

Use Stripe::Webhook.construct_event — signature + timestamp covered in one call. Persist a WebhookEvent for idempotency. Enqueue a job for actual processing. Handle only the events your business needs; ignore the rest. Separate test-mode and live-mode webhook secrets.

The event types you actually handle

HANDLED_EVENTS = %w[
  payment_intent.succeeded
  payment_intent.payment_failed
  charge.refunded
  customer.subscription.created
  customer.subscription.updated
  customer.subscription.deleted
  invoice.payment_succeeded
  invoice.payment_failed
  customer.created
  checkout.session.completed
]

Everything else: log + skip. Don't reach for events you don't have a business action for.

Core patterns

Pattern 1: The controller

# app/controllers/webhooks/stripe_controller.rb
class Webhooks::StripeController < Webhooks::BaseController
  HANDLED_EVENTS = %w[
    payment_intent.succeeded payment_intent.payment_failed
    charge.refunded
    customer.subscription.created customer.subscription.updated customer.subscription.deleted
    invoice.payment_succeeded invoice.payment_failed
    checkout.session.completed
  ]

  def receive
    event = Stripe::Webhook.construct_event(
      raw_body,
      request.headers["Stripe-Signature"],
      Rails.application.credentials.stripe_webhook_secret
    )

    return head(:ok) unless HANDLED_EVENTS.include?(event.type)

    handle_idempotent(event.id, "stripe") do |webhook|
      webhook.update!(event_type: event.type, payload: event.to_hash)
      ProcessStripeEventJob.perform_later(webhook.id)
    end

    head(:ok)
  rescue Stripe::SignatureVerificationError
    head(:bad_request)
  rescue JSON::ParserError
    head(:bad_request)
  end
end

Read the full file on GitHub · 242 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 242 lines · 110 tokens per session scan A 3d43d012fbac

Subscribe to this mod's changes

stripe-webhook-integration is a skill published in the GitHub repository sandeepmvl/rails-skills (21 stars, last pushed 3mo ago), licensed MIT. It adds 110 tokens to every session and 1,965 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

convex-billing

Add Stripe billing/payments to the Convex app via @convex-dev/stripe (checkout + webhook + gating).

openclaw/clawhub · 29 tokens

cloudbase-wechat-integration

A guide for connecting CloudBase applications to WeChat services, including payments, official accounts, and user identity.

TencentCloudBase/CloudBase-AI-Toolkit · 94 tokens

commerce-app-business-config

Manage custom business configuration in an Adobe Commerce app. Use when the user wants to add, modify, or remove merchant-configurable settings (config fields, admin config, store configuration) exposed through Commerce Admin. Creates typed config fields (text, password, email, url, tel, boolean, list) in…

adobe/skills · 80 tokens

baselinker-webhooks

Receive BaseLinker (Base.com) webhooks. Use when building a BaseLinker order or warehouse callback receiver, because BaseLinker is not a normal webhook source: deliveries arrive as HTTP HEAD requests with NO body, the entire payload is in the query string (observed params: orderid, state), there is NO signature…

hookdeck/webhook-skills · 131 tokens

b2c-custom-job-steps

Create custom job steps for B2C Commerce batch processing. Use this skill whenever the user needs to write a batch job, data export script, scheduled cleanup task, or any server-side processing that runs on a schedule. Also use when they ask about steptypes.json, chunk-oriented vs task-oriented job steps…

SalesforceCommerceCloud/b2c-developer-tooling · 148 tokens

tiktok-shop-webhooks

Receive and verify TikTok Shop webhooks. Use when setting up TikTok Shop webhook handlers, debugging Authorization-header signature verification, or handling events like ORDERSTATUSCHANGE, PACKAGEUPDATE, RECIPIENTADDRESSUPDATE, PRODUCTSTATUSCHANGE, or SELLERDEAUTHORIZATION.

hookdeck/webhook-skills · 59 tokens