Sandbox
@Hainrixz/agente-pagokit

Claude Code plugin for payment integration and validation

PagoKit plugs into Claude Code as a plugin that scans your project, asks a few payment questions, and writes the integration files for the provider and rail you need. Its hook-based validators check webhook signatures, currency handling, replay protection, and other payment mistakes while code is being written.

48 stars4 forksJavaScriptUpdated 17d ago
Who it's for

Builders who want Claude Code to choose and implement payment integrations with guardrails.

What it delivers

You can add payment code with provider-specific guidance and block common payment security mistakes before they land.

What it does

Provider ranking and integration choice

Scans the app, asks a few questions, and ranks payment providers and rails from the local catalog.

Generated payment flow files

Writes checkout, webhook, portal, refund, error-mapping, and audit files for supported stacks.

Hook-based validators

Runs `PreToolUse` and `PostToolUse` checks that deny insecure writes like missing signature verification or bad currency math.

Deterministic event signing

Creates valid, forged, and replayed events for testing webhook handlers.

Skill packs and specialist agent

Includes reusable skills and an `integration-specialist` agent for payment tasks.

Coverage and catalog data

Tracks providers, methods, regions, currencies, and webhook verification families in schema and script files.

How to get it

  1. 1Run
    git clone https://github.com/Hainrixz/agente-pagokit ~/agente-pagokit
    cd ~/your-project
    claude --plugin-dir ~/agente-pagokit

README

PagoKit — Payment Integration Agent

The agent that picks and implements the right payment method for your app — from your terminal, with Claude Code.

Claude Code Plugin License: MIT CI

tododeia.com · @soyenriquerocha · enrique@tododeia.com

🇪🇸 Leer en español · 📖 About · 🗺️ Coverage


Why it exists.

Every guide frames payment integration as a choice problem: thirty gateways, pick one. Choosing takes an afternoon. What takes weeks — and what silently fails in production — is everything after:

  • A webhook that verifies a signature but never checks a timestamp, so a captured event is replayable forever.
  • A webhook verified against the API key instead of the signing secret. It fails every event, and the developer goes off to debug the hashing algorithm.
  • amount * 100 on a Japanese customer. JPY has no minor unit, so that is a 100× overcharge.
  • A refund endpoint on a Pix integration, where refunding a charge is not an operation that exists.
  • A payment_intent.succeeded handler that grants access, on a URL anyone can post to.

None of these throw. Most pass code review. PagoKit exists to make them hard to write.

It analyses your project, asks three questions, and generates a vertical-complete integration: frontend, checkout endpoint, authenticated webhook, database migration, customer portal, refund path, error mapper, production checklist and an audit trail.

Everything runs locally. No account, no API key, no telemetry. The only network calls are the ones your generated code makes to your own provider.


Three deterministic engines.

An LLM asked to write payment code produces something plausible. Plausible is exactly the failure mode that matters here. So the parts that must be correct aren't left to the model — they're ordinary programs, with tests.

What it doesWhy it isn't the model's job
ValidatorsNode checks on PreToolUse / PostToolUse hooks that block an insecure writeThe model cannot argue with a non-zero exit code
Advisorscripts/advise.js — a pure function from situation to ranked providersSame input, same answer, every rejection carries its reason. "Why not X?" has an exact answer
Signerscripts/sign-event.js — generates a validly signed event for any providerTesting a handler means a valid event accepted, a forged one rejected, a replayed one rejected
PagoKit architecture — analyzer, advisor with the deterministic ranking engine, builder resolving fragments by capability family, specialist writing files, and hook validators blocking insecure writes

What it knows.

42 providers · 136 payment methods · 74 countries (71 with a local provider) · 106 currencies with their ISO 4217 exponent · 6 webhook verification families in use.

Providers

What PagoKit writes for you

