Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от petrkindlmann★ 317 звёзд на GitHub

Об этом скилле

Payment flows fail in ways generic E2E tests miss: a card field in a cross-origin iframe that `page.locator` silently never reaches, a renewal that won't trigger for a year, a webhook handler that "works" until Stripe retries and fulfills an order twice, an order marked paid on a redirect that the browser forged. This skill makes you test payments the way they actually break — against PSP sandboxes, with the real test cards, the nested 3DS challenge, server-side test clocks, signature-verified webhooks, and idempotent fulfillment. Never a real PAN, never a live key.

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

  1. 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.

  2. Money is confirmed server-side, never client-side. A redirect, an onApprove callback, or a ?status=success query param can be premature, replayed, or forged. Fulfill an order only after a signature-verified payment_intent.succeeded webhook, re-confirmed with an API retrieve.

  3. Verify the signature before you parse the body. Parsing JSON first destroys the raw bytes constructEvent needs. The webhook route gets the raw body; everything else can parse JSON.

  4. 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.

  5. Assume every webhook is delivered more than once. Stripe retries. Idempotency keyed on event.id in 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

Полный SKILL.md на GitHub

Установить payment-testing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/multi-psp.mdreferences/playwright-3ds.mdreferences/stripe-test-cards.mdreferences/webhooks-and-clocks.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить payment-testing с