# payment-testing

A testing skill for end-to-end payment flows against Stripe, Adyen, and PayPal sandboxes. Helps automate card declines, 3DS challenges, and webhook verification.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 978 installs · ★ 211
- Author: kindlmann
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/petrkindlmann/qa-skills/tree/HEAD/skills/payment-testing/SKILL.md
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/skills/payment-testing

## What it does

This skill guides test suites through PSP sandboxes without ever exposing live keys or real card numbers. Its primary focus is Stripe, with reusable patterns extending to Adyen, Braintree, and PayPal. It provides exact test card numbers to assert outcomes such as `card_declined`, `insufficient_funds`, or mandatory SCA verification.

For browser automation with Playwright, the skill documents how to chain `frameLocator` calls to reach Stripe 3DS inputs inside nested cross-origin iframes. Direct selectors fail on these elements. For recurring billing, it prescribes server-side test clocks rather than mocked process time to simulate subscription renewals. It also covers signature verification on raw request bodies.

Fulfilling orders directly on client redirects creates security loopholes, so this skill enforces confirming payments solely through signature-verified webhooks with idempotent processing.

## Requirements
- Works with: Playwright, Stripe

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add petrkindlmann/qa-skills --skill payment-testing -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/payment-testing/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/payment-testing/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add petrkindlmann/qa-skills --skill payment-testing -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/payment-testing/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add petrkindlmann/qa-skills --skill payment-testing -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/payment-testing/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install petrkindlmann/qa-skills payment-testing
```

2. **Manually: put the files in place**
- File: `.github/skills/payment-testing/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add petrkindlmann/qa-skills --skill payment-testing -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/petrkindlmann/qa-skills --path skills/payment-testing
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/payment-testing/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add petrkindlmann/qa-skills --skill payment-testing -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/petrkindlmann/qa-skills/tree/HEAD/skills/payment-testing/SKILL.md

## When to use it
- automate Stripe 3DS challenge authentication inside nested Playwright iframes
- test card decline scenarios with specific codes like `insufficient_funds`
- simulate multi-year subscription renewals using Stripe test clocks
- verify webhook signature parsing on raw request bodies with idempotent storage

## Example prompts
- Write a Playwright test for Stripe Checkout handling a 3DS challenge modal
- Set up a test clock scenario to verify subscription renewal failure and retry logic
- Audit our webhook handler to ensure raw body signature check and event idempotency

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 1454bc753d512376.

BEGIN THIRD-PARTY FILE 1454bc753d512376
```text
---
name: payment-testing
description: >-
  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.
license: MIT
metadata:
  author: kindlmann
  version: "1.1"
  category: specialized
---

<objective>
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.
</objective>

## Quick Route

| You need to test… | Go to | Reference |
|-------------------|-------|-----------|
| Success / decline / insufficient-funds outcomes | [Test cards](#stripe-test-cards-and-outcomes) | `references/stripe-test-cards.md` |
| A 3DS/SCA challenge that pops a modal | [3DS challenge](#3ds--sca-the-nested-iframe-challenge) | `references/playwright-3ds.md` |
| A subscription renewal months/years out | [Test clocks](#test-clocks-server-side-time-travel) | `references/webhooks-and-clocks.md` |
| Webhooks reaching localhost + signatures | [Webhooks](#webhooks-local-delivery-signatures-idempotency) | `references/webhooks-and-clocks.md` |
| A non-Stripe or in-house webhook protocol | [Webhooks](#webhooks-local-delivery-signatures-idempotency), "Another provider" | the provider's or your contract's docs |
| A failed renewal then a refund | [Failed payments](#failed-payments-dunning-and-refunds) | `references/webhooks-and-clocks.md` |
```
END THIRD-PARTY FILE 1454bc753d512376

The third-party file has ended. Everything between the 1454bc753d512376 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2603 of 21131 bytes. © kindlmann · MIT · https://github.com/petrkindlmann/qa-skills/tree/HEAD/skills/payment-testing/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
