优化
增加账户相关交易接口
增加专款账户设计
优化错误返回结果
diff --git a/payapi-spec/accountapi.yaml b/payapi-spec/accountapi.yaml
index 93b7ad6..08c83a0 100644
--- a/payapi-spec/accountapi.yaml
+++ b/payapi-spec/accountapi.yaml
@@ -13,6 +13,8 @@
title: 子账户列表
type: array
items:
+ description: |
+ 需要查询的子账户名,如果查询所有子账户可以用 ['*'] 来查询
type: string
title: 子账户ID
AccountQueryResponse:
@@ -45,7 +47,6 @@
title: 预授权交易请求
required:
- userid
- - accountType
- preAuthorizedAmount
- shopaccno
- transDate
@@ -56,8 +57,8 @@
userid:
title: 用户ID
type: string
- accountType:
- title: 账户类型
+ accountName:
+ title: 账户名
type: string
preAuthorizedAmount:
title: 预授权金额(分)
@@ -114,7 +115,7 @@
type: integer
AccountPayRequest:
type: object
- title: 账户余额扣款交易
+ title: 主账户余额扣款交易
required:
- billno
- shopaccno
@@ -139,6 +140,9 @@
amount:
title: 扣款金额(分)
type: integer
+ accountName:
+ title: 账户名
+ type: string
description:
title: 交易描述
type: string
@@ -149,6 +153,8 @@
AccountPayResponse:
type: object
title: 账户余额扣款交易应答
+ required:
+ - refno
properties:
refno:
title: 系统交易参考号
@@ -159,7 +165,9 @@
aftbal:
title: 账户余额(分)
type: integer
-
+ realAmount:
+ title: 实际扣款金额(分)
+ type: integer
paths:
accountQuery:
@@ -188,11 +196,7 @@
schema:
$ref: 'definitions.yaml#/components/schemas/ErrorResponse'
default:
- description: 查询错误
- content:
- application/json:
- schema:
- $ref: 'definitions.yaml#/components/schemas/ErrorResponse'
+ $ref: 'definitions.yaml#/components/responses/CommonError'
accountPay:
parameters:
- $ref: definitions.yaml#/components/headers/TenantId
@@ -200,7 +204,7 @@
tags:
- pos
requestBody:
- description: 账户余额消费
+ description: 主账户余额消费
content:
application/json:
schema:
@@ -212,12 +216,17 @@
application/json:
schema:
$ref: '#/components/schemas/AccountPayResponse'
- default:
- description: 消费失败
+ '400':
+ description: |
+ 消费失败, code 用于定义错误信息
+ * short_of_balance 余额不足
+ * account_status_error 账户状态异常
content:
application/json:
schema:
$ref: 'definitions.yaml#/components/schemas/ErrorResponse'
+ default:
+ $ref: 'definitions.yaml#/components/responses/CommonError'
accountPreAuthorizedDebit:
parameters:
- $ref: definitions.yaml#/components/headers/TenantId
@@ -237,6 +246,8 @@
application/json:
schema:
$ref: '#/components/schemas/PreAuthorizedDebitResponse'
+ default:
+ $ref: 'definitions.yaml#/components/responses/CommonError'
accountPreAuthorizedSettle:
parameters:
- $ref: definitions.yaml#/components/headers/TenantId
@@ -249,7 +260,6 @@
application/json:
schema:
$ref: '#/components/schemas/PreAuthorizedSettleRequest'
-
responses:
'200':
description: 预授权交易清算成功
@@ -257,4 +267,6 @@
application/json:
schema:
$ref: '#/components/schemas/PreAuthorizedSettleResponse'
+ default:
+ $ref: 'definitions.yaml#/components/responses/CommonError'