diff --git a/src/pages/payment-methods/stripe/charge.mdx b/src/pages/payment-methods/stripe/charge.mdx index 17a652b7..dd436360 100644 --- a/src/pages/payment-methods/stripe/charge.mdx +++ b/src/pages/payment-methods/stripe/charge.mdx @@ -170,6 +170,10 @@ See the [payment links guide](/guides/payment-links) for a full walkthrough and ## Client +::::tip[For agents] +The [Link CLI](/tools/wallet#link-cli) handles `stripe.charge` end-to-end—`link-cli mpp pay` parses the 402 Challenge, creates an SPT from the user's Link wallet, and retries the request with the Credential. No code required. +:::: + Use `stripe` with `Mppx.create` to automatically handle `402` responses. The client parses the Challenge, creates an SPT through the `createToken` callback, and retries with the Credential. SPT creation requires a Stripe secret key, so the client accepts a `createToken` callback that proxies through a server endpoint. You can optionally pass a `client` (a Stripe.js instance from `@stripe/stripe-js`) which is forwarded to the `createToken` callback for use with Elements. diff --git a/src/pages/payment-methods/stripe/index.mdx b/src/pages/payment-methods/stripe/index.mdx index 30b0c482..9bc07077 100644 --- a/src/pages/payment-methods/stripe/index.mdx +++ b/src/pages/payment-methods/stripe/index.mdx @@ -20,6 +20,10 @@ Machine payments must be enabled on your Stripe account before you can accept MP To learn more, read the [Stripe documentation](https://docs.stripe.com/payments/machine/mpp) on accepting MPP. +::::tip[For agents] +Use the [Link CLI](/tools/wallet#link-cli) to pay for `stripe.charge` services from a Link wallet without writing integration code. `link-cli mpp pay` handles the full 402 → SPT → retry flow automatically. +:::: + ## How it works + + +Paste this into your agent: + +``` +Read https://github.com/stripe/link-cli/blob/main/SKILL.md and set up link-cli +``` + + + +::::steps + +### Install + +```bash [terminal] +$ npm install -g @stripe/link-cli +``` + +### Log in + +```bash [terminal] +$ link-cli auth login --client-name "My Agent" +``` + +This displays a verification URL and phrase. Approve in the Link app to complete authentication. + +### List payment methods + +```bash [terminal] +$ link-cli payment-methods list +``` + +### Make a paid request + +```bash [terminal] +$ link-cli mpp pay https://api.example.com/resource \ + --method POST \ + --data '{"prompt": "hello"}' +``` + +:::: + + + +**Supported methods:** stripe.charge + +**Key features:** + +- **End-to-end 402 handling**—`link-cli mpp pay` parses the Challenge, creates an SPT, and retries with the Credential +- **User approval**—each purchase requires explicit approval in the Link app +- **One-time-use credentials**—SPTs are scoped to a specific merchant, amount, and context +- **MCP server mode**—run as `link-cli --mcp` for integration with Claude Code and other MCP-compatible agents + ## `mppx` The [`mppx`](/sdk/typescript/cli) CLI is a lightweight MPP client bundled with the `mppx` package. It handles `402` responses automatically using a local keychain account—ideal for development, testing, and debugging.