@alipay/alipay-aipay 1.0.0 → 1.0.2

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.
Files changed (117) hide show
  1. package/bin/alipay-aipay.js +6 -0
  2. package/dist/commands/install.d.ts +11 -0
  3. package/dist/commands/install.d.ts.map +1 -0
  4. package/dist/commands/install.js +182 -0
  5. package/dist/commands/install.js.map +1 -0
  6. package/dist/commands/prepare-tools.d.ts +5 -0
  7. package/dist/commands/prepare-tools.d.ts.map +1 -0
  8. package/dist/commands/prepare-tools.js +29 -0
  9. package/dist/commands/prepare-tools.js.map +1 -0
  10. package/dist/commands/uninstall.d.ts +10 -0
  11. package/dist/commands/uninstall.d.ts.map +1 -0
  12. package/dist/commands/uninstall.js +82 -0
  13. package/dist/commands/uninstall.js.map +1 -0
  14. package/dist/commands/update.d.ts +10 -0
  15. package/dist/commands/update.d.ts.map +1 -0
  16. package/dist/commands/update.js +155 -0
  17. package/dist/commands/update.js.map +1 -0
  18. package/dist/index.d.ts +2 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +65 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/types.d.ts +43 -0
  23. package/dist/types.d.ts.map +1 -0
  24. package/dist/types.js +2 -0
  25. package/dist/types.js.map +1 -0
  26. package/dist/utils/alipay-cli.d.ts +15 -0
  27. package/dist/utils/alipay-cli.d.ts.map +1 -0
  28. package/dist/utils/alipay-cli.js +221 -0
  29. package/dist/utils/alipay-cli.js.map +1 -0
  30. package/dist/utils/config.d.ts +48 -0
  31. package/dist/utils/config.d.ts.map +1 -0
  32. package/dist/utils/config.js +207 -0
  33. package/dist/utils/config.js.map +1 -0
  34. package/dist/utils/file.d.ts +55 -0
  35. package/dist/utils/file.d.ts.map +1 -0
  36. package/dist/utils/file.js +154 -0
  37. package/dist/utils/file.js.map +1 -0
  38. package/dist/utils/gpg.d.ts +14 -0
  39. package/dist/utils/gpg.d.ts.map +1 -0
  40. package/dist/utils/gpg.js +247 -0
  41. package/dist/utils/gpg.js.map +1 -0
  42. package/dist/utils/jq.d.ts +14 -0
  43. package/dist/utils/jq.d.ts.map +1 -0
  44. package/dist/utils/jq.js +221 -0
  45. package/dist/utils/jq.js.map +1 -0
  46. package/dist/utils/npm.d.ts +17 -0
  47. package/dist/utils/npm.d.ts.map +1 -0
  48. package/dist/utils/npm.js +42 -0
  49. package/dist/utils/npm.js.map +1 -0
  50. package/dist/utils/shell.d.ts +11 -0
  51. package/dist/utils/shell.d.ts.map +1 -0
  52. package/dist/utils/shell.js +54 -0
  53. package/dist/utils/shell.js.map +1 -0
  54. package/package.json +48 -7
  55. package/skill/SKILL.md +118 -0
  56. package/skill/references/integration/flow.md +487 -0
  57. package/skill/references/integration/modules/alipay-sdk-reminder.md +256 -0
  58. package/skill/references/integration/modules/checklist.md +122 -0
  59. package/skill/references/integration/modules/code-examples/csharp/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/345/205/263/351/227/255/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +68 -0
  60. package/skill/references/integration/modules/code-examples/csharp/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +77 -0
  61. package/skill/references/integration/modules/code-examples/csharp/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +74 -0
  62. package/skill/references/integration/modules/code-examples/csharp/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +73 -0
  63. package/skill/references/integration/modules/code-examples/csharp/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +58 -0
  64. package/skill/references/integration/modules/code-examples/csharp/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +128 -0
  65. package/skill/references/integration/modules/code-examples/csharp/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.cs +500 -0
  66. package/skill/references/integration/modules/code-examples/java/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/345/205/263/351/227/255/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +72 -0
  67. package/skill/references/integration/modules/code-examples/java/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +80 -0
  68. package/skill/references/integration/modules/code-examples/java/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +78 -0
  69. package/skill/references/integration/modules/code-examples/java/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +77 -0
  70. package/skill/references/integration/modules/code-examples/java/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +66 -0
  71. package/skill/references/integration/modules/code-examples/java/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +135 -0
  72. package/skill/references/integration/modules/code-examples/java/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemoController.java +610 -0
  73. package/skill/references/integration/modules/code-examples/nodejs/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/345/205/263/351/227/255/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +51 -0
  74. package/skill/references/integration/modules/code-examples/nodejs/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +57 -0
  75. package/skill/references/integration/modules/code-examples/nodejs/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +55 -0
  76. package/skill/references/integration/modules/code-examples/nodejs/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +54 -0
  77. package/skill/references/integration/modules/code-examples/nodejs/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +77 -0
  78. package/skill/references/integration/modules/code-examples/nodejs/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +65 -0
  79. package/skill/references/integration/modules/code-examples/nodejs/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.js +461 -0
  80. package/skill/references/integration/modules/code-examples/php/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/345/205/263/351/227/255/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +59 -0
  81. package/skill/references/integration/modules/code-examples/php/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +67 -0
  82. package/skill/references/integration/modules/code-examples/php/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +66 -0
  83. package/skill/references/integration/modules/code-examples/php/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +65 -0
  84. package/skill/references/integration/modules/code-examples/php/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +56 -0
  85. package/skill/references/integration/modules/code-examples/php/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +107 -0
  86. package/skill/references/integration/modules/code-examples/php/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.php +444 -0
  87. package/skill/references/integration/modules/code-examples/python/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/345/205/263/351/227/255/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +57 -0
  88. package/skill/references/integration/modules/code-examples/python/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +65 -0
  89. package/skill/references/integration/modules/code-examples/python/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +63 -0
  90. package/skill/references/integration/modules/code-examples/python/1-/351/200/232/347/224/250/346/216/245/345/217/243//347/273/237/344/270/200/346/224/266/345/215/225/344/272/244/346/230/223/351/200/200/346/254/276/346/237/245/350/257/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +62 -0
  91. package/skill/references/integration/modules/code-examples/python/2-/347/275/221/347/253/231/346/224/257/344/273/230//347/273/237/344/270/200/346/224/266/345/215/225/344/270/213/345/215/225/345/271/266/346/224/257/344/273/230/351/241/265/351/235/242/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +48 -0
  92. package/skill/references/integration/modules/code-examples/python/3-APP/346/224/257/344/273/230/APP/346/224/257/344/273/230/346/216/245/345/217/243/344/273/243/347/240/201/347/244/272/344/276/213.md +43 -0
  93. package/skill/references/integration/modules/code-examples/python/4-/346/214/211/351/207/217/344/273/230/350/264/271/A2MPaymentDemo.py +465 -0
  94. package/skill/references/integration/modules/interface-guide.md +90 -0
  95. package/skill/references/integration/modules/product-decision.md +90 -0
  96. package/skill/references/integration/modules/sandbox/a2m-sandbox-test.md +270 -0
  97. package/skill/references/integration/modules/sandbox/alipay-sandbox-tool.md +133 -0
  98. package/skill/references/integration/modules/sandbox/sandbox-setup-guide.md +218 -0
  99. package/skill/references/integration/modules/scripts/local_402_sandbox_pay.py +659 -0
  100. package/skill/references/normal/alipay-cli-env.md +214 -0
  101. package/skill/references/normal/rejection-guide.md +37 -0
  102. package/skill/references/normal/scripts/common.sh +32 -0
  103. package/skill/references/normal/scripts/detect_dev_tool.sh +46 -0
  104. package/skill/references/onboarding/flow.md +573 -0
  105. package/skill/references/onboarding/modules/app-release.md +415 -0
  106. package/skill/references/onboarding/modules/authorization.md +269 -0
  107. package/skill/references/onboarding/modules/error-handling.md +251 -0
  108. package/skill/references/onboarding/modules/mcc-reference.md +209 -0
  109. package/skill/references/onboarding/modules/product-sign.md +304 -0
  110. package/skill/references/onboarding/modules/scripts/app.sh +705 -0
  111. package/skill/references/onboarding/modules/scripts/ar_sign_apply.sh +248 -0
  112. package/skill/references/onboarding/modules/scripts/auth.sh +505 -0
  113. package/skill/references/onboarding/modules/scripts/error_handler.sh +452 -0
  114. package/skill/references/onboarding/modules/scripts/query_sign_status.sh +146 -0
  115. package/skill/references/onboarding/modules/scripts/service.sh +267 -0
  116. package/skill/references/onboarding/modules/scripts/upload_screenshots.sh +152 -0
  117. package/skill/references/onboarding/modules/service-registration.md +294 -0
