← 返回 Skills 市场
danhill-stripe

Create Payment Credential

作者 Dan Hill · GitHub ↗ · v0.4.1 · MIT-0
cross-platform ⚠ suspicious
59
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install create-payment-credential
功能描述
Gets secure, one-time-use payment credentials (cards, tokens) from a Link wallet so agents can complete purchases on behalf of users. Use when the user says...
使用说明 (SKILL.md)

Creating Payment Credentials

Use Link to get secure, one-time-use payment credentials from a Link wallet to complete purchases.

Choosing how to call Link

Link CLI can run as an MCP server or as a standalone CLI. Always prefer the MCP server when available — it avoids shell parsing issues and is the intended integration path.

  1. Check for the MCP server first. Look for a link-cli MCP server in your active MCP connections. If present, call its tools directly (e.g. auth_status, auth_login, spend-request_create, payment-methods_list, mpp_pay, mpp_decode).
  2. Fall back to the CLI only if the MCP server is not available. Install it with npm install -g @stripe/link-cli, then use the shell commands documented below.

The rest of this document shows CLI commands. When using the MCP server, map each command to its corresponding MCP tool — the parameters and behavior are identical.

CLI command MCP tool
auth login mcp__link-cli__auth_login
auth logout mcp__link-cli__auth_logout
auth status mcp__link-cli__auth_status
spend-request create mcp__link-cli__spend-request_create
spend-request update mcp__link-cli__spend-request_update
spend-request retrieve mcp__link-cli__spend-request_retrieve
spend-request request-approval mcp__link-cli__spend-request_request-approval
payment-methods list mcp__link-cli__payment-methods_list
payment-methods add mcp__link-cli__payment-methods_add
mpp pay mcp__link-cli__mpp_pay
mpp decode mcp__link-cli__mpp_decode

Running commands (CLI fallback)

All commands support --format json for machine-readable output. Pass input via flags (run link-cli \x3Ccommand> --help to see full schema details, including all fields, types, and constraints).

IMPORTANT: Run auth login with run_in_background=true (or TaskOutput(task_id, block: false)). It emits JSON to stdout before it exits, then keeps running while it polls for user action.

The agent-facing JSON contract is:

  • auth login --format json: first object contains verification_url and phrase; final object contains authentication result after approval succeeds
  • spend-request create --request-approval --format json: returns the created spend request immediately with an _next.command polling hint
  • spend-request request-approval --format json: returns the approval link immediately with an _next.command polling hint
  • spend-request retrieve \x3Cid> --interval \x3Cseconds> --format json: polls until the spend request reaches a terminal status, then returns the terminal spend request. It exits non-zero with code: "POLLING_TIMEOUT" if --timeout is reached or --max-attempts is exhausted while the request is still non-terminal.

For auth login, keep reading stdout until the process exits. For spend request approval, present the approval_url to the user and start the _next.command polling command immediately. The user MUST visit the verification or approval URL to continue, and you should always show that full URL in clear text.

Core flow

Copy this checklist and track progress:

  • Step 1: Authenticate with Link
  • Step 2: Evaluate merchant site (determine credential type)
  • Step 3: Get payment methods
  • Step 4: Create spend request with correct credential type
  • Step 5: Complete payment

Step 1: Authenticate with Link

Check auth status:

link-cli auth status --format json

If the response includes an update field, a newer version of link-cli is available — run the update_command from that field to upgrade before proceeding.

If not authenticated:

link-cli auth login --client-name "\x3Cyour-agent-name>" --format json

Replace \x3Cyour-agent-name> with the name of your agent or application (e.g. "Personal Assistant", "Shopping Bot"). This name appears in the user's Link app when they approve the connection. Use a clear, unique, identifiable name. Display the url and phrase to the user, with the guidance "Please visit the following URL to approve secure access to Link.”

DO NOT PROCEED until the user is authenticated with Link.

Always check the current authentication status before starting a new login flow - the user may already be logged in.

Step 2: Evaluate the merchant site BEFORE creating a spend request

