{"skill":{"slug":"redotpay-payment","displayName":"RedotPay Payment Skill for MPP","summary":"Use when the user wants the RedotPay CLI for agent-paid HTTP, MPP-style service discovery, or 402/x402 flows. Activate for redotpay, RedotPay, MPP, 402, x402...","description":"---\nname: redotpay-payment\ndescription: \"use when the user asks RedotPay to find, search, request, or look up services/data. Covers service discovery by ```bash\nredotpay wallet services list --search \\\"<keywords>\\\"\n```  and data retrieval across media generation, model APIs, data APIs, and agent-commerce lookups. Triggers on 'use redotpay to find/search/look up/request XXX'.\"\n\n---\n\n# RedotPay Payment\n\nService discovery and data retrieval via CLI. **Find, search, and request only — no purchase/buy flows.**\n\n## Prerequisites & Readiness Check\n\n**Before any user-facing workflow, verify the `redotpay` binary is callable.**\n\n### Step 0 — Environment Verify\n\n```bash\ncommand -v redotpay && redotpay --version\n```\n\n| Result | Action |\n|--------|--------|\n| `command not found` / no output | CLI not installed → run **Installation Reference** below |\n| Found but `redotpay wallet whoami` fails with ENOENT | CLI installed but not in Gateway PATH → run **Link to Gateway PATH** below |\n| Found + version prints | Ready → skip to Core Workflow |\n\n\nThen re-run the verify check above.\n\n### Link to Gateway PATH\n\n`~/.local/bin` is guaranteed to be in the OpenClaw Gateway launchd PATH. If `redotpay` is installed under `~/.redotpay/bin/` but not found, create the symlink:\n\n```bash\nln -sf ~/.redotpay/bin/redotpay ~/.local/bin/redotpay\n```\n\n> **Why:** Gateway runs via launchd and does not source `.zshrc` / `.bashrc`. Non-standard PATH directories like `~/.redotpay/bin` must be linked into a standard location already in the Gateway PATH (`~/.local/bin`).\n\n> **If Gateway still can't find `redotpay` after linking:** reload Gateway with `openclaw gateway restart`.\n\nAfter linking, re-run `command -v redotpay && redotpay --version` to confirm.\n\n---\n\n## When to Trigger\n\nTrigger when the user message combines RedotPay with a **discovery or query** action:\n\n- `use redotpay to find/search/look up/request …`\n- `request/find/search/look up … by/via redotpay`\n- `用 redotpay 找/查/搜 …`\n\n**Trigger examples:**\n\n> \"use redotpay to find running shoes under $150 with free shipping\"\n> \"use redotpay to search flights SFO to Tokyo\"\n> \"look up AAPL stock data by redotpay\"\n> \"request weather data for NYC via redotpay\"\n\n---\n\n## Task Buckets\n\nRedotPay services are organized into these categories. Use them to guide keyword selection during service discovery:\n\n### Generate Media\nImage, video, music, audio, TTS, transcription.\n\n### Model APIs\nChat completion, embeddings, inference.\n\n### Data APIs\nSearch, extraction, on-chain data, travel/maps-style lookups (per catalog).\n\n### Agent-Commerce\nBuy/order/purchase flows exposed via MPP (lottery, domains, mail, etc.).\n\n> **Note:** This skill handles discovery and data retrieval across all buckets. Agent-commerce **purchase** flows are excluded — only listing/searching/looking up commerce services is allowed.\n\n---\n\n## Core Workflow (Four Steps)\n\n**Steps 1, 2, 3 do not require login.** Login is only needed at Step 4 before making a paid request.\n\n### Step 1 — Search for Services\n\n```bash\nredotpay wallet services list --search \"<keywords>\"\n```\n\nExtract 1–3 core keywords from the user's request. Match against the task buckets above:\n\n| User Request | Bucket | Search Terms |\n|-------------|--------|-------------|\n| Find running shoes under $150 | Data APIs | `--search \"shoes product search\"` |\n| Search flights SFO→JFK | Data APIs | `--search \"flight travel\"` |\n| Look up AAPL stock | Data APIs | `--search \"stock market finance\"` |\n| Generate an image of a cat | Generate Media | `--search \"image generation\"` |\n| Transcribe this audio file | Generate Media | `--search \"transcription audio\"` |\n| Chat with GPT about history | Model APIs | `--search \"chat completion llm\"` |\n\nIf results are empty, try broader keywords. Output is JSON — focus on `id`, `name`, `description`, `serviceUrl`.\n\n### Step 2 — Inspect the Service\n\n```bash\nredotpay wallet services <service_id>\n```\n\nGet endpoint list, parameter schema, and pricing. **Always inspect before calling.**\n\n### Step 3 — Quote Cost and Get Confirmation\n\n**After inspecting the service and mapping user constraints to parameters, before any request:**\n\n1. Tell the user:\n   - Which service and endpoint will be called\n   - Exact cost in **USD** (convert from the service's native currency; stablecoins like USDC/USDT = 1:1 USD; for other tokens, note both the raw amount and estimated USD value)\n   - What the request will return\n2. **Wait for explicit user confirmation.** Do not proceed without it.\n3. If user says no or asks for alternatives, go back to Step A or B.\n\n### Step 4 — Login then Call the Service\n\n**Login is only required at this step.**\n\nFirst, check login status:\n\n```bash\nredotpay wallet whoami\n```\n\n- Logged in → proceed to call the service\n- Not logged in → run login flow (see Login Flow below), then proceed\n\nThen call the service:\n\n```bash\nredotpay request [flags] <endpoint_url>\n```\n\nOnly execute after Step 3 confirmation and login check.\n\n---\n\n## Command Reference\n\n```text\nredotpay wallet services list [--search <q>]  # Search services\nredotpay wallet services <id>                  # Inspect service details\nredotpay request [curl-flags] <url>            # Send request\nredotpay wallet whoami                         # Check login status\nredotpay wallet login                          # Log in\nredotpay wallet logout                         # Log out\nredotpay --help                                # Help\nredotpay request --help                        # Request help\nredotpay guide                                 # Usage guide\n```\n\n---\n\n## Payment Safety Rules\n\n### User Confirmation\n\n1. Login (`wallet login`) does not require confirmation for a specific charge.\n2. Any paid `redotpay request` must:\n   - State the cost in **USD**, the purpose, and the original currency/amount\n   - Obtain **explicit user confirmation** before executing\n\n### Spend Cap\n\nSet a cap via `--max-spend` or `REDOTPAY_CLI_MAX_SPEND` for any chargeable request. If the user refuses a cap, do not proceed.\n\n### Preflight\n\nLogin is only required at Step 4. Do **not** run `whoami` or `login` during Steps 1, 2, or 3.\n\n---\n\n## Login Flow\n\nOnly triggered at Step 4 when `whoami` returns \"not logged in\".\n\n```bash\nredotpay wallet login\n```\n\n1. Parse stdout JSON, extract `login_qr_png_path` and `user_code`\n2. Read and display the QR image as an attachment: `read <login_qr_png_path>`\n3. Tell the user: **Open the RedotPay app, scan the QR code above to authorize**\n4. Wait for user → `whoami` to confirm → continue\n\n---\n\n## Troubleshooting\n\n### Skill not appearing in available skills list\n\n**Root cause:** `redotpay` binary not found in Gateway PATH.\n\n1. Run `command -v redotpay` in terminal — if found, note the path (typically `~/.redotpay/bin/redotpay`)\n2. Check if that directory is in the Gateway launchd PATH: inspect `~/Library/LaunchAgents/ai.openclaw.gateway.plist` → `EnvironmentVariables` → `PATH`\n3. If missing, create symlink: `ln -sf ~/.redotpay/bin/redotpay ~/.local/bin/redotpay`\n4. Restart Gateway: `openclaw gateway restart`\n5. `command -v redotpay` should now succeed in the Gateway context\n\n### `redotpay request` returns 402 / payment error\n\n1. Ensure wallet is logged in: `redotpay wallet whoami`\n\n### Service returns empty results\n\n1. Broaden keywords in `redotpay wallet services list --search`\n2. Check the service catalog for available categories\n3. Some services require specific parameter formats — always inspect with `redotpay wallet services <id>` before calling\n\n---\n\n---\n\n## After setup\n\nProvide:\n\n- RedotPay readiness **only from** `redotpay wallet whoami`.\n- Whether the task is MPP discovery, direct redotpay request, or 402 retry.\n- If login is required, follow **Login Flow** only (QR + **RedotPay app** scan reminder ; no token dumps).\n\n---\n\n## Use services and requests\n\n```bash\nredotpay wallet services list\nredotpay wallet services list --search <query>\nredotpay wallet services <service_id>\nredotpay request [curl-like flags] <URL>\n```\n\n- Use `redotpay wallet services` for mpp.dev-style public registry discovery (`id`, `name`, `serviceUrl`, etc.).\n- Use `redotpay request` as the curl-like HTTP entrypoint, including paid endpoints that may return 402.\n\n---\n\n## Preflight (mandatory for `redotpay request`)\n\nBefore **any** `redotpay request`, run **`redotpay wallet whoami`** first.\n\nIf **not logged in** or session invalid: **do not** call the URL yet or blindly retry. **Pause**, run **Login Flow** end-to-end (including **RedotPay app** QR scan instructions), wait until the user finishes authorization, then `whoami` until it is good; **then** run or retry `redotpay request`.\n\n`redotpay wallet services …` may work without a session in some setups; paid or session-gated calls still require the rule above.\n\n### Request examples\n\n```bash\nredotpay request https://example.com/resource\nredotpay request -X POST https://example.com/api -H 'Content-Type: application/json' --json '{\"a\":1}'\n```\n\n---\n\n## HTTP 402 behavior (`redotpay request`)\n\nMany paid flows return `402 Payment Required`. `redotpay request` supports behaviors described in CLI help, including:\n\n### If a 402 lists Tempo as a payment method\n\nDo **not** assume you must switch to `tempo` or `mppx`.\n\nIn this model, `redotpay request` can still complete payment when Tempo appears in offered methods, using RedotPay OAuth session (`redotpay wallet login`) plus normal redotpay request semantics.\n\nFor edge cases, consult `redotpay guide` and CLI help before guessing.\n\n---\n\n## Agent UX before charging\n\n1. State amount, currency, and purpose when known.\n2. **Consent vs login:** you may run **`redotpay wallet login`** as soon as `whoami` shows no session (identity only). That is **not** consent for a **specific charge** — get explicit agreement on amount/currency/purpose before a **paid** `redotpay request` (or before approving spend on a retry after login).\n3. **Preflight:** `whoami` before every `redotpay request`; if no session → **Login Flow** (QR + **tell the user to open the RedotPay app and scan to authorize**) → then request.\n4. Never paste OAuth tokens, raw wallet payloads, or full credential files into chat.\n\n---\n\n## Safety\n\n- Never request, print, or store OAuth tokens, API keys, or signing material in chat.\n- Treat local RedotPay wallet config as sensitive; do not dump credential stores or full config.\n- Use verbose mode (`-v`) sparingly because stderr may expose URL/payment metadata.\n\n---\n\n\n## Notes\n\n- Never expose OAuth tokens, keys, or wallet config in chat\n- Use `-v` sparingly (stderr may leak payment metadata)\n- **Login QR:** use `read` tool on the PNG path, not `![...](file://...)` markdown (blocked by browser security)\n\n---\n\n## Installation Reference\n\nManual first-time setup (normally handled automatically by the Prerequisites check above).\n\n```bash\ncurl -fsSL \"https://raw.githubusercontent.com/redotpay/redotpay-cli/v0.1.1/install.sh\" -o redotpay-install.sh\nshasum -a 256 -c SHA256SUMS --ignore-missing\nbash redotpay-install.sh\nredotpay --version\n```","tags":{"latest":"0.1.7"},"stats":{"comments":0,"downloads":475,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":7},"createdAt":1777883994344,"updatedAt":1778492846193},"latestVersion":{"version":"0.1.7","createdAt":1778136812492,"changelog":"redotpay-payment v0.1.7","license":"MIT-0"},"metadata":null,"owner":{"handle":"turbo-wang","userId":"s17ed9pje213tp47pdskp182md862fmm","displayName":"wanghao-ftd","image":"https://avatars.githubusercontent.com/u/13176434?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780090756854}}