payment-testing
Skill1 starsChanged 2 months agoMITView on GitHub
Test checkout, charges, refunds and subscriptions without ever creating a real charge — provider sandboxes, the decline matrix, webhook idempotency, and the money invariants that must never break. Use when the change touches payment, billing, pricing, refunds, plans, or anything that moves an amount.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- jason0971/skillstheir own version, first seen Nov 8, 2026
- petrkindlmann/qa-skillstheir own version, first seen Oct 25, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- petrkindlmann/qa-skills★ 209same name
- jason0971/skills★ 1same 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 repository34 other files it gives its agents.
- a11y-auditSkill
- api-contract-testingSkill
- autonomous-explorationSkill
- bug-reproSkill
- chaos-resilienceSkill
- ci-wiringSkill
- contract-testing-pactSkill
- coverage-ratchetSkill
- database-testingSkill
- e2e-authoringSkill
- environment-paritySkill
- exploratory-chartersSkill
- false-positive-hunterSkill
- flake-forensicsSkill
- i18n-l10n-testingSkill
- load-and-stressSkill
- mutation-proofSkill
- never-break-prodSkill
- perf-budgetSkill
- qa-triageSkill
- regression-curationSkill
- release-gateSkill
- responsive-mobile-testingSkill
- risk-mapSkill
- root-cause-protocolSkill
- security-regressionSkill
- smoke-and-sanitySkill
- state-machine-testingSkill
- test-data-managementSkill
- test-strategySkill
- tracking-testingSkill
- transactional-email-testingSkill
- unit-test-authoringSkill
- visual-regressionSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
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
- Very specific: line 8
Every other defect costs trust.
- Distinctive: line 23
Test the failures, not the happy path — the happy path is the one everyone already checked:
- Distinctive: line 42
One payment, one charge: No path — retry, double-click, refresh, back button, duplicate webhook — produces two charges.
- Very specific: line 50
State machine is closed: Use state-machine-testing: pending → paid → refunded, and every invalid transition refused (approving a cancelled …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Payment Testing
Every other defect costs trust. This one costs money, twice: once to the customer and once to
whoever refunds it. Payment code is P0 by definition — risk-map never has to think about it.
Never test against live keys
sk_live_* in a test environment is an incident waiting for a CI run. Use the provider sandbox
(Stripe test mode, PagSeguro sandbox, Mercado Pago test users), seeded per environment, and make
the suite fail loudly if a live key is ever present:
expect(process.env.STRIPE_KEY, 'live key in a test run').toMatch(/^sk_test_/)The decline matrix
Test the failures, not the happy path — the happy path is the one everyone already checked:
| Case | Provider test card | The product must |
| Approved | 4242 4242 4242 4242 | create exactly one charge and one order |
| Generic decline | 4000 0000 0000 0002 | show why, keep the cart, allow retry |
| Insufficient funds | 4000 0000 0000 9995 | distinguish from a generic decline |
| Expired card | 4000 0000 0000 0069 | ask for a new card, not "try again later" |
| Wrong CVC | 4000 0000 0000 0127 | flag the field, not the whole form |
| Requires 3DS | 4000 0025 0000 3155 | complete the challenge, and handle abandoning it |
| Fraud block | 4100 0000 0000 0019 | fail closed, never create the order |
The abandoned-3DS path is the classic silent bug: the customer closes the challenge window and the product is left holding a pending order it never resolves.
Money invariants (assert these, always)
- Integer cents, never floats.
0.1 + 0.2 !== 0.3is a rounding bug with a refund attached. Assert the stored type as well as the value. - One payment, one charge. No path — retry, double-click, refresh, back button, duplicate webhook — produces two charges. Test the double-click explicitly; users double-click.
- Total = sum of parts. Items + shipping + tax − discount, asserted end to end, with a discount larger than the subtotal (must clamp to zero, never negative).
- Currency is never assumed. Amount and currency travel together; a BRL amount displayed as USD is a 5× error.
- Refund ≤ captured, partial refunds sum to no more than the charge, and a refunded order cannot be refunded again.
- State machine is closed. Use
state-machine-testing: pending → paid → refunded, and every invalid transition refused (approving a cancelled order, capturing twice).
Webhooks are the real risk
Providers retry. Networks duplicate. Order of delivery is not guaranteed.
- Same event id twice → one effect. This is the single most valuable payment test you can write.
- Signature verification: valid, tampered body, replayed timestamp, wrong secret → rejected.
- Out-of-order:
payment_succeededarriving beforecheckout_completed. - Unknown event type → 200 and ignored, never a 500 that makes the provider retry forever.
- The idempotency key is written in the same transaction as the effect, not after it.
Reconciliation
The strongest test in the whole area: after a batch of simulated activity, the sum of charges in your database equals the sum in the provider's. Run it nightly against sandbox data. It catches the class of bug no unit test sees — the one where your record and the money disagree.
Done means
The decline matrix run with output pasted, the duplicate-webhook test proven with mutation-proof,
and an explicit line saying no live key was in scope.
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.