@@ -0,0 +1,304 @@
1
+ # 产品签约模块
2
+
3
+ > 本文档定义产品签约的完整流程、参数规范和状态判断逻辑。
4
+ > 被引用文档:`SKILL.md` → Step 5 入驻推进 - 签约部分
5
+ > 本文档位于 `references/onboarding/modules/`,文中的 `scripts/...` 路径相对本目录;从技能包根目录执行时对应 `references/onboarding/modules/scripts/...`。
6
+
7
+ ---
8
+
9
+ ## 功能概述
10
+
11
+ 签约模块负责产品签约流程,包括签约状态查询和签约申请提交。
12
+
13
+ 本模块采用 `ar-sign.apply` **外部直调 / 静态参数模式**:由 `scripts/ar_sign_apply.sh` 基于当前已确认的产品类型、MCC 和资料字段直接构造 `businessProperty` 后提交申请。它不走 `previewFormView` 动态 schema 收集循环,因此只覆盖本文档明确列出的字段和产品。
14
+
15
+ **触发条件:** Step 3.1 授权后处理中,签约状态为 NOT_SIGNED 时触发。
16
+
17
+ ---
18
+
19
+ ## MCP能力
20
+
21
+ | MCP Server | 方法 | 用途 |
22
+ |------------|------|------|
23
+ | `ar-sign` | `apply` | 提交签约申请(主流程使用) |
24
+ | `ar-query` | `queryArInfosBySalesProd` | 按前台产品码查询合约状态 |
25
+ | `ar-query` | `queryArInfosByBackProd` | 按后台产品码查询合约状态 |
26
+ | `ar-order-query` | `queryBizOrder` | 按订单号查询签约订单 |
27
+
28
+ > **注意:** 通过 `scripts/ar_sign_apply.sh` 提交签约申请。
29
+
30
+ ---
31
+
32
+ ## 签约状态查询
33
+
34
+ ### 查询命令
35
+
36
+ 执行 `scripts/query_sign_status.sh --sales-code <当前产品码> --product-type <aipay|webpay|apppay>`。
37
+
38
+ ### 状态判断规则
39
+
40
+ **根据 `ar-query.queryArInfosBySalesProd` 返回结果判断签约状态:**
41
+
42
+ | 返回结果 | 状态判定 | 说明 |
43
+ |----------|----------|------|
44
+ | `resultObj.arInfoList` 为空数组 `[]` | `NOT_SIGNED` | 未签约 |
45
+ | `resultObj.arInfoList` 不为空,且存在 `arStatus` 为 `"02"` 的记录 | `SIGNED_EFFECTIVE` | 签约已生效,跳过资料采集 |
46
+ | `resultObj.arInfoList` 不为空,且存在 `arStatus` 为 `"01"` 的记录 | `SIGN_SUBMITTED` | 已提交签约(待生效),跳过资料采集与重复签约提交 |
47
+
48
+ ### 判断逻辑
49
+
50
+ `scripts/query_sign_status.sh` 自动完成以下状态判断并输出状态信号(`SIGN_STATUS=...`)与分支信号(`FLOW:PC_WEB_NOT_SIGNED` 等)。`SIGNED_EFFECTIVE` 与 `SIGN_SUBMITTED` 的后续 FLOW 保持一致,均不重复提交签约,继续应用发布/服务注册。
51
+
52
+ ### 产品×状态分支处理表
53
+
54
+ | 签约状态 | 产品类型 | FLOW 信号 | 后续流程 |
55
+ |----------|----------|-----------|----------|
56
+ | `NOT_SIGNED` | 网站支付 | `FLOW:PC_WEB_NOT_SIGNED` | 进入 Step 4 资料采集(3张网站截图)→ Step 5 签约 + 应用发布 |
57
+ | `NOT_SIGNED` | APP支付 | `FLOW:APP_NOT_SIGNED` | 进入 Step 4 资料采集(APP名称 + 3张APP界面截图)→ Step 5 签约 + 应用发布 |
58
+ | `NOT_SIGNED` | 按量付费 | `FLOW:AI_PAY_NOT_SIGNED` | 跳过 Step 4,进入 Step 5.1 签约,再继续服务注册 + 应用发布 |
59
+ | `SIGNED_EFFECTIVE` | 网站支付 | `FLOW:PC_WEB_SIGNED` | 跳过签约提交,直接执行应用发布 |
60
+ | `SIGNED_EFFECTIVE` | APP支付 | `FLOW:APP_SIGNED` | 跳过签约提交,直接执行应用发布 |
61
+ | `SIGNED_EFFECTIVE` | 按量付费 | `FLOW:AI_PAY_SIGNED` | 跳过签约提交,直接执行服务注册 + 应用发布 |
62
+ | `SIGN_SUBMITTED` | 网站支付 | `FLOW:PC_WEB_SIGNED` | 跳过重复签约提交,直接执行应用发布 |
63
+ | `SIGN_SUBMITTED` | APP支付 | `FLOW:APP_SIGNED` | 跳过重复签约提交,直接执行应用发布 |
64
+ | `SIGN_SUBMITTED` | 按量付费 | `FLOW:AI_PAY_SIGNED` | 跳过重复签约提交,直接执行服务注册 + 应用发布 |
65
+
66
+ **⚠️ 按量付费 无需前置资料采集:**
67
+ ```
68
+ ✅ 网站支付未签约:需先采集 3 张网站截图,再进入 Step 5 签约
69
+ ✅ APP支付未签约:需先采集 APP 名称和 3 张APP界面截图,再进入 Step 5 签约
70
+ ✅ 按量付费 未签约:跳过 Step 4,进入 Step 5.1 签约,再继续服务注册 + 应用发布
71
+ ❌ 禁止:按量付费 在 Step 4 收集服务注册信息(服务信息在 Step 5 服务注册时交互式收集)
72
+ ```
73
+
74
+ **按量付费签约后的必要后续动作:**
75
+ ```
76
+ ✅ 未签约且提交成功:继续服务市场注册 + 应用发布
77
+ ✅ 已签约:跳过签约提交,继续服务市场注册 + 应用发布
78
+ ❌ 禁止:只完成产品签约就宣称按量付费入驻完成
79
+ ❌ 禁止:已签约状态下重复提交签约申请
80
+ ```
81
+
82
+ 按量付费最终接入至少需要三类正式产物:产品签约状态、服务市场的 `serviceId`、应用发布或复用得到的 `appId` 与支付宝公钥。签约模块只解决第一类产物。
83
+
84
+ ---
85
+
86
+ ## 签约提交
87
+
88
+ **执行 `scripts/ar_sign_apply.sh` 提交签约申请。脚本通过 `error_handler.sh` 间接初始化 `DEV_TOOL_NAME`;产品码和类目编码优先通过 `--sales-code`、`--mcc-code` 显式传入。**
89
+
90
+ ```bash
91
+ # 按量付费
92
+ bash scripts/ar_sign_apply.sh --product aipay --sales-code "I1080300001000160457" --mcc-code "<mccCode>"
93
+
94
+ # 网站支付
95
+ bash scripts/ar_sign_apply.sh --product webpay --sales-code "I1080300001000041203" --mcc-code "<mccCode>" --picurl1 <imageRef1> --picurl2 <imageRef2> --picurl3 <imageRef3>
96
+
97
+ # APP支付
98
+ bash scripts/ar_sign_apply.sh --product apppay --sales-code "I1080300001000041313" --mcc-code "<mccCode>" --app-name "<APP名称>" --picurl1 <imageRef1> --picurl2 <imageRef2> --picurl3 <imageRef3>
99
+ ```
100
+
101
+ ### 与动态表单签约流程的边界
102
+
103
+ | 项目 | 当前 onboarding 签约 | 动态表单签约流程 |
104
+ |------|----------------------|------------------------|
105
+ | 调用模式 | 外部直调 `ar-sign.apply` | 默认先 `previewFormView`,再按动态 schema 收集并 apply |
106
+ | 字段来源 | 本文档静态定义的三类产品字段 | `previewFormView` 返回的 `artisanPage` schema |
107
+ | 覆盖产品 | 按量付费、网站支付、APP支付 | 由产品推荐和 schema 决定 |
108
+ | 风险边界 | 后端新增/调整字段时,需同步更新本文档和脚本 | schema 变化会在 preview 流程中动态体现 |
109
+
110
+ > 如果后端签约字段发生变化,或当前静态字段提交被 `checkedError` 拒绝,应以 `previewFormView` 返回 schema 为准补齐字段,禁止在本模块中凭经验新增未确认字段。
111
+
112
+ ### 网站支付签约 JSON(有截图)
113
+
114
+ ```json
115
+ {
116
+ "request": {
117
+ "bizFeatures": {},
118
+ "bizRequestNo": "<UUID>",
119
+ "businessProperty": {
120
+ "mccCode": "${MCC_CODE}",
121
+ "webAppDTO": {
122
+ "placeType": "ONLINE_WEBAPP",
123
+ "appType": "PC_WEB",
124
+ "appStatus": "OFFLINE",
125
+ "screenshot": ["<imageRef1>", "<imageRef2>", "<imageRef3>"]
126
+ }
127
+ },
128
+ "channelCode": "B_SK_SH_RPC",
129
+ "extension": {},
130
+ "orderType": "NEW_SIGN",
131
+ "salesProductCodes": ["I1080300001000041203"]
132
+ },
133
+ "ctx": {}
134
+ }
135
+ ```
136
+
137
+ ### APP支付签约 JSON(有 APP 名称和截图)
138
+
139
+ ```json
140
+ {
141
+ "request": {
142
+ "bizFeatures": {},
143
+ "bizRequestNo": "<UUID>",
144
+ "businessProperty": {
145
+ "mccCode": "${MCC_CODE}",
146
+ "nativeAppDTO": {
147
+ "placeType": "ONLINE_NATIVEYAPP",
148
+ "name": "<APP名称>",
149
+ "appStatus": "OFFLINE",
150
+ "screenshot": ["<imageRef1>", "<imageRef2>", "<imageRef3>"]
151
+ }
152
+ },
153
+ "channelCode": "B_SK_SH_RPC",
154
+ "extension": {},
155
+ "orderType": "NEW_SIGN",
156
+ "salesProductCodes": ["I1080300001000041313"]
157
+ },
158
+ "ctx": {}
159
+ }
160
+ ```
161
+
162
+ > APP支付本次固定按 `appStatus=OFFLINE` 提交,不传 `appDownloadUrl`。
163
+
164
+ ### 按量付费签约 JSON(无截图)
165
+
166
+ ```json
167
+ {
168
+ "request": {
169
+ "bizFeatures": {},
170
+ "bizRequestNo": "<UUID>",
171
+ "businessProperty": {
172
+ "mccCode": "${MCC_CODE}"
173
+ },
174
+ "channelCode": "B_SK_SH_RPC",
175
+ "extension": {},
176
+ "orderType": "NEW_SIGN",
177
+ "salesProductCodes": ["I1080300001000160457"]
178
+ },
179
+ "ctx": {}
180
+ }
181
+ ```
182
+
183
+ ### 关键变量
184
+
185
+ | 变量 | 来源 | 说明 |
186
+ |------|------|------|
187
+ | `bizRequestNo` | 主技能生成 | UUID,每次签约提交前通过 `python3 -c "import uuid; print(uuid.uuid4())"` 生成,**禁止省略** |
188
+ | `mccCode` | Step 2 方案规划 | 运行时变量,格式 `Axxxx_Bxxxx`,不持久化到状态文件 |
189
+ | `channelCode` | 固定值 | `"B_SK_SH_RPC"` |
190
+ | `orderType` | 固定值 | `"NEW_SIGN"` |
191
+ | `screenshot` | Step 4 资料采集 | **仅网站支付/APP支付需要**(3个上传后的图片引用值),按量付费 无需此项 |
192
+ | `appName` | Step 4 资料采集 | **仅APP支付需要**;脚本参数仍为 `--app-name`,提交到 MCP 时映射为 `nativeAppDTO.name` |
193
+ | `appStatus` | 固定值 | **仅APP支付需要**,本次固定为 `OFFLINE` |
194
+
195
+ ### 按量付费接入产物映射
196
+
197
+ | 集成字段 | 来源 | 说明 |
198
+ |----------|------|------|
199
+ | `sellerId` | 商户 PID / 2088 账号 | 通常来自沙箱或正式商户账号信息;不要用示例商户号 |
200
+ | `serviceId` | Step 5.2 服务市场注册/复用结果 | 写入 `Payment-Needed.method.service_id` |
201
+ | `seller_app_id` / `appId` | Step 5.3 应用发布/复用结果 | 写入 SDK 配置和 `Payment-Needed.method.seller_app_id` |
202
+ | `alipayPublicKey` | Step 5.3 应用发布/复用导出结果 | 用于 SDK 验签配置 |
203
+
204
+ 签约成功不直接产出 `serviceId` 或 `appId`。后续集成代码需要这些值时,必须从服务注册和应用发布步骤读取,禁止沿用示例值。
205
+
206
+ ### ⛔ 截图字段规则
207
+
208
+ ```
209
+ ✅ 网站支付未签约 → 需要 3 张网站截图(首页、商品页、支付页)
210
+ ✅ APP支付未签约 → 需要 APP 名称和 3 张APP界面截图(首页、商品页、支付页),签约状态固定按 OFFLINE 提交
211
+ ✅ 按量付费 未签约 → 无需截图,直接签约
212
+ ❌ 禁止:按量付费 签约时传入 screenshot 字段
213
+ ❌ 禁止:网站支付/APP支付 签约时省略 screenshot 字段
214
+ ❌ 禁止:APP支付签约 MCP payload 中使用 webAppDTO、appDTO、appName、appType、placeType=APP、placeType=ONLINE_WEBAPP、placeType=ONLINE_NATIVEAPP 或 appType=PC_WEB
215
+ ```
216
+
217
+ ### 截图字段规则
218
+
219
+ 截图字段以动态表单签约流程的映射为准:`webSiteInfo.screenshot[].picUrl` / `commonAppDeviceInfo.screenshot[].picUrl` 扁平化为 `webAppDTO.screenshot[]` / `nativeAppDTO.screenshot[]` 的图片引用数组。
220
+
221
+ 因此 `ar_sign_apply.sh` 使用 `--picurl1/2/3` 接收上传后的图片引用值。如果 `upload_screenshots.sh` 未能从上传结果中解析出可用于签约的图片引用值,应停止流程并让用户重新上传图片。
222
+
223
+ ---
224
+
225
+ ## 签约提交后非阻塞推进
226
+
227
+ > ⚠️ **签约提交成功后,无需等待签约审核通过,应立即继续推进后续步骤。**
228
+
229
+ 签约申请提交后,后端会异步审核,`arStatus` 为 `"01"`(已提交待生效)。应用创建和服务注册不依赖签约审核通过,可以并行推进。
230
+
231
+ ### FLOW 信号
232
+
233
+ `ar_sign_apply.sh` 签约成功后输出 FLOW 信号,指示后续步骤:
234
+
235
+ | FLOW 信号 | 产品类型 | 后续步骤 |
236
+ |-----------|----------|----------|
237
+ | `FLOW:AI_PAY_SIGN_CONTINUE` | 按量付费 | 立即继续 5.2 服务注册 + 5.3 应用发布 |
238
+ | `FLOW:PC_WEB_SIGN_CONTINUE` | 网站支付 | 立即继续 5.3 应用发布 |
239
+ | `FLOW:APP_SIGN_CONTINUE` | APP支付 | 立即继续 5.3 应用发布 |
240
+
241
+ ### 处理原则
242
+
243
+ ```
244
+ ✅ 签约提交成功 → 立即推进 5.2/5.3,无需等待签约审核
245
+ ✅ 按量付费:5.1 签约 → 5.2 服务注册 → 5.3 应用发布(串行推进)
246
+ ✅ 网站支付/APP支付:5.1 签约 → 5.3 应用发布(串行推进)
247
+ ❌ 禁止:签约提交后停住,等待签约审核通过再继续
248
+ ❌ 禁止:轮询签约状态直到 arStatus变为"02"再继续
249
+ ```
250
+
251
+ ---
252
+
253
+ ## 签约输出规范
254
+
255
+ ### 签约信息(含费率免责声明)
256
+
257
+ 当签约信息包含费率时,**必须附加免责声明**:
258
+
259
+ ```markdown
260
+ 📋 签约信息:
261
+ • 签约状态:[状态]
262
+ • 费率:[费率值]
263
+
264
+ > 由于支付宝可能会有阶段性的优惠活动,实际费率可能低于该页面费率,具体以相应费用账单为准。
265
+ ```
266
+
267
+ **费率免责声明规则:**
268
+ - ✅ 必须:在展示费率信息的同一区域,紧随费率信息之后添加免责声明
269
+ - ✅ 必须:免责声明使用引用块格式(`>` 开头)突出显示
270
+ - ❌ 禁止:单独展示费率信息而不附加免责声明
271
+ - ℹ️ 如果签约信息中不包含费率字段,则无需添加免责声明
272
+
273
+ ---
274
+
275
+ ## 签约错误处理
276
+
277
+ ### 后端错误响应格式
278
+
279
+ ```json
280
+ {
281
+ "errorCode": "xxx",
282
+ "errorMessage": "错误描述",
283
+ "bizTips": "业务提示(可展示给用户)",
284
+ "needRetry": true
285
+ }
286
+ ```
287
+
288
+ | 场景 | 处理方式 |
289
+ |------|----------|
290
+ | errorCode 存在 | 展示 errorMessage,如有 bizTips 一并展示 |
291
+ | needRetry=true | 告知用户可以重试 |
292
+ | checkedError | 提取校验错误信息,引导用户修正字段 |
293
+
294
+ ### 授权信息不匹配错误
295
+
296
+ > 📎 统一错误检测见 `error-handling.md` 第三节"授权信息不匹配"。
297
+
298
+ ---
299
+
300
+ ## 数据存储
301
+
302
+ | 文件 | 说明 |
303
+ |------|------|
304
+ | 无独立持久化 | 签约数据由 MCP 返回,主技能直接消费,不持久化到本地文件 |