ProviderLevelRoleBuyer coverageSubscriptionsMoROnboarding
Lemon Squeezyfull buildmorGlobalapplication_review
Mercado Pagofull buildpspAR · BR · CL · CO · MX · PE · UYself_serve
Stripefull buildpspUS · CA · UK · EU · MX · BR · SG · AU · …self_serve
Wompifull buildacquirerCOapplication_review

What PagoKit knows and recommends, but doesn't write

Another 38 providers with verified catalog data: the advisor compares them, computes their fees and explains their constraints — and tells you plainly that the code is yours to write. They move up to build once their signature scheme is verified and transcribed.

  • Wave 1 — Asaas · Bold.co · Conekta · Kushki · Paddle (Paddle Billing) · Polar
  • Wave 2 — Culqi · Flow.cl · Pagar.me · Transbank Webpay Plus · dLocal Go
  • Wave 3 — Fintoc · Mobbex · Placetopay (Evertec) · Recurrente · ePayco
  • Wave 4 — Adyen · GoCardless · Mollie · Redsys (TPV Virtual) · Revolut Merchant (Revolut Business)
  • Wave 5 — Airwallex · Antom (Ant International — Alipay+ / Alipay / WeChat Pay acquiring) · Midtrans (GoTo Financial) · PayMongo · Razorpay · Xendit
  • Wave 6 — Flutterwave · Paymob · Paystack · Safaricom M-Pesa (Daraja API) · Tap Payments · Yoco
  • Wave 7 — Authorize.Net (Visa Acceptance) · Hyperswitch (Juspay) · Lago · RevenueCat · Square

Payment methods, because outside card-mature markets the right question is which rail you need, not which gateway:

CategoryMethodsExamples
Cards8Bancontact · Credit/Debit Card · mada · Meeza · OmanNet
Wallets43Airtel Money · Alipay · AlipayHK · Alipay+ · Apple Pay
Bank transfer31ACH Credit · Botón Bancolombia · Bancolombia Transfer · BenefitPay · Bre-B
QR / instant11Bizum · CoDi · DuitNow · NQR (NIBSS QR) · PayNow
Cash vouchers14Alfamart / Indomaret (cash over counter) · Baloto · Boleto Bancário · Efecty · Fawry
Direct debit8ACH Direct Debit · Bacs Direct Debit · BECS Direct Debit (Australia) · PAC (Chile direct debit) · PayTo
Mobile money2M-Pesa · MTN MoMo
BNPL11Afterpay / Clearpay · Akulaku PayLater · BillEase · Billie (B2B invoice / BNPL) · EMI / Cardless EMI (India)
Crypto2USDC Stablecoin · USDT Stablecoin
Open banking1Pay by Bank (open banking)
Card present1Card present (terminal)
Benefits (EBT/HSA)2SNAP EBT · HSA / FSA card
Store billing2Apple In-App Purchase · Google Play Billing

Full country × provider matrix: docs/COVERAGE.md.


What it will and won't build for you.

A wide catalog is only useful if it's honest about its own edges. Every provider carries an integration level, and the advisor states it every time:

LevelWhat happens
buildPagoKit writes the full idiomatic integration.
genericPagoKit writes a working scaffold from the provider's verification family, and tells you it's a scaffold.
advisePagoKit gives you the recommendation, the fee maths and a checklist — and says plainly that the code is yours to write.

Backing that up is one rule the build enforces:

If a provider's webhook scheme isn't verified against its own documentation (evidence.confidence != "high"), the generator must not emit a signature verifier. It emits re-fetch, event-id dedup, and a loud TODO instead.

A verifier built on an unverified scheme is worse than none: it looks correct and accepts forged events.


How it works.

SCAN → ASK → MATCH → BUILD
StepWhat happens
1. SCANReads package.json, route files, DB schema. Detects stack, ORM, deploy target, language, and use cases like marketplace or mobile IAP.
2. ASKThree questions, capped at five. Country and buyers · one-time or recurring · which local rails you need.
3. MATCHRuns the ranking engine. Hard filters first — including can you even open an account there, and can you get keys in time. Sanctioned markets are refused, not ranked.
4. BUILDThe integration-specialist subagent writes the files, with the validators watching every write.