CRITICAL before calling spend-request create you must complete this checklist:

  1. Understand how the merchant accepts payments (cards or machine payments or other). **Do NOT default to card credential type. The merchant determines the credential type — you cannot know it without checking first. Skipping this step will produce a spend request with the wrong credential type.
  2. Have the final total amount needed. Inclusive of any shipping costs, taxes or other costs. Skipping this step will produce a spend request that does not cover the full amount needed, and will be rejected.
  3. Clear context and understanding of what the user is purchasing. Be sure to know sizes, colors, shipping options, etc. Skipping this step will produce a spend request that the user does not recognize or understand.

Determine how the merchant accepts payment:

  1. Navigate to the merchant page — browse it, read the page content, and understand how the site accepts payment.
  2. If the page has a credit card form, Stripe Elements, or traditional checkout UI — use card.
  3. If the page describes an API or programmatic payment flow — make a request to the relevant endpoint. If it returns HTTP 402 with a www-authenticate header, use shared_payment_token.

What you find determines which credential type to use:

What you see Credential type What to request
Credit card form / Stripe Elements card (default) Card
HTTP 402 with method="stripe" in www-authenticate shared_payment_token Shared payment token (SPT)
HTTP 402 without method="stripe" in www-authenticate not supported Do not continue

For 402 responses: The www-authenticate header may contain multiple payment challenges (e.g. tempo, stripe) in a single header value. Do not try to decode the payload manually. Pass the full raw WWW-Authenticate header value to Link CLI and let mpp decode select and validate the method="stripe" challenge.

To derive network_id, use Link CLI's challenge decoder:

link-cli mpp decode --challenge '\x3Craw WWW-Authenticate header>' --format json

This validates the Stripe challenge, decodes the request payload, and returns both the extracted network_id and the decoded request JSON. Pass the full header exactly as received, even if it also contains non-Stripe or multiple Payment challenges.

Step 3: Get payment methods

Use the default payment method, unless the user explicitly asks to select a different one.

link-cli payment-methods list --format json

Step 4: Create the spend request with the right credential type

link-cli spend-request create \
  --payment-method-id \x3Cid> \
  --amount \x3Ccents> \
  --context "\x3Cdescription>" \
  --merchant-name "\x3Cname>" \
  --merchant-url "\x3Curl>" \
  --format json

After creating or requesting approval for a spend request, run the returned _next.command to poll for the terminal status. Do not proceed to payment while the request is still created or pending_approval. If polling exits with POLLING_TIMEOUT, keep waiting or ask the user whether to continue polling. If they deny, ask for clarification what to do next.

Recommend the user approves with the Link app. Show the download URL.

Test mode: Add --test to create testmode credentials instead of real ones. Useful for development and integration testing.

Step 5: Complete payment

Card: Run link-cli spend-request retrieve \x3Cid> --include card --format json to get the card object with number, cvc, exp_month, exp_year, billing_address (name, line1, line2, city, state, postal_code, country), and valid_until (unix timestamp — the card stops working after this time). Enter these details into the merchant's checkout form.

SPT with 402 flow: The SPT is one-time use — if the payment fails, you need a new spend request and new SPT.

link-cli mpp pay \x3Curl> --spend-request-id \x3Cid> [--method POST] [--data '{"amount":100}'] [--header 'Name: Value'] --format json

mpp pay handles the full 402 flow automatically: probes the URL, parses the www-authenticate header, builds the Authorization: Payment credential using the SPT, and retries.

Important

  • Treat the user's payment methods and credentials extremely carefully — card numbers and SPTs grant real spending power; leaking them outside a secure checkout could result in unauthorized charges the user cannot reverse.
  • Respect /agents.txt and /llm.txt and other directives on sites you browse — these files declare whether the site permits automated agent interactions; ignoring them may violate the merchant's terms.
  • Avoid suspicious merchants, checkout pages and websites — phishing pages that mimic legitimate merchants can steal credentials; if anything about the page feels off (mismatched domain, unusual redirect, unexpected login prompt), stop and ask the user to verify.
  • When outputting card information to the user apply basic masking to the card number and address to protect their information. Only reveal the raw values if directly requested to do so.

