新增支付服务接入与订单收银台
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m59s
Project CI / Backend tests (pull_request) Failing after 4m8s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m9s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m20s
Project CI / Frontend tests (pull_request) Successful in 3m17s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m48s
Project CI / Repository checks (pull_request) Failing after 4m15s
Project CI / Native shell tests (pull_request) Successful in 6m52s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m59s
Project CI / Backend tests (pull_request) Failing after 4m8s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m9s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m20s
Project CI / Frontend tests (pull_request) Successful in 3m17s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m48s
Project CI / Repository checks (pull_request) Failing after 4m15s
Project CI / Native shell tests (pull_request) Successful in 6m52s
新增支付应用、API Key 与外部产品订单接口 接入微信 Native 下单、二维码收银台与支付结果回调 新增后台支付订单与回调投递页面 补齐 SpacetimeDB 支付表、生成绑定、OpenAPI 与使用说明
This commit is contained in:
@@ -43,6 +43,10 @@
|
||||
{
|
||||
"name": "Agent Integration",
|
||||
"description": "远程 MCP、OpenAPI 和完整 Skill 包发现"
|
||||
},
|
||||
{
|
||||
"name": "Payment",
|
||||
"description": "平台统一收款与 Web 收银台"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
@@ -1614,6 +1618,52 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/external/v1/payment/orders": {
|
||||
"post": {
|
||||
"tags": ["Payment"],
|
||||
"operationId": "createExternalPaymentOrder",
|
||||
"summary": "创建支付订单并返回收银台地址",
|
||||
"description": "使用支付应用 API Key 创建平台统一收款订单。支付金额按整数分传入;支付成功必须以平台通知或服务端查单为准。",
|
||||
"security": [{"PaymentApiKey": []}],
|
||||
"parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {"$ref": "#/components/schemas/PaymentOrderCreateRequest"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "支付订单与收银台信息",
|
||||
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentOrderCreateResponse"}}}
|
||||
},
|
||||
"400": {"$ref": "#/components/responses/BadRequest"},
|
||||
"401": {"$ref": "#/components/responses/Unauthorized"},
|
||||
"403": {"$ref": "#/components/responses/Forbidden"},
|
||||
"502": {"$ref": "#/components/responses/UpstreamError"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/external/v1/payment/orders/{orderId}": {
|
||||
"get": {
|
||||
"tags": ["Payment"],
|
||||
"operationId": "getExternalPaymentOrder",
|
||||
"summary": "查询支付订单",
|
||||
"security": [{"PaymentApiKey": []}],
|
||||
"parameters": [{"name": "orderId", "in": "path", "required": true, "schema": {"type": "string"}}],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "支付订单",
|
||||
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentOrderCreateResponse"}}}
|
||||
},
|
||||
"401": {"$ref": "#/components/responses/Unauthorized"},
|
||||
"403": {"$ref": "#/components/responses/Forbidden"},
|
||||
"404": {"$ref": "#/components/responses/NotFound"}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
@@ -1622,6 +1672,11 @@
|
||||
"type": "http",
|
||||
"scheme": "bearer",
|
||||
"bearerFormat": "tnr_sk"
|
||||
},
|
||||
"PaymentApiKey": {
|
||||
"type": "http",
|
||||
"scheme": "bearer",
|
||||
"bearerFormat": "tnr_pay"
|
||||
}
|
||||
},
|
||||
"parameters": {
|
||||
@@ -1747,6 +1802,47 @@
|
||||
}
|
||||
},
|
||||
"schemas": {
|
||||
"PaymentOrderCreateRequest": {
|
||||
"type": "object",
|
||||
"required": ["merchantOrderId", "title", "amountCents"],
|
||||
"properties": {
|
||||
"merchantOrderId": {"type": "string", "minLength": 1, "maxLength": 96},
|
||||
"title": {"type": "string", "minLength": 1, "maxLength": 128},
|
||||
"items": {"type": "array", "items": {"type": "object", "additionalProperties": true}},
|
||||
"amountCents": {"type": "integer", "minimum": 1},
|
||||
"currency": {"type": "string", "default": "CNY"},
|
||||
"provider": {"type": "string", "enum": ["wechat_native"], "default": "wechat_native"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"PaymentOrder": {
|
||||
"type": "object",
|
||||
"required": ["orderId", "appId", "merchantOrderId", "title", "items", "amountCents", "currency", "provider", "checkoutToken", "status", "checkoutUrl", "createdAt", "expiresAt", "updatedAt"],
|
||||
"properties": {
|
||||
"orderId": {"type": "string"},
|
||||
"appId": {"type": "string"},
|
||||
"merchantOrderId": {"type": "string"},
|
||||
"title": {"type": "string"},
|
||||
"items": {"type": "array", "items": {"type": "object", "additionalProperties": true}},
|
||||
"amountCents": {"type": "integer", "minimum": 1},
|
||||
"currency": {"type": "string"},
|
||||
"provider": {"type": "string", "enum": ["wechat_native"]},
|
||||
"providerTradeNo": {"type": ["string", "null"]},
|
||||
"checkoutToken": {"type": "string"},
|
||||
"status": {"type": "string", "enum": ["pending", "paying", "paid", "expired", "closed", "refunded"]},
|
||||
"checkoutUrl": {"type": "string"},
|
||||
"providerQrCode": {"type": ["string", "null"]},
|
||||
"createdAt": {"type": "string", "format": "date-time"},
|
||||
"expiresAt": {"type": "string", "format": "date-time"},
|
||||
"paidAt": {"type": ["string", "null"], "format": "date-time"},
|
||||
"updatedAt": {"type": "string", "format": "date-time"}
|
||||
}
|
||||
},
|
||||
"PaymentOrderCreateResponse": {
|
||||
"type": "object",
|
||||
"required": ["order"],
|
||||
"properties": {"order": {"$ref": "#/components/schemas/PaymentOrder"}}
|
||||
},
|
||||
"ExternalEditorProjectCreateRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in New Issue
Block a user