agentleFS
irahardiantoirahardianto/awesome-agv/.agents/skills/payment-integration/SKILL.md

payment-integration

Skill157 starsChanged 3 months agoMITView on GitHub

PCI DSS compliance, payment gateway integration, tokenization, webhook reliability, idempotency, fraud prevention, and subscription billing.

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use mobile-development, planning and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • truongtv22Skill

    mobile-development

    Build modern mobile applications with React Native, Flutter, Swift/SwiftUI, and Kotlin/Jetpack Compose. Covers mobile-first design principles, performance optimization (battery, memory, network), offline-first architecture, platform-specific guidelines (iOS HIG, Material Design), testing strategies, security best practices, accessibility, app store deployment, and mobile development mindset. Use when building mobile apps, implementing mobile UX patterns, optimizing for mobile constraints, or making native vs cross-platform decisions.

    Also in 3 projects that use this

  • AWSSkill

    planning

    Discovers user intent and generates a structured, step-by-step plan for model customization workflows. This skill must always be activated alongside any other skill when the user's request relates to model customization — including fine-tuning, training, building, customizing, reviewing data, or getting advice on approach, regardless of domain. Do not skip this skill even if the immediate ask is narrow (e.g., reviewing data format or a single workflow step), because planning discovers the full scope of work needed. Also activate when the user wants to resume, continue, or modify an existing plan.

    Also in 3 projects that use this

  • DockerSkill

    research

    Research a documentation topic — locate affected files, understand the problem, identify what to change. Use when investigating an issue, a question, or a topic before writing a fix. Triggers on: "research issue 1234", "investigate what needs changing for #500", "what files are affected by #200", "where is X documented", "is our docs page about Y accurate", "look into how we document Z".

    Also in 3 projects that use this

The file

Files
SKILL.md

Payment Integration Principles

Guidelines for building secure, compliant payment systems.

When to Invoke

  • Integrating payment gateways (Stripe, Adyen, etc.)
  • PCI compliance requirements
  • Subscription/billing system design
  • Fraud prevention implementation

Security (Non-Negotiable)

PCI DSS Compliance

  1. Never store raw card data — use tokenization via gateway.
  2. Never log payment credentials — mask card numbers, CVV never stored.
  3. TLS everywhere — all payment communication over HTTPS.
  4. Minimal data retention — store only what's legally required.

Tokenization Flow

User → Client-side SDK (Stripe.js/Elements) → Gateway tokenizes → Token to your server → Server charges via token

Your server never sees raw card data.

Transaction Patterns

Idempotency (Critical)

POST /api/payments
Idempotency-Key: unique-request-id-abc123

→ Gateway processes once, returns same result on retry
  • Generate idempotency key client-side or server-side
  • Store key → result mapping for deduplication
  • Retry-safe — network failures don't cause double charges

Authorization Flow

Authorize → Capture → Settle
         → Void (cancel before capture)
         → Refund (after capture)

Webhook Handling

  1. Verify webhook signatures — never trust unverified payloads.
  2. Idempotent processing — webhooks may be delivered multiple times.
  3. Queue webhooks — process asynchronously, acknowledge immediately (200 OK).
  4. Handle out-of-order delivery — use event timestamps, not arrival order.

Subscription Billing

Lifecycle

Trial → Active → Past Due (dunning) → Cancelled/Expired
              → Upgraded/Downgraded (proration)

Dunning Management

  • Retry failed payments (exponential backoff: day 1, 3, 7, 14)
  • Notify user before and after each retry
  • Grace period before cancellation

Fraud Prevention

  1. 3D Secure (SCA) for European payments (PSD2 requirement).
  2. Address Verification (AVS) — match billing address.
  3. Velocity checks — rate-limit transactions per user/IP.
  4. Risk scoring — use gateway's built-in fraud tools.

Testing

For universal testing principles, see .agents/rules/testing-strategy.md. Below: language-specific patterns only.

  1. Sandbox/test mode for all development — never test with real cards.
  2. Test card numbers — cover success, decline, 3DS, and error scenarios.
  3. Webhook testing — use gateway's webhook testing tools or local tunnels.

Related

  • Security Principles .agents/rules/security-principles.md
  • API Design Principles @.agents/rules/api-design-principles.md
  • Error Handling Principles .agents/rules/error-handling-principles.md

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.