From stripe-mpp
Implements MPP one-time charge flows for per-request API payments using HTTP 402 gates and mppx middleware. For pay-per-call APIs, data access, file downloads.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin stripe-mppThis skill is limited to using the following tools:
**Fetch live docs**:
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Acquire memory dumps from live systems/VMs and analyze with Volatility 3 for processes, networks, DLLs, injections in incident response or malware hunts.
Provides x86-64/ARM disassembly patterns, calling conventions, control flow recognition for static analysis of executables and compiled binaries.
Fetch live docs:
https://www.npmjs.com/package/mppx for the charge middleware API and configurationhttps://paymentauth.org/ for the canonical charge intent specificationsite:github.com stripe-samples machine-payments charge for charge flow sample codehttps://docs.stripe.com/payments/machine/mpp for Stripe charge integration detailsThe charge intent implements immediate, per-request settlement. Each API call triggers a single payment. The flow is:
Client: GET /api/data
Server: 402 Payment Required
WWW-Authenticate: Payment <challenge with intent="charge">
Client: Fulfills payment (on-chain tx or card charge)
Client: GET /api/data
Authorization: Payment <credential with proof>
Server: 200 OK
Payment-Receipt: <receipt>
// Protect a route with a charge gate
app.get('/api/data', mppx.charge({ amount: '100' }), async (c) => {
// Only reached after successful payment
return c.json({ data: 'premium content' });
});
The amount is specified in the smallest unit of the payment method's currency.
For routes where the price depends on the request:
app.get('/api/data/:size', async (c, next) => {
const size = c.req.param('size');
const amount = calculatePrice(size);
return mppx.charge({ amount: String(amount) })(c, next);
}, async (c) => {
return c.json({ data: 'variable-price content' });
});
WWW-Authenticate header with 402 status| Payment Method | Unit | Example: $0.01 |
|---|---|---|
| Tempo (USDC) | Smallest token unit | Verify in SDK docs |
| Stripe | Cents (minor currency unit) | 100 (1 USD cent = 100) |
| Lightning | Millisatoshis | Varies |
Always verify the exact unit convention in the SDK documentation for your payment method.
| Scenario | Server Response |
|---|---|
| No payment header | 402 with payment-required challenge |
| Payment amount too low | 402 with verification-failed |
| Payment to wrong address | 402 with verification-failed |
| Expired challenge | 402 with payment-expired |
| Duplicate credential (replay) | 402 with verification-failed |
| Successful payment | 200 with Payment-Receipt |
Fetch the latest mppx SDK docs and payment method documentation for exact charge configuration options and amount unit conventions before implementing.