stripe-payments
Skill1 starsChanged 18 days agoMITView on GitHub
Take card and wallet payments with Stripe PaymentIntents or Checkout Sessions, idempotency keys, and signed webhooks that move the order to paid. Use when adding Stripe to a store, handling Stripe webhooks, or refunding through the Stripe API.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- peterbamuhigire/chwezi-dev-enginetheir own version, first seen Nov 15, 2026
- hewi333/Mom-n-Pop-Skillstheir own version, first seen Jun 30, 2026
- Ampli-Group/agentic-mobile-blueprinttheir own version, first seen May 11, 2026
- cohen-liel/hivemindtheir own version, first seen Mar 17, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- hewi333/Mom-n-Pop-Skills★ 121same name
- cohen-liel/hivemind★ 108same name
- peterbamuhigire/chwezi-dev-engine★ 31same name
- Ampli-Group/agentic-mobile-blueprint★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- b2b-pricingSkill
- catalog-import-and-migrationSkill
- checkout-ux-and-conversionSkill
- conversion-event-trackingSkill
- ecommerce-seo-structured-dataSkill
- fraud-and-risk-basicsSkill
- google-merchant-product-feedsSkill
- headless-nextjs-storefrontSkill
- inventory-and-multi-warehouseSkill
- iranian-payment-gatewaysSkill
- marketplace-search-and-rankingSkill
- mcp-store-toolingSkill
- multi-vendor-payoutsSkill
- order-and-webhook-reliabilitySkill
- payment-gateway-integrationSkill
- product-catalog-modelingSkill
- product-description-guardrailsSkill
- returns-and-refundsSkill
- rtl-and-persian-localizationSkill
- shopify-app-developmentSkill
- storefront-accessibilitySkill
- storefront-performanceSkill
- subscription-billingSkill
- tax-and-shippingSkill
- vector-product-searchSkill
- woocommerce-plugin-developmentSkill
- woocommerce-rest-apiSkill
- wordpress-plugin-securitySkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Create the shop order first, unpaid.
- Very specific: line 19
Put the shop order id in metadata (metadata[order_id]) and send an Idempotency-Key header derived from the order and attempt, such as …
- Distinctive: line 30
Read the raw body. A JSON parser that reformats the body breaks the signature.
- Very specific: line 32
Run node scripts/verify-stripe-signature.mjs <body-file> "<Stripe-Signature header>" with STRIPE_WEBHOOK_SECRET set to check a captured …
- Distinctive: line 58
Test-mode and live-mode keys, webhook secrets, and object ids are separate.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Stripe payments
This skill applies the general rules in the payment gateway skill to Stripe. Event names, objects, and status values are in the Stripe objects notes.
Procedure
- Pick one integration per checkout. A Checkout Session is a Stripe-hosted page. A PaymentIntent with the Payment Element keeps the shopper on your page. Both keep card data on Stripe.
- Create the shop order first, unpaid. Then create the PaymentIntent or Checkout Session on the server with the amount from the order, never from the browser.
- Put the shop order id in
metadata(metadata[order_id]) and send anIdempotency-Keyheader derived from the order and attempt, such asorder-1042-attempt-1. - Return only the
client_secret(PaymentIntent) or the sessionurl(Checkout) to the browser. The secret keysk_...stays on the server. - Mark the order paid from a verified webhook:
payment_intent.succeededfor PaymentIntents, orcheckout.session.completedwithpayment_statusequal topaidfor Checkout. - Pin the API version for the account and the webhook endpoint, so a dashboard upgrade does not change payloads under you.
Amounts
Stripe amounts are integers in the currency's smallest unit: 1999 is 19.99 USD. Zero-decimal currencies such as JPY are sent as the whole amount: 500 is 500 JPY. Compute the integer from the order total with the currency's exponent and compare the webhook's amount_received and currency with the order before marking it paid.
Webhooks
- Read the raw body. A JSON parser that reformats the body breaks the signature.
- Verify the
Stripe-Signatureheader with the endpoint secretwhsec_.... The header has a timestamptand one or morev1signatures. The signed payload ist, a dot, and the raw body, hashed with HMAC-SHA256 and hex encoded. Reject timestamps older than the tolerance, 300 seconds by default. - Run
node scripts/verify-stripe-signature.mjs <body-file> "<Stripe-Signature header>"withSTRIPE_WEBHOOK_SECRETset to check a captured delivery. - Store
event.idin a table with a unique constraint before acting. Stripe can send the same event more than once, and out of order. - Return
2xxquickly after storing the event, then do slow work in a job. - For events where order matters, retrieve the object (
GET /v1/payment_intents/{id}) and act on its current status instead of the event's snapshot.
Status
PaymentIntent status | Shop effect |
requires_payment_method | Unpaid. After a decline, the shopper can try again with the same intent. |
requires_action | Unpaid. The shopper must finish 3-D Secure or a redirect. |
processing | On hold. Bank debits and some wallets settle later. |
requires_capture | Authorized only. Capture before the authorization expires, or release it. |
succeeded | Paid. Store the latest charge id. |
canceled | Cancel the order only if it is still unpaid. |
Refunds and disputes
- Refund with
POST /v1/refundsandpayment_intent, plusamountfor a partial refund. Send an idempotency key per refund attempt and store the refund id. - A refund can stay
pendingand can later fail. Update the shop refund fromrefund.updatedorcharge.refund.updated, not from the create response alone. charge.dispute.createdopens a dispute. Flag the order and collect evidence. Do not refund automatically, because a refund does not close a dispute.
Gotchas
- Creating a new PaymentIntent on every checkout page load leaves many incomplete intents and can charge twice if two are confirmed. Reuse the intent stored on the order.
- Marking the order paid on the
return_urlpage is wrong. The redirect arrives before, after, or without the webhook. - Test-mode and live-mode keys, webhook secrets, and object ids are separate. A live event never verifies with the test secret.
- A
v1signature compare with==leaks timing. Use a constant-time compare. - Idempotency keys are kept for at least 24 hours. Reusing a key with different parameters returns an error, not a new payment.
Verification
- A forged webhook, or a real one older than five minutes, is rejected with
400. - Delivering the same
payment_intent.succeededevent twice sends one receipt and reduces stock once. - A
payment_intent.succeededwhoseamount_receiveddiffers from the order total leaves the order unpaid and flags it. - A Checkout Session with
payment_statusunpaid(a delayed bank method) does not mark the order paid untilcheckout.session.async_payment_succeeded. - A partial refund through
POST /v1/refundsleaves the order paid for the remainder.
Evaluation
Worked examples and the checks they must satisfy are in evals/tasks.json.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

