agency-payments-billing-engineer

Implements idempotent payment flows, webhook handlers, and subscription billing for Stripe, Adyen, Braintree, and PayPal.

Updated Jul 14, 2026
One-click install
npx skills add https://github.com/AI-Staffing-Solution-Consultants-LLC/core-engineering-system --skill agency-payments-billing-engineer-ai-staffing-solution-consultants-llc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agency-payments-billing-engineer
Source: https://github.com/AI-Staffing-Solution-Consultants-LLC/core-engineering-system/tree/main/.agents/skills/engineering-payments-billing-engineer
Command: npx skills add https://github.com/AI-Staffing-Solution-Consultants-LLC/core-engineering-system --skill agency-payments-billing-engineer-ai-staffing-solution-consultants-llc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Payment integrations fail silently in expensive ways: duplicate charges from client retries, lost orders when customers close tabs before webhooks arrive, subscription states drifting out of sync, and ledgers that never match processor payouts. This Skill provides expert guidance for building payment systems where every money mutation is idempotent, auditable, and reconciled. ## Core Features & Use Cases - Idempotent Payment Flows: Designs charge, refund, and subscription mutations with business-derived idempotency keys so retries never double-charge customers. - Webhook Processing: Implements signature verification, event ID deduplication, and out-of-order-safe handlers that treat webhooks as the source of truth. - Subscription Lifecycle Management: Models trials, upgrades, proration, dunning, and cancellation as explicit state machines with defined transitions. - PCI Scope Reduction & Reconciliation: Guides SAQ A integration via hosted fields and tokenization, plus daily payout-to-ledger reconciliation queries. - Use Case: A SaaS team integrating Stripe asks for a payment flow review; the Skill produces an idempotent PaymentIntent creation pattern, a deduplicating webhook handler, a subscription state machine, and a reconciliation SQL query. ## Quick Start Ask the agent to design an idempotent Stripe checkout and webhook flow for your order system, including failure-path tests and a reconciliation query.

Frequently Asked Questions about agency-payments-billing-engineer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent duplicate charges when integrating Stripe payments?▼

Attach an idempotency key derived from the business operation, such as order ID plus payment attempt, to every PaymentIntent creation. This makes client retries, server retries, and double-clicks resolve to a single charge instead of multiple ones.

How should I handle Stripe webhooks to avoid processing events twice?▼

Verify the signature against the raw request body, then persist processed event IDs and skip duplicates since delivery is at-least-once. Re-fetch current object state from the API rather than trusting event order, and return 2xx quickly while queuing heavy work.

What is the difference between SAQ A and SAQ D PCI compliance?▼

SAQ A applies when card data never touches your servers, using hosted checkout pages or iframe fields like Stripe Elements. SAQ D is a full PCI DSS audit required when card data reaches your servers, which the Skill treats as a design failure to avoid.

How do I model subscription states like past_due and dunning retries?▼

Model the lifecycle as an explicit state machine: active moves to past_due on failed renewal, keeps access during a grace period, and retries on a smart dunning schedule. Exhausted retries transition to canceled, while successful retries restore active silently.

Why should payment amounts be stored as integers instead of floats?▼

Amounts should be integers in minor units, such as 4999 cents, paired with an ISO 4217 currency code, because floats introduce rounding errors in money math. Zero-decimal currencies like JPY must also be handled since they have no minor unit division.

How do I reconcile Stripe payouts against my internal ledger?▼

Run a daily query joining processor payouts to ledger entries by payout ID and alert on any nonzero drift between the payout amount and the summed ledger entries. Common break causes include fee timing, currency conversion, refund timing, and payout batching.