Errors

All errors are output as JSON with code and message fields, with exit code 1.

Common errors and recovery

Error / Symptom Cause Recovery
verification-failed in error body from mpp pay SPT was already consumed (one-time use) Create a new spend request with credential_type: "shared_payment_token" — do not retry with the same spend request ID
context validation error on spend-request create context field is under 100 characters Rewrite context as a full sentence explaining what is being purchased and why; the user reads this when approving
API rejects merchant_name or merchant_url These fields are forbidden when credential_type is shared_payment_token Remove both fields from the request; SPT flows identify the merchant via network_id instead
Command hangs indefinitely auth login or spend-request create run synchronously Always run these commands with run_in_background=true — they block until the user acts, so synchronous execution freezes the agent
Spend request approved but payment fails immediately Wrong credential type for the merchant (e.g. card on a 402-only endpoint) Go back to Step 2, re-evaluate the merchant, create a new spend request with the correct credential_type
Auth token expired mid-session (exit code 1 during approval polling) Token refresh failure during background polling Re-authenticate with auth login, then retrieve the existing spend request or resume polling. Only create a new spend request if the original one expired, was denied, or its shared payment token was already consumed

Further docs

安全使用建议
Review this skill before installing because it is meant for real purchases. Make sure you trust the Link CLI/MCP setup, approve only exact amounts and merchants you recognize, require confirmation before any CLI update command, and revoke or log out of Link access when finished.
功能分析
Type: OpenClaw Skill Name: create-payment-credential Version: 0.4.1 The skill facilitates payment credential handling but contains high-risk instructions that introduce potential security vulnerabilities. Specifically, `SKILL.md` directs the agent to execute an `update_command` directly from the JSON output of a status check, which constitutes a Remote Code Execution (RCE) risk if the tool's output is manipulated. Furthermore, the flow requires the agent to handle raw, sensitive PCI data (card numbers and CVCs) within its execution context to complete purchases, which is a high-risk practice for AI agents despite the included masking instructions for user-facing output.
能力标签
cryptorequires-walletcan-make-purchasesrequires-sensitive-credentials
能力评估
Purpose & Capability
The purpose is coherent and disclosed, but it is high-impact: the skill obtains payment credentials from a Link wallet and can complete purchases on the user's behalf.
Instruction Scope
The instructions include user authentication and approval steps, but they also expose payment, wallet, MCP, and shell-driven flows that could affect real financial transactions.
Install Mechanism
The npm-based Link CLI install is expected for this purpose, but the skill also allows npm/npx shell use and instructs running an update command returned at runtime.
Credentials
Access to wallet authentication, payment methods, spend requests, and purchase completion is proportionate to the stated purpose but sensitive enough to require explicit user review.
Persistence & Privilege
The artifact describes background polling for login and implies a reusable Link login state; this appears purpose-aligned but should be managed and revoked when no longer needed.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install create-payment-credential
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /create-payment-credential 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.4.1
- Improved documentation for using Link CLI via MCP server or CLI fallback. - Added detailed step-by-step checklist for agents: authenticate, evaluate merchant, get payment methods, create spend request, and complete payment. - Provided explicit instructions for determining the correct credential type (card or shared payment token) based on merchant site and payment challenges. - Documented the use of the `mpp decode` command for handling HTTP 402 responses and extracting necessary data for tokenized payments. - Clarified required fields and error handling to help agents avoid common issues and ensure a smooth payment credential flow.
元数据
Slug create-payment-credential
版本 0.4.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Create Payment Credential 是什么?

Gets secure, one-time-use payment credentials (cards, tokens) from a Link wallet so agents can complete purchases on behalf of users. Use when the user says... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 59 次。

如何安装 Create Payment Credential?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install create-payment-credential」即可一键安装,无需额外配置。

Create Payment Credential 是免费的吗?

是的,Create Payment Credential 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Create Payment Credential 支持哪些平台?

Create Payment Credential 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Create Payment Credential?

由 Dan Hill(@danhill-stripe)开发并维护,当前版本 v0.4.1。

💬 留言讨论