AixyzApp, providing an alternative payment method alongside x402.
Installation
Usage
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
STRIPE_SECRET_KEY | Yes | — | Stripe secret key |
STRIPE_PRICE_CENTS | No | 100 | Price per request in USD cents |
STRIPE_SECRET_KEY is not set, the function is a no-op — no endpoints or middleware are registered.
Registered Endpoints
POST /stripe/create-payment-intent
Creates a new Stripe PaymentIntent for the configured price.
Response:
Payment Middleware
After registering theexperimental_StripePaymentIntentPlugin, the server checks incoming requests for the x-stripe-payment-intent-id header:
- If the header is present, it validates the PaymentIntent:
- Status must be
succeeded - Amount must meet the configured
STRIPE_PRICE_CENTS - Payment must not have been already consumed
- Status must be
- Valid payments are marked as consumed (one-time use) and the request proceeds
- Invalid payments return
402 Payment Required - If no header is present, the request falls through to x402 middleware
Usage
Use in a custom server (app/server.ts):
app/server.ts
Register the
experimental_StripePaymentIntentPlugin before A2A or MCP plugins so the Stripe middleware runs
first. If a valid Stripe payment is found, x402 verification is skipped.