payment-testing
БесплатноБез исполняемых скриптовНе проверенTest payment and checkout flows end to end against PSP sandboxes — Stripe first, with the general pattern for Adyen/Braintree/PayPal. Covers Stripe test-mode…
от petrkindlmann★ 317 звёзд на GitHubОб этом скилле
Quick Route
| You need to test… | Go to | Reference |
|---|---|---|
| Success / decline / insufficient-funds outcomes | Test cards | references/stripe-test-cards.md |
| A 3DS/SCA challenge that pops a modal | 3DS challenge | references/playwright-3ds.md |
| A subscription renewal months/years out | Test clocks | references/webhooks-and-clocks.md |
| Webhooks reaching localhost + signatures | Webhooks | references/webhooks-and-clocks.md |
| A non-Stripe or in-house webhook protocol | Webhooks, "Another provider" | the provider's or your contract's docs |
| A failed renewal then a refund | Failed payments | references/webhooks-and-clocks.md |
| Fulfillment only after real payment | Reconciliation | references/webhooks-and-clocks.md |
| Adyen / PayPal / Braintree sandboxes | Multi-PSP | references/multi-psp.md |
Discovery Questions
First, check .agents/qa-project-context.md in the project root and skip anything it
already answers (PSP, stack, test framework, existing fixtures). Then clarify:
- Which PSP, and is it Stripe? Stripe is the default here. Other PSPs share the pattern but have their own sandbox cards/accounts — see Multi-PSP.
- One-time payments, subscriptions, or both? Subscriptions pull in test clocks, dunning,
and the
invoice.*lifecycle; one-time payments don't. - Is SCA/3DS in play? EU/UK card flows almost always challenge. If yes you need the nested-iframe pattern, not plain locators.
- Do you fulfill on a webhook or on the redirect today? If fulfillment happens on
return_url, that's the bug to test for — fulfillment must wait for the verified webhook. - Where does the webhook handler run in tests? Local (
stripe listen) vs a deployed preview env changes how you deliver events.
Core Principles
Never touch a real card or a live key — and this is non-negotiable, not a preference. Real PANs in any environment violate Stripe's Services Agreement and drag your repo into PCI scope. Test mode (
pk_test_/sk_test_) with Stripe's published test cards is the only correct answer. Masking or encrypting a real number does not fix it; removing it does.Money is confirmed server-side, never client-side. A redirect, an
onApprovecallback, or a?status=successquery param can be premature, replayed, or forged. Fulfill an order only after a signature-verifiedpayment_intent.succeededwebhook, re-confirmed with an APIretrieve.Verify the signature before you parse the body. Parsing JSON first destroys the raw bytes
constructEventneeds. The webhook route gets the raw body; everything else can parse JSON.Time is a server-side construct for billing. Stripe's billing engine runs on Stripe's servers. Faking the clock in your test process changes nothing. Use test clocks.
Assume every webhook is delivered more than once. Stripe retries. Idempotency keyed on
event.idin durable storage is mandatory; an in-memory set is not idempotency.
Stripe Test Cards and Outcomes
Drive each outcome with the card that deterministically produces it. The four you need most:
| PAN | Outcome | Code |
|---|---|---|
4242424242424242 |
Succeeds | — |
4000000000000002 |
Declined | card_declined (generic_decline) |
4000000000009995 |
Declined | insufficient_funds |
4000000000003220 |
3DS always challenges | — |
4000000000000341 |
Attaches, then fails on charge | card_declined |
Use test keys (pk_test_…/sk_test_…) in the app under test and assert that in setup.
Do not use 4111111111111111 — that is a generic Braintree/PayPal-era Luhn number,
not a Stripe test card, and it does not deterministically decline.
The card field is in a cross-origin Stripe iframe, so fill it through frameLocator, never
page.locator directly. Assert outcomes on UI copy for a smoke test, or more robustly on
the server-side last_payment_error.decline_code from
Установить payment-testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл payment-testing?
Test payment and checkout flows end to end against PSP sandboxes — Stripe first, with the general pattern for Adyen/Braintree/PayPal. Covers Stripe test-mode card numbers and their decline codes, the 3DS/SCA challenge flow and its nested-iframe handling in Playwright, test clocks for subscription/billing-cycle simulation, webhook testing (stripe listen/trigger, signature verification, idempotency), failed/retried payments and refunds, and never using real cards. Use when: "test Stripe checkout," "payment test," "3DS test," "test webhook signature," "test subscription renewal," "test clock," "refund test," "decline card test," "checkout E2E." Not for: General API contract testing of non-payment endpoints — api-testing. PCI-DSS/regulatory compliance audit — compliance-testing. Related: api-testing, playwright-automation, compliance-testing, test-data-management, qa-project-context.
Как установить скилл payment-testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл payment-testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic