Wraps the vendor-generic payment-gateway sandbox pattern - test credentials, sandbox base URLs / environment switches, deterministic test-card matrices, and gateway-native webhook simulators - with per-gateway references for Adyen test mode, PayPal Sandbox, and Braintree sandbox. Use when testing code integrated with Adyen, PayPal, or Braintree; for Stripe use stripe-test-cards-and-webhooks (one-time payments) or stripe-subscription-billing-test-author (recurring billing).
72
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Medium
Suggest reviewing before use
Every major payment gateway ships the same four sandbox primitives, each under a different name:
environment
flag that routes calls to the test stack.This skill is the single entry point for the non-Stripe gateways. The body covers the shared pattern; the per-gateway mechanics live in references/.
| Gateway | Reference | Distinctive sandbox trait |
|---|---|---|
| Adyen | references/adyen.md | Explicit sync-API / async-notification duality; HMAC-validated notifications |
| PayPal | references/paypal.md | Sandbox Business + Personal accounts; dashboard + API webhook simulator |
| Braintree | references/braintree.md | Amount-based magic values; sandbox-only gateway.testing.settle |
| Stripe | stripe-test-cards-and-webhooks | Stripe CLI (stripe listen / stripe trigger); test clocks in stripe-subscription-billing-test-author |
Regardless of gateway, a payment integration suite has the same skeleton:
bt_signature
parsing for Braintree); the suite must reject unsigned and wrong-secret
payloads.payment-flow-test-author.payment-flow-states-reference before
asserting on states.Sandbox credentials are secrets like any other:
jobs:
gateway-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
- run: npm ci && npm test
env:
ADYEN_TEST_API_KEY: ${{ secrets.ADYEN_TEST_API_KEY }}
PAYPAL_SANDBOX_CLIENT_ID: ${{ secrets.PAYPAL_SANDBOX_CLIENT_ID }}
BT_SANDBOX_MERCHANT_ID: ${{ secrets.BT_SANDBOX_MERCHANT_ID }}Per-gateway variable lists are in each reference.
| Anti-pattern | Why it fails | Fix |
|---|---|---|
| Prod credentials in tests | Real settlement / real charges | Sandbox-only keys, per-env config |
| Skip webhook signature validation | Spoofed events trigger fulfillment | Verify per the gateway's scheme |
| Treat the sync API return as final | All three gateways finalize async | Webhook-driven state, per payment-flow-states-reference |
| One happy-path test | Decline / 3DS / fraud paths untested | One test per documented outcome row |
| Hardcoded merchant/account IDs | Per-env accounts drift | Env vars |
| One suite for all gateways | Result-code vocabularies differ | Per-gateway test directory |
payment-flow-states-reference (state machines + 3DS
flows).payment-flow-test-author.stripe-test-cards-and-webhooks,
stripe-subscription-billing-test-author.