Skip to content

fix: AgentPay product-completion — recipient, spend ceiling, honest claims - #250

Merged
Rumblingb merged 2 commits into
mainfrom
cursor/product-completion-efd3
Sep 6, 2026
Merged

fix: AgentPay product-completion — recipient, spend ceiling, honest claims#250
Rumblingb merged 2 commits into
mainfrom
cursor/product-completion-efd3

Conversation

@Rumblingb

@Rumblingb Rumblingb commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Product lock

AgentPay stays guardrails + payment authority for agents. Ace and RCM stay dark. Locked H1 is unchanged:

Your agent can pay with a card or with crypto. One key. You set the limit.

H1 stays because the crypto (x402/USDC) path is real in code once a recipient exists. Card is real in code via Stripe Checkout when STRIPE_SECRET_KEY is set. UPI and Open Banking were advertised and are not settled rails — they are stripped from public copy.

Live QA (6 Sep 2026 Europe/London) — production still on pre-deploy #247

Production has #247 merged but not published/deployed. This PR is the deploy candidate for the leftover gaps.

A. Register now always returns apk_. Live 201 hid the key when Resend succeeded (emailDelivery: sent, no apiKey, returnApiKey:true ignored). The 201 body now always includes apk_ once, whether email sent or failed.

B. Receipt no longer 500s. Live GET /api/receipt/:intentId 500'd on a LEFT JOIN to agents. Lookup now reads payment_intents only. Invalid IDs are 404. DB failure is 503 RECEIPT_UNAVAILABLE, not 500. /api/receipt/demo stays 200.

C. USDC recipient. Intents never emit solana:null. Merchant wallet or PLATFORM_TREASURY_WALLET, else 503 RECIPIENT_NOT_CONFIGURED.

D. CORS. agentpay.gg / dashboard.agentpay.gg removed from wrangler.toml.

E. Spend ceiling. Launch default $25, Builder $250, overridable via spendLimitUsd. Over-limit is 403 SPEND_LIMIT_EXCEEDED.

F. Copy. Landing tree still drops IRCTC / National Rail / UPI / Open Banking. Worker is not deployed yet — that is why live / /start /docs still name the rails.

G. Health. API health no longer claims operational for unimplemented services. Edge note says it is not an operational claim.

H. MCP. No new package bump. 0.2.1 is already on main from #247. npm still serving 0.2.0 until someone publishes.

I. Builder $39. POST /api/billing/plans/builder uses price_1U9CNjPXcf9g8qGxzygstusB. collection.available is true only with STRIPE_SECRET_KEY.

Pay-for bar (code vs deploy)

Bar In this PR Still needs
1. /start register returns usable apk_ key Yes — 201 always includes apk_ Deploy apps/api-edge
2. MCP stdio 0.2.1+ Already on main from #247 npm publish --access public of @agentpayxyz/mcp-server@0.2.1
3. Spend limit enforced server-side Yes Deploy apps/api-edge
4. One funded rail + receipt x402/USDC path is real if a recipient exists; receipt GET no longer 500s Set PLATFORM_TREASURY_WALLET; deploy api-edge
5. Over-limit spend rejected Yes — 403 SPEND_LIMIT_EXCEEDED Deploy apps/api-edge
6. Public pages honest Yes in landing worker tree Deploy workers/agentpay-landing

Secrets still required

Secret / action Why
PLATFORM_TREASURY_WALLET USDC intents fail honest (503) without a merchant wallet or this treasury
STRIPE_SECRET_KEY Builder $39 collection.available and card checkout
STRIPE_SUCCESS_URL / STRIPE_CANCEL_URL Optional; defaults to https://agentpay.so/start?builder=…
RESEND_API_KEY Email still sent when configured; key is also in the 201 body
Deploy apps/api-edge Register key, receipt, recipient, spend ceiling, CORS, health
Deploy workers/agentpay-landing Live / /start /docs still show old IRCTC/National Rail copy until this worker ships
npm publish @agentpayxyz/mcp-server@0.2.1 Registry is still 0.2.0

Not an H1 blocker unless both card and crypto are unconfigured after deploy. Open Banking has no implementation. UPI stays unpublished until it settles with a receipt.

Tests / repro

node workers/agentpay-landing/worker.test.mjs
npx jest --runInBand tests/routes/mandates-merchants.edge.test.ts \
  tests/routes/receipt-demo.edge.test.ts tests/routes/v1Intents.edge.test.ts \
  tests/unit/spendCeiling.test.ts tests/unit/cryptoRecipient.test.ts

After deploy: register 201 must include apk_ even when email sends. GET /api/receipt/<uuid> must not 500. A $40 Launch intent against a $25 ceiling must 403.

Do not merge. Do not deploy. Do not npm publish from this PR.

Open in Web Open in Cursor 

USDC intents now fail closed instead of returning a null Solana recipient.
Launch/Builder keys get a server-side spend ceiling. Public copy drops
UPI and Open Banking until those rails settle. CORS no longer lists
agentpay.gg. Builder $39 checkout is wired to the existing Stripe price
when STRIPE_SECRET_KEY is present.

Co-authored-by: Rumblingb <Rumblingb@users.noreply.github.com>
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agentpay-docs Ready Ready Preview Sep 6, 2026 4:54pm UTC
agentpay-host-native-restore Ready Ready Preview Sep 6, 2026 4:54pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
agentpay-dashboard Ignored Ignored Preview Sep 6, 2026 4:54pm UTC

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Live QA: register 201 hid the key when Resend succeeded, and
GET /api/receipt/:id 500'd on the agents join. The 201 body now
always includes apk_ once. Receipt lookup uses payment_intents
only and returns 404/503 instead of 500.

Co-authored-by: Rumblingb <Rumblingb@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants