@itpay/cli 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/bin/itp +1 -1
- package/docs/agent/buyer/cart-checkout.json +1 -1
- package/docs/agent/buyer/payment-qr.json +6 -3
- package/docs/agent/buyer/payment-wait.json +3 -1
- package/docs/agent/buyer/quickstart.json +5 -4
- package/lib/buyer.js +80 -7
- package/lib/render-human.js +15 -3
- package/package.json +1 -1
- package/skills/itpay-buyer/SKILL.md +9 -6
package/README.md
CHANGED
|
@@ -221,7 +221,7 @@ itp buyer checkout status <checkout_id> --json
|
|
|
221
221
|
For the one-command buyer helper:
|
|
222
222
|
|
|
223
223
|
```bash
|
|
224
|
-
itp buy var_itpay_enterprise_fuzzy_search_cny01 --email buyer@example.com --input company_name=阿里 --json
|
|
224
|
+
itp buy var_itpay_enterprise_fuzzy_search_cny01 --email buyer@example.com --input company_name=阿里 --display agent --no-wait-payment --json
|
|
225
225
|
```
|
|
226
226
|
|
|
227
227
|
For multi-item cart tests:
|
|
@@ -239,6 +239,7 @@ Payment QR rules:
|
|
|
239
239
|
- Otherwise render the ItPay-hosted `qr_png_url` / `preferred_qr_url`.
|
|
240
240
|
- Use `mobile_wallet_url` only as a human mobile fallback.
|
|
241
241
|
- Do not generate your own QR from payment URLs.
|
|
242
|
+
- In agent app clients, send `payment_handoff.markdown` to the human first, then run `payment_handoff.wait_command`.
|
|
242
243
|
- Treat only `payment_intent.verified` as payment success.
|
|
243
244
|
|
|
244
245
|
If the human wants the agent to analyze delivered content, the human must reveal
|
package/bin/itp
CHANGED
|
@@ -93,7 +93,7 @@ async function main() {
|
|
|
93
93
|
output({
|
|
94
94
|
version: VERSION,
|
|
95
95
|
commands: [
|
|
96
|
-
"buy var_pubg_couple_skin_cny20 --sandbox --email buyer@example.com --phone +8613800000000 --json",
|
|
96
|
+
"buy var_pubg_couple_skin_cny20 --sandbox --email buyer@example.com --phone +8613800000000 --display agent --no-wait-payment --json",
|
|
97
97
|
"buy var_pubg_couple_skin_cny20 --sandbox --email buyer@example.com --phone +8613800000000 --no-wait --json",
|
|
98
98
|
"buyer catalog search --query 企业工商 --category business_data_api --provider itpay_enterprise_data --json",
|
|
99
99
|
"buyer catalog get --variant var_pubg_couple_skin_cny20 --json",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
"intent": "do both steps through the high-level command",
|
|
71
|
-
"command": "itp buy <variant_id> --sandbox --email <buyer_email> --phone <buyer_phone> --json",
|
|
71
|
+
"command": "itp buy <variant_id> --sandbox --email <buyer_email> --phone <buyer_phone> --display agent --no-wait-payment --json",
|
|
72
72
|
"success_signal": "response.status is waiting_human_auth, waiting_user_payment, payment_verified, or delivery_claimable"
|
|
73
73
|
}
|
|
74
74
|
],
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"commands": [
|
|
18
18
|
{
|
|
19
19
|
"intent": "create payment intent through the high-level buy flow",
|
|
20
|
-
"command": "itp buy <variant_id> --sandbox --email <buyer_email> --phone <buyer_phone> --display agent --json",
|
|
21
|
-
"success_signal": "response.
|
|
20
|
+
"command": "itp buy <variant_id> --sandbox --email <buyer_email> --phone <buyer_phone> --display agent --no-wait-payment --json",
|
|
21
|
+
"success_signal": "response.payment_handoff.markdown and response.payment_handoff.wait_command are present"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"intent": "recover a scanner order-not-found display problem",
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
"Payment QR display requires both a valid/saved buyer session and payment_intent_id. If payment_intent_id appears before buyer_session is saved, run buyer checkout resume/status instead of showing payment QR.",
|
|
34
34
|
"Do not stop after showing auth_qr unless the human explicitly asks you to pause. Keep waiting/resuming the same checkout so the post-auth payment handoff can continue.",
|
|
35
35
|
"Do not describe auth_qr as payment success or payment proof. Only payment_intent.verified proves payment.",
|
|
36
|
+
"In Codex or Claude Code app clients, the default UX is show-then-wait: show response.payment_handoff.markdown first, then run response.payment_handoff.wait_command.",
|
|
37
|
+
"For Telegram-style message clients, show response.payment_handoff.markdown and stop unless the human asks you to keep waiting or returns with a payment question.",
|
|
36
38
|
"MUST show local_qr_path first when present. Many agent clients do not reliably render remote QR images; local_qr_path is the most reliable desktop/chat display artifact.",
|
|
37
39
|
"If local_qr_path is not present, show qr_png_url or preferred_qr_url as the primary scannable QR. This is an ItPay-hosted human QR image; it may render the native provider payment code for scanner reliability, but the agent must not request or decode the raw provider payload.",
|
|
38
40
|
"Use qr_image_url/SVG only as a fallback when PNG/local rendering is unavailable.",
|
|
@@ -40,7 +42,8 @@
|
|
|
40
42
|
"payment_entry_url is the stable ItPay status/payment page. qr_png_url/local_qr_path is usually the better desktop scanner artifact.",
|
|
41
43
|
"In Alipay sandbox, the provider can briefly show order not found even after precreate succeeded. Tell the human to wait 30-60 seconds and retry the same QR/page. Do not create a new checkout, do not create a new payment intent, and do not repeatedly refresh unless the ItPay page or CLI explicitly asks for recovery.",
|
|
42
44
|
"Opening the payment page must not be treated as paid.",
|
|
43
|
-
"
|
|
45
|
+
"Do not run payment wait before the QR/link has been sent to the human.",
|
|
46
|
+
"After showing QR, run payment_handoff.wait_command or buyer payment wait for the same payment_intent_id."
|
|
44
47
|
],
|
|
45
48
|
"forbidden": [
|
|
46
49
|
"Do not encode payment_entry_url into a new QR yourself when qr_png_url/local_qr_path is available.",
|
|
@@ -27,9 +27,11 @@
|
|
|
27
27
|
}
|
|
28
28
|
],
|
|
29
29
|
"agent_rules": [
|
|
30
|
+
"Start payment wait only after the QR image/link has already been sent to the human.",
|
|
30
31
|
"Payment wait is a recovery loop around the same payment_intent_id, not a one-shot command.",
|
|
31
32
|
"wait.timeout is a heartbeat, not a payment failure.",
|
|
32
|
-
"
|
|
33
|
+
"In Codex or Claude Code app clients, after showing QR, wait online for a short visible cycle first. If the human still has not paid, explain that the same QR/link remains valid and pause for their reply.",
|
|
34
|
+
"Continue waiting with the same payment_intent_id unless the user explicitly cancels or asks you to pause.",
|
|
33
35
|
"If the network drops, the process is interrupted, or there is no response, rerun payment wait with the same payment_intent_id or run checkout status/resume with the same checkout_id.",
|
|
34
36
|
"If status is unclear, tell the human it is unclear and continue querying the same payment_intent_id/checkout_id. Do not create a new checkout.",
|
|
35
37
|
"Payment success is payment_intent.verified only.",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"intent": "buy a selected variant with the high-level cart-first flow",
|
|
39
|
-
"command": "itp buy <variant_id> --sandbox --email <buyer_email> --phone <buyer_phone> --json",
|
|
40
|
-
"success_signal": "response.status becomes waiting_human_auth
|
|
39
|
+
"command": "itp buy <variant_id> --sandbox --email <buyer_email> --phone <buyer_phone> --display agent --no-wait-payment --json",
|
|
40
|
+
"success_signal": "response.status becomes waiting_human_auth or waiting_user_payment; if waiting_user_payment, response.payment_handoff contains markdown and wait_command"
|
|
41
41
|
}
|
|
42
42
|
],
|
|
43
43
|
"agent_rules": [
|
|
@@ -54,8 +54,9 @@
|
|
|
54
54
|
"After showing auth_qr, keep running/resuming the same checkout unless the human explicitly asks you to pause. Do not stop merely because a QR was displayed.",
|
|
55
55
|
"When a buyer command returns buyer_session.status=buyer_session_saved, the CLI has stored the buyer account session for this agent device. You may continue with checkout/payment or `buyer vault` commands without asking the human for a token.",
|
|
56
56
|
"Vault grants are only for reading approved delivered artifacts. They are not buyer session credentials and do not authorize refunds or account/order management.",
|
|
57
|
-
"Use high-level itp buy when possible
|
|
58
|
-
"
|
|
57
|
+
"Use high-level itp buy when possible, but in agent app clients split payment into two visible steps: first return and show payment_handoff, then run payment_handoff.wait_command.",
|
|
58
|
+
"If response.payment_handoff.markdown is present, send it to the human immediately in the same user-visible message. It includes the QR image and payment link.",
|
|
59
|
+
"Show the returned payment QR exactly as provided before starting payment wait.",
|
|
59
60
|
"Payment truth comes only from payment_intent.verified.",
|
|
60
61
|
"Secure delivery goes to the human first; report redacted delivery status only."
|
|
61
62
|
],
|
package/lib/buyer.js
CHANGED
|
@@ -4,9 +4,10 @@ import {
|
|
|
4
4
|
writeCredentials, writeSessionCredentials, writeState
|
|
5
5
|
} from "./env.js";
|
|
6
6
|
import { coreApi, coreApiBase } from "./http.js";
|
|
7
|
-
import { renderHumanAction, renderItPayPaymentAction, writeWaitHeartbeat } from "./render-human.js";
|
|
7
|
+
import { renderHumanAction, renderItPayPaymentAction, shouldReturnAfterAgentTextQR, writeWaitHeartbeat } from "./render-human.js";
|
|
8
8
|
|
|
9
9
|
async function buyerBuy(flags) {
|
|
10
|
+
const showThenWait = shouldReturnAfterAgentTextQR(flags);
|
|
10
11
|
const selectionID = flags.selection || flags.variant || flags.catalog_variant_id || flags.item || flags.catalog_item_id;
|
|
11
12
|
if (!selectionID) throw new Error("catalog variant id is required, for example: itp buy var_pubg_couple_skin_cny20 --sandbox --email buyer@example.com --phone +8613800000000 --json");
|
|
12
13
|
const selection = await resolveBuyerCatalogSelection(selectionID, flags);
|
|
@@ -14,7 +15,7 @@ async function buyerBuy(flags) {
|
|
|
14
15
|
let checkout = await createBuyerCheckoutFromCart(cart, selection, flags);
|
|
15
16
|
if (checkout.next_required_action === "auth_qr" || checkout.identity_status === "waiting_human_auth") {
|
|
16
17
|
await renderHumanAction(checkout.human_action, flags);
|
|
17
|
-
if (flags.no_wait || flags.no_wait_auth) {
|
|
18
|
+
if (flags.no_wait || flags.no_wait_auth || showThenWait) {
|
|
18
19
|
output(buyerRunOutput({
|
|
19
20
|
status: "waiting_human_auth",
|
|
20
21
|
selection,
|
|
@@ -41,15 +42,20 @@ async function buyerBuy(flags) {
|
|
|
41
42
|
: await createBuyerPaymentIntent(checkout.checkout_id, flags);
|
|
42
43
|
await renderItPayPaymentAction(intent, flags);
|
|
43
44
|
|
|
44
|
-
if (flags.no_wait || flags.no_wait_payment) {
|
|
45
|
+
if (flags.no_wait || flags.no_wait_payment || showThenWait) {
|
|
45
46
|
output(buyerRunOutput({
|
|
46
47
|
status: "waiting_user_payment",
|
|
47
48
|
selection,
|
|
48
49
|
cart,
|
|
49
50
|
checkout,
|
|
50
51
|
payment_intent: intent,
|
|
52
|
+
payment_handoff: paymentHandoff(intent),
|
|
51
53
|
agent_next_actions: intent.agent_next_actions || ["wait_payment"],
|
|
52
|
-
next: {
|
|
54
|
+
next: {
|
|
55
|
+
command: paymentWaitCommand(intent.payment_intent_id, { short: true }),
|
|
56
|
+
safe_for_agent: true,
|
|
57
|
+
instruction: "Send payment_handoff.markdown to the human first, then run this wait command unless the human explicitly asked you to pause."
|
|
58
|
+
}
|
|
53
59
|
}));
|
|
54
60
|
return;
|
|
55
61
|
}
|
|
@@ -312,8 +318,16 @@ async function buyer(command, rest, flags) {
|
|
|
312
318
|
status: intent.status === "verified" ? "payment_verified" : "waiting_user_payment",
|
|
313
319
|
checkout,
|
|
314
320
|
payment_intent: intent,
|
|
321
|
+
payment_handoff: intent.status === "verified" ? undefined : paymentHandoff(intent),
|
|
315
322
|
buyer_session: buyerSessionClaimStatus(claimedSession),
|
|
316
|
-
agent_next_actions: intent.agent_next_actions || checkout.agent_next_actions || ["wait_payment"]
|
|
323
|
+
agent_next_actions: intent.agent_next_actions || checkout.agent_next_actions || ["wait_payment"],
|
|
324
|
+
next: intent.status === "verified"
|
|
325
|
+
? { command: cliCommand("buyer", "checkout", "status", checkout.checkout_id, "--json"), safe_for_agent: true }
|
|
326
|
+
: {
|
|
327
|
+
command: paymentWaitCommand(intent.payment_intent_id, { short: true }),
|
|
328
|
+
safe_for_agent: true,
|
|
329
|
+
instruction: "Send payment_handoff.markdown to the human first, then run this wait command unless the human explicitly asked you to pause."
|
|
330
|
+
}
|
|
317
331
|
}));
|
|
318
332
|
return;
|
|
319
333
|
}
|
|
@@ -326,7 +340,18 @@ async function buyer(command, rest, flags) {
|
|
|
326
340
|
}
|
|
327
341
|
const intent = await createBuyerPaymentIntent(checkout.checkout_id, flags);
|
|
328
342
|
await renderItPayPaymentAction(intent, flags);
|
|
329
|
-
output(buyerRunOutput({
|
|
343
|
+
output(buyerRunOutput({
|
|
344
|
+
status: "waiting_user_payment",
|
|
345
|
+
checkout,
|
|
346
|
+
payment_intent: intent,
|
|
347
|
+
payment_handoff: paymentHandoff(intent),
|
|
348
|
+
agent_next_actions: intent.agent_next_actions || ["wait_payment"],
|
|
349
|
+
next: {
|
|
350
|
+
command: paymentWaitCommand(intent.payment_intent_id, { short: true }),
|
|
351
|
+
safe_for_agent: true,
|
|
352
|
+
instruction: "Send payment_handoff.markdown to the human first, then run this wait command unless the human explicitly asked you to pause."
|
|
353
|
+
}
|
|
354
|
+
}));
|
|
330
355
|
return;
|
|
331
356
|
}
|
|
332
357
|
output(buyerRunOutput({
|
|
@@ -367,11 +392,16 @@ async function buyer(command, rest, flags) {
|
|
|
367
392
|
output(buyerRunOutput({
|
|
368
393
|
status: refreshed.status === "verified" ? "payment_verified" : "waiting_user_payment",
|
|
369
394
|
payment_intent: refreshed,
|
|
395
|
+
payment_handoff: refreshed.status === "verified" ? undefined : paymentHandoff(refreshed),
|
|
370
396
|
payment_guidance: paymentRecoveryGuidance(refreshed, { event_type: refreshed.status === "verified" ? "payment_intent.verified" : "qr_refreshed" }),
|
|
371
397
|
agent_next_actions: refreshed.agent_next_actions || paymentAgentNextActions(refreshed, { event_type: refreshed.status === "verified" ? "payment_intent.verified" : "qr_refreshed" }),
|
|
372
398
|
next: refreshed.status === "verified"
|
|
373
399
|
? { command: cliCommand("buyer", "checkout", "status", refreshed.checkout_id, "--json"), safe_for_agent: true }
|
|
374
|
-
: {
|
|
400
|
+
: {
|
|
401
|
+
command: paymentWaitCommand(refreshed.payment_intent_id, { short: true }),
|
|
402
|
+
safe_for_agent: true,
|
|
403
|
+
instruction: "Send payment_handoff.markdown to the human first, then run this wait command unless the human explicitly asked you to pause."
|
|
404
|
+
}
|
|
375
405
|
}));
|
|
376
406
|
return;
|
|
377
407
|
}
|
|
@@ -997,6 +1027,49 @@ function paymentAgentNextActions(intent = {}, event = {}) {
|
|
|
997
1027
|
return ["show_payment_qr_if_needed", "wait_same_payment_intent"];
|
|
998
1028
|
}
|
|
999
1029
|
|
|
1030
|
+
function paymentHandoff(intent = {}) {
|
|
1031
|
+
const action = intent.human_action || {};
|
|
1032
|
+
const paymentIntentID = intent.payment_intent_id || action.id || "";
|
|
1033
|
+
const entryURL = intent.payment_entry_url || intent.payment_url || action.url || "";
|
|
1034
|
+
const qrPNGURL = action.qr_png_url || intent.qr_png_url || intent.qr?.png_url || "";
|
|
1035
|
+
const preferredQRURL = action.preferred_qr_url || qrPNGURL || action.qr_image_url || intent.qr_image_url || intent.qr?.image_url || "";
|
|
1036
|
+
const localQRPath = action.local_qr_path || intent.local_qr_path || "";
|
|
1037
|
+
const mobileWalletURL = action.mobile_wallet_url || intent.mobile_wallet_url || "";
|
|
1038
|
+
const waitCommand = paymentWaitCommand(paymentIntentID, { short: true });
|
|
1039
|
+
return {
|
|
1040
|
+
type: "payment_qr_handoff",
|
|
1041
|
+
payment_intent_id: paymentIntentID || null,
|
|
1042
|
+
checkout_id: intent.checkout_id || null,
|
|
1043
|
+
primary: localQRPath ? "local_qr_path" : (qrPNGURL ? "qr_png_url" : (preferredQRURL ? "preferred_qr_url" : "payment_entry_url")),
|
|
1044
|
+
local_qr_path: localQRPath || null,
|
|
1045
|
+
qr_png_url: qrPNGURL || null,
|
|
1046
|
+
preferred_qr_url: preferredQRURL || null,
|
|
1047
|
+
payment_entry_url: entryURL || null,
|
|
1048
|
+
mobile_wallet_url: mobileWalletURL || null,
|
|
1049
|
+
markdown: paymentHandoffMarkdown({ localQRPath, qrPNGURL, preferredQRURL, entryURL, mobileWalletURL }),
|
|
1050
|
+
wait_command: waitCommand || null,
|
|
1051
|
+
safe_for_agent: true,
|
|
1052
|
+
instruction: "Show markdown to the human first. Then run wait_command and wait for payment_intent.verified unless the human asked you to pause."
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
function paymentHandoffMarkdown({ localQRPath = "", qrPNGURL = "", preferredQRURL = "", entryURL = "", mobileWalletURL = "" } = {}) {
|
|
1057
|
+
const imageURL = localQRPath || qrPNGURL || preferredQRURL;
|
|
1058
|
+
const lines = ["请扫码付款:"];
|
|
1059
|
+
if (imageURL) lines.push(``);
|
|
1060
|
+
if (entryURL) lines.push(`[打开付款页面](${entryURL})`);
|
|
1061
|
+
if (mobileWalletURL) lines.push(`[手机钱包打开](${mobileWalletURL})`);
|
|
1062
|
+
lines.push("我会继续等待 ItPay 返回 payment_intent.verified。");
|
|
1063
|
+
return lines.join("\n\n");
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
function paymentWaitCommand(paymentIntentID, { short = false } = {}) {
|
|
1067
|
+
if (!paymentIntentID) return "";
|
|
1068
|
+
return short
|
|
1069
|
+
? cliCommand("buyer", "payment", "wait", paymentIntentID, "--timeout", "60", "--json")
|
|
1070
|
+
: cliCommand("buyer", "payment", "wait", paymentIntentID, "--json");
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1000
1073
|
function paymentRecoveryGuidance(intent = {}, event = {}) {
|
|
1001
1074
|
const paymentIntentID = intent.payment_intent_id || event.payment_intent_id || null;
|
|
1002
1075
|
return {
|
package/lib/render-human.js
CHANGED
|
@@ -121,7 +121,7 @@ async function renderHumanAction(action, flags = {}) {
|
|
|
121
121
|
}
|
|
122
122
|
return { rendered: false, mode: flags.json ? "json" : mode };
|
|
123
123
|
}
|
|
124
|
-
const host =
|
|
124
|
+
const host = agentHost(flags);
|
|
125
125
|
if (["discord", "telegram", "whatsapp"].includes(host)) {
|
|
126
126
|
return { rendered: false, mode: "chat-json", host };
|
|
127
127
|
}
|
|
@@ -356,8 +356,8 @@ function formatActionTime(value) {
|
|
|
356
356
|
|
|
357
357
|
function shouldUseAgentTextQR(flags = {}) {
|
|
358
358
|
const mode = String(flags.display || process.env.ITP_DISPLAY || "").toLowerCase() || "auto";
|
|
359
|
-
const host =
|
|
360
|
-
return mode === "chat" || mode === "agent" || (
|
|
359
|
+
const host = agentHost(flags);
|
|
360
|
+
return mode === "chat" || mode === "agent" || (agentTextQRHosts().has(host) && mode === "auto");
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
function shouldReturnAfterAgentTextQR(flags = {}) {
|
|
@@ -365,6 +365,18 @@ function shouldReturnAfterAgentTextQR(flags = {}) {
|
|
|
365
365
|
return shouldUseAgentTextQR(flags);
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
+
function agentHost(flags = {}) {
|
|
369
|
+
const explicit = String(process.env.ITP_HOST || flags.host || "").toLowerCase();
|
|
370
|
+
if (explicit) return explicit;
|
|
371
|
+
if (process.env.CODEX_THREAD_ID || process.env.CODEX_SHELL || process.env.CODEX_CI) return "codex";
|
|
372
|
+
if (process.env.CLAUDECODE || process.env.CLAUDE_CODE || process.env.CLAUDECODE_SESSION_ID) return "claude-code";
|
|
373
|
+
return "";
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
function agentTextQRHosts() {
|
|
377
|
+
return new Set(["codex", "codex-cli", "claude", "claude-code", "gemini", "gemini-cli"]);
|
|
378
|
+
}
|
|
379
|
+
|
|
368
380
|
function attachAgentQRImage(action, qrImageURL, localPath = "") {
|
|
369
381
|
if (!action || !qrImageURL) return action;
|
|
370
382
|
action.preferred_qr_url = qrImageURL;
|
package/package.json
CHANGED
|
@@ -59,7 +59,7 @@ read this skill
|
|
|
59
59
|
The high-level command can wrap this flow:
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
|
-
itp buy <variant_id> --sandbox --email <buyer_email> --phone <buyer_phone> --json
|
|
62
|
+
itp buy <variant_id> --sandbox --email <buyer_email> --phone <buyer_phone> --display agent --no-wait-payment --json
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
For step-by-step testing:
|
|
@@ -93,7 +93,7 @@ itp buyer cart create --variant var_itpay_enterprise_fuzzy_search_cny01 --input
|
|
|
93
93
|
itp buyer cart show <cart_id> --json
|
|
94
94
|
itp buyer cart add <cart_id> --variant var_itpay_enterprise_fuzzy_search_cny01 --input company_name=美团 --json
|
|
95
95
|
itp buyer cart create --variant var_itpay_enterprise_precise_lookup_cny05 --input company_name_or_credit_no=北京京东世纪贸易有限公司 --json
|
|
96
|
-
itp buy var_itpay_enterprise_fuzzy_search_cny01 --sandbox --email <buyer_email> --input company_name=京东 --json
|
|
96
|
+
itp buy var_itpay_enterprise_fuzzy_search_cny01 --sandbox --email <buyer_email> --input company_name=京东 --display agent --no-wait-payment --json
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
For cart edits, always read the server cart first with `buyer cart show`.
|
|
@@ -206,13 +206,16 @@ Each docs page includes `next_docs`. Follow those links as the state changes.
|
|
|
206
206
|
For payment creation in an agent/chat client, prefer:
|
|
207
207
|
|
|
208
208
|
```bash
|
|
209
|
-
itp buy <variant_id> --sandbox --email <buyer_email> --phone <buyer_phone> --display agent --json
|
|
209
|
+
itp buy <variant_id> --sandbox --email <buyer_email> --phone <buyer_phone> --display agent --no-wait-payment --json
|
|
210
210
|
```
|
|
211
211
|
|
|
212
212
|
This keeps JSON output machine-readable while allowing the CLI to prepare a
|
|
213
|
-
local QR image path for clients that cannot render remote SVG reliably.
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
local QR image path for clients that cannot render remote SVG reliably. In
|
|
214
|
+
Codex or Claude Code app clients, prefer `--no-wait-payment`: send
|
|
215
|
+
`payment_handoff.markdown` to the human first, then run
|
|
216
|
+
`payment_handoff.wait_command`. If the human is on mobile, present
|
|
217
|
+
`mobile_wallet_url` as a clickable human-only fallback; do not convert it into a
|
|
218
|
+
QR.
|
|
216
219
|
|
|
217
220
|
For first-purchase auth, treat the returned ItPay authorization entry as a
|
|
218
221
|
single human orchestration entry. It may open Alipay login/registration first
|