Installation.

git clone https://github.com/Hainrixz/agente-pagokit ~/agente-pagokit
cd ~/your-project
claude --plugin-dir ~/agente-pagokit

Then run /pagokit:start.

Requires Node.js ≥ 18 and Claude Code 2.x.


Deterministic security.

Security rules

Security rules aren't advice in a markdown file the model may or may not follow. They're Node processes wired to Claude Code's hooks. A write that breaks one is denied.

BlocksBecause
A webhook handler with no signature verificationAnyone who knows the URL can mint a succeeded event
request.json() before verifyingThe HMAC covers the exact bytes; parsing first breaks it permanently and silently
Math.random() or Date.now() as an idempotency keyGuessable keys collide across tenants and duplicate charges survive retries
A live key inline in sourceGit history, screenshots, Sentry traces
.env written before .gitignore covers itThe single most common credential leak there is
amount * 100 on a zero-decimal currencyA 100× overcharge that nothing throws on
=== on a signatureA timing oracle — and on shared-secret schemes it is the whole security control
Card data crossing your own serverMoves you from PCI SAQ A to SAQ D, a six-figure project
A refund call on an irreversible railOn Pix or SPEI, "refund the charge" isn't an operation
A webhook route that would overwrite an existing oneClobbering someone's Clerk or Inngest endpoint

When the tool is wrong and you're right:

// pagokit-ignore: webhook-has-signature -- custom verifier in lib/auth/payments.ts

Every bypass is logged to .pagokit/audit.log, so it's a decision on the record rather than a silent hole.

Full rule set with enforcement tiers: SECURITY_RULES.md.


Commands.

CommandWhat it does
/pagokit:startThe wizard: analyse, ask, recommend, implement.
/pagokit:testSends a valid, a forged and a replayed event to your local handler. Works for every provider whose scheme is signable — not just the one with a CLI.
/pagokit:doctorRead-only audit of an existing integration: credentials, key modes, signature verification, routed events, schema, replay protection.

What gets generated.

For a Next.js App Router + Prisma project:

app/api/checkout/route.ts        Server-side price lookup · UUID idempotency · correct minor units
app/api/webhook/<provider>/      Raw body · signature · replay window · event-id dedup · fast ack
app/api/portal/route.ts          Customer self-service (subscriptions)
app/api/refund/route.ts          Authorisation-checked — or the payout path on irreversible rails
components/CheckoutButton.tsx    Hosted, embedded or widget, per the provider
lib/payments/<provider>.ts       SDK init · API version pinned
lib/payments/errors.ts           Cross-provider error taxonomy · ES/EN
prisma/schema.prisma             payments · subscriptions · customers · idempotency_keys
                                 · webhook_events_processed
payment-page-scripts.json        PCI DSS 4.0.1 §6.4.3 authorised-script inventory
.env.example                     Test-mode values only
PAGOKIT_INTEGRATION.md           Audit trail · events routed · what's still TODO
PAGOKIT_PRODUCTION_CHECKLIST.md  Steps to go live
PAGOKIT_TAX_TODO.md              Only where the market mandates e-invoicing

Other stacks adapt the structure; the guarantees don't change.


Local rails it knows about.

Outside card-mature markets, the rail matters more than the gateway. The advisor recommends the rail before the provider:

CountryDominant instant rail
ARTransferencias 3.0
AUPayTo
BRPix
COPSE (Pagos Seguros en Línea)
CRSinpe Movil
DESEPA Instant Credit Transfer
ESBizum
FRSEPA Instant Credit Transfer
HKFPS
INUPI
ITSEPA Instant Credit Transfer
KEM-Pesa
MXSPEI
NGNIBSS Instant Payment
NLSEPA Instant Credit Transfer
PEYape
PTMB WAY
SGPayNow
UKFaster Payments
USRTP (Real-Time Payments)
ZAPayShap

Roadmap.

Waves are ordered by evidence quality × rails unlocked ÷ template cost, not by market size. A provider whose signature scheme can't be verified isn't a wave item — it's a research ticket.

WaveFocusWhat it unlocks
0FoundationTyped webhook specs, the recommendation engine, the event signer, the currency exponent table, catalog-driven validators
1MoR continuity + LATAM verification familiesPaddle · Polar · Conekta · Bold · Asaas · Kushki → Ecuador, and the RSA / body-transform / shared-secret families a dozen later providers reuse
2"The payload is not authoritative"Transbank · Flow · dLocal Go · Culqi · Pagar.me → Chile and Peru properly, plus the return_url_commit and ping_then_poll models
3LATAM long tailFintoc · Recurrente · ePayco · Mobbex · Placetopay → Central America gets a real answer
4Europe self-serveMollie · Revolut · Redsys · GoCardless · Adyen → iDEAL, Bancontact, BLIK, Bizum, SEPA and Bacs mandates
5AsiaRazorpay · Xendit · Midtrans · PayMongo · Airwallex · Antom → UPI, QRIS, PayNow, PromptPay, Alipay+
6Africa & MENAPaystack · Yoco · Flutterwave · Paymob · Tap · M-Pesa → mada, KNET, M-Pesa, MoMo, PayShap
7New categoriesSquare · Authorize.Net · RevenueCat · Lago · Hyperswitch · Forage → card-present, high-risk verticals, mobile IAP, metered billing, orchestration, SNAP EBT

Development.

npm install
npm run verify            # everything: schemas, integrity invariants, all test suites
npm run generate:all      # regenerate every derived file
./scripts/dev-link.sh /path/to/test-project
GateCatches
validate:dataSchema violations, duplicate ids, dangling references, coverage lies, and the two invariants: no LLM claim marked high-confidence, no build-level provider without a verified scheme
test:validatorsValidator fixtures — the violation, the correct code, the near-miss that must not false-positive, the bypass
test:advisorEvery wrong recommendation PagoKit could give, locked as a fixture
test:signaturesPer provider: sign → verify → and reject a tampered body, a wrong secret, a missing header, a replay
check:*Drift in any generated file — coverage, signatures, doctor table, README tables, catalog

Nothing generated is edited by hand. See CONTRIBUTING.md.

Why the file count doesn't explode

Fragments keyed by verification family are additive rather than multiplicative: 40 providers map onto 14 webhook families

Providers differ in a small number of ways, and those ways repeat. Writing one template per provider makes the file count providers × stacks × billing modes. Writing one fragment per capability family makes it additive — and adding provider 41 costs a JSON entry plus a small override, not two dozen documents.


Security.

Found a vulnerability? Please don't open a public issue. Email security@tododeia.com or use GitHub Security Advisories. Response within 48 hours. Full policy: SECURITY.md.


Author.

Enrique Rocha · tododeia.com · @soyenriquerocha · enrique@tododeia.com

AI consulting · agents · automations · sprints in Miami.

If it saved you days, send me a screenshot. If it broke something, open an issue.


MIT · 2026 Enrique Rocha · tododeia.

Files in the repo

Repository payload20 top-level entries
  • .claude-plugin
  • .github
  • agents
  • assets
  • commands
  • docs
  • hooks
  • schemas
  • scripts
  • skills
  • .gitignore
  • ABOUT.md
  • CHANGELOG.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • LICENSE
  • package-lock.json
  • package.json
  • README.md
  • SECURITY.md

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More plugins

Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.

138k
1 add

Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.

82k
code-yeongyu/
oh-my-openagent

OmO: Just type "mass ulw" keyword with your prompt. Now you are the master of graph engineering.

69k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

94k

Opinionated Oxlint rules for rejecting low-evidence TypeScript and JavaScript patterns

4.3k