Works with the AI Agents you already use

    Payment & Ledger Code Review: stop money bugs

    by Rubbaite T. Hassain

    1

    Review payment, wallet and ledger code for double charges, float rounding, missing idempotency keys, unverified webhooks and broken double-entry, with a fix and a test for every issue.

    Free

    Security scanned
    Payment & Ledger Code Review: stop money bugs

    Payment & Ledger Code Review: stop money bugs

    Example session with this skill installed

    Review our checkout and wallet code before launch. We use Stripe and a Postgres ledger. Find anything that could double-charge or lose money.

    • Read your context and instructions
    • Compiled the payment & ledger

    Summary

    Scanned 4 files:

    9 high, 3 medium, 1 low. Two issues can charge a customer twice or accept a forged payment today; fix those before launch.

    High findings

    LocationIssueImpactFix
    checkout.py:6PaymentIntent.create with no idempotency keyA network retry or double-click creates a second chargeidempotency_key=f"order-{order.id}-attempt-{attempt}"
    webhook.js:1Webhook handler never verifies the Stripe signatureAnyone can POST a fake payment_intent.succeeded and get goods freestripe.webhooks.constructEvent(rawBody, sig, secret) on the raw body
    webhook.js:5Signature compared with ===Timing side channelcrypto.timingSafeEqual
    checkout.py:4, webhook.js:6Amount converted to floatCents lost or gained in conversionDecimal(str) / integer minor units
    Wallet.cs:2-3Balance and amount are doubleRounding drift in wallet balancesdecimal or long minor units
    schema.sql:1amount FLOAT columnInexact stored amountsNUMERIC(19,4) or BIGINT minor units
    schema.sql:3DELETE FROM ledger_entriesAudit trail destroyed; balances cannot be rebuiltPost a reversing entry instead

    Fix example

    from decimal import Decimal, ROUND_HALF_UP
    total = (Decimal(order["amount"]) * Decimal("1.2")).quantize(Decimal("0.01"), rounding=ROUND_HALF_UP)
    stripe.PaymentIntent.create(amount=to_minor(total, "USD"), currency="usd",
                                idempotency_key=f"order-{order['id']}-attempt-{attempt_id}")
    

    Tests to add

    1. Same checkout request twice: one charge.
    2. Same webhook event twice: one ledger transaction.
    3. Two concurrent debits on one wallet: balance never negative.
    4. JPY (0 decimals) and KWD (3 decimals) amounts.

    Medium and low

    round(total * 100) (float rounding, hard-coded x100), toFixed(2) on a float, and SET balance = balance - 500 outside a visible ledger transaction: confirm it runs with a row lock in the same transaction as the entry.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Money bugs rarely crash. They double-charge on retry, lose cents in rounding, let two requests spend the same balance, or mark an order paid from an unverified webhook. This skill makes your agent review payment code the way a fintech architect would.

    What it does

    • Scanner for Python, JS/TS, C#, Java/Kotlin, Go, PHP, Ruby and SQL: money in floats, float rounding, hard-coded x100 minor units, payment API calls without idempotency keys, webhooks without signature checks, signatures compared with ==, ledger rows updated or deleted.
    • Guided trace of each money flow: retries and timeouts, concurrent debits, debits = credits, rounding and allocation, webhook ordering and replays.
    • 10-section checklist: money representation, double-entry, idempotency, concurrency, webhooks, refunds and disputes, FX, reconciliation, PCI scope, tests.
    • Report with the scenario that triggers each bug, its impact, a code fix and the test to add.

    How it works

    1. Scope the providers (Stripe, Adyen, PayPal, bank APIs) and flows.
    2. Run the bundled scanner (standard-library Python, no network calls) and confirm each hit in context.
    3. Trace the money flows by hand with the checklist.
    4. Write payment-review.md with fixes, tests to add and checklist results.

    Read-only: it never calls payment providers, moves money or changes data.

    What's included

    SKILL.md, scripts/money_lint.py, a 10-section ledger review checklist, and bad and good code samples.

    Known limitations

    • Pattern matching finds common mistakes, not logic errors; the manual trace is the core of the review.
    • Engineering review only, not a PCI DSS assessment or accounting advice.

    Built by the founder of Datazo InfoTech, which builds payment and banking platforms.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 8 days ago

    • Free with an Agensi account

    Software
    Python 3.9+

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Environment Variables
    Listed8 days ago

    What's inside

    Frequently Asked Questions

    No. It reads code only. It never calls payment providers, runs payment code or changes data.

    Linters do not know money. This checks money-specific failure modes (floats, rounding, idempotency, webhook verification, ledger immutability) and then traces each flow for retries, concurrency and double-entry balance.

    The scanner reads Python, JavaScript/TypeScript, C#, Java/Kotlin, Go, PHP, Ruby and SQL, and recognises Stripe, PayPal, Adyen, Razorpay, Square, Braintree, Mollie, Paddle, GoCardless and others. The checklist applies to any provider or bank API.

    SKILL.md with the review workflow, scripts/money_lint.py (standard-library Python, Markdown and JSON output), a 10-section ledger review checklist, and bad and good code samples. MIT licence, free.

    Some. The agent opens each hit, confirms it in context and explains anything it drops.

    New in Finance & Accounting

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Finance & Accounting.

    Free