增加账户相关接口
diff --git a/payapi-spec/accountapi.yaml b/payapi-spec/accountapi.yaml
index 08c83a0..043f4fd 100644
--- a/payapi-spec/accountapi.yaml
+++ b/payapi-spec/accountapi.yaml
@@ -41,7 +41,7 @@
title: 子账户列表
items:
title: 子账户属性
- $ref: 'definitions.yaml#/components/schemas/SubAccountMetadata'
+ $ref: 'definitions.yaml#/components/schemas/SubAccountBalance'
PreAuthorizedDebitRequest:
type: object
title: 预授权交易请求
@@ -168,6 +168,79 @@
realAmount:
title: 实际扣款金额(分)
type: integer
+ SubAccountPayRequest:
+ type: object
+ description: 子账户消费接口
+ required:
+ - billno
+ - shopaccno
+ - transDate
+ - transTime
+ - amount
+ - overdraft
+ - accountList
+ properties:
+ billno:
+ $ref: 'definitions.yaml#/components/schemas/Refno'
+ shopaccno:
+ $ref: 'definitions.yaml#/components/schemas/ShopAccNo'
+ transDate:
+ $ref: 'definitions.yaml#/components/schemas/TransDate'
+ transTime:
+ $ref: 'definitions.yaml#/components/schemas/TransTime'
+ userid:
+ title: 用户ID
+ type: string
+ amount:
+ title: 扣款金额(分)
+ type: integer
+ overdraft:
+ type: boolean
+ title: 是否允许主账户透支
+ useMainAccount:
+ type: boolean
+ title: 是否扣款账户
+ accountList:
+ type: array
+ description: 按照账户列表顺序扣款
+ items:
+ type: object
+ description: 扣款账户列表
+ properties:
+ name:
+ type: string
+ title: 账户名
+ SubAccountPayResponse:
+ type: object
+ description: 账户消费应答
+ properties:
+ refno:
+ $ref: 'definitions.yaml#/components/schemas/Refno'
+ hostDate:
+ $ref: 'definitions.yaml#/components/schemas/TransDate'
+ hostTime:
+ $ref: 'definitions.yaml#/components/schemas/TransTime'
+ result:
+ $ref: 'definitions.yaml#/components/schemas/TransResult'
+ description:
+ title: 扣款情况描述
+ type: string
+ accountList:
+ type: array
+ description: 账户扣款情况
+ items:
+ type: object
+ description: 账户结果
+ properties:
+ name:
+ title: 账户名
+ type: string
+ payAmount:
+ title: 扣款金额
+ type: integer
+ aftbal:
+ title: 交易后余额
+ type: integer
paths:
accountQuery:
@@ -195,7 +268,7 @@
application/json:
schema:
$ref: 'definitions.yaml#/components/schemas/ErrorResponse'
- default:
+ '500':
$ref: 'definitions.yaml#/components/responses/CommonError'
accountPay:
parameters:
@@ -203,6 +276,7 @@
post:
tags:
- pos
+ - pay
requestBody:
description: 主账户余额消费
content:
@@ -225,14 +299,47 @@
application/json:
schema:
$ref: 'definitions.yaml#/components/schemas/ErrorResponse'
- default:
+ '500':
$ref: 'definitions.yaml#/components/responses/CommonError'
+ subaccPay:
+ parameters:
+ - $ref: definitions.yaml#/components/headers/TenantId
+ post:
+ tags:
+ - pay
+ requestBody:
+ description: |
+ 子账户消费, 请求时指定扣款列表,系统安装账户顺序扣款
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SubAccountPayRequest'
+ responses:
+ '200':
+ description: 扣款成功
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SubAccountPayResponse'
+ '400':
+ description: |
+ 扣款失败, code 定义错误信息
+ * short_of_balance 余额不足
+ * account_status_error 账户状态异常
+ content:
+ application/json:
+ schema:
+ $ref: 'definitions.yaml#/components/schemas/ErrorResponse'
+ '500':
+ $ref: 'definitions.yaml#/components/responses/CommonError'
+
accountPreAuthorizedDebit:
parameters:
- $ref: definitions.yaml#/components/headers/TenantId
post:
tags:
- pos
+ - pay
requestBody:
description: 账户预授权交易
content:
@@ -246,7 +353,7 @@
application/json:
schema:
$ref: '#/components/schemas/PreAuthorizedDebitResponse'
- default:
+ '500':
$ref: 'definitions.yaml#/components/responses/CommonError'
accountPreAuthorizedSettle:
parameters:
@@ -254,6 +361,7 @@
post:
tags:
- pos
+ - pay
requestBody:
description: 预授权交易清算
content:
@@ -267,6 +375,23 @@
application/json:
schema:
$ref: '#/components/schemas/PreAuthorizedSettleResponse'
- default:
+ '500':
+ $ref: 'definitions.yaml#/components/responses/CommonError'
+ querySubAccountMetadata:
+ parameters:
+ - $ref: definitions.yaml#/components/headers/TenantId
+ get:
+ tags:
+ - sa
+ responses:
+ '200':
+ description: 子账户元数据信息
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: 'definitions.yaml#/components/schemas/SubAccountMetadata'
+ '500':
$ref: 'definitions.yaml#/components/responses/CommonError'
diff --git a/payapi-spec/build.gradle b/payapi-spec/build.gradle
index 57f22e8..7d09e45 100644
--- a/payapi-spec/build.gradle
+++ b/payapi-spec/build.gradle
@@ -36,7 +36,7 @@
]
systemProperties = [
- "hideGenerationTimestamp": true
+ "hideGenerationTimestamp": "true"
]
}
@@ -54,5 +54,3 @@
}
into "$rootProject.projectDir/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model"
}
-
-//copySrc.dependsOn openApiGenerate
\ No newline at end of file
diff --git a/payapi-spec/consumeapi.yaml b/payapi-spec/consumeapi.yaml
index a9b91b9..b58bf96 100644
--- a/payapi-spec/consumeapi.yaml
+++ b/payapi-spec/consumeapi.yaml
@@ -149,7 +149,7 @@
application/json:
schema:
$ref: '#/components/schemas/QrcodePayInitResponse'
- default:
+ '500':
$ref: 'definitions.yaml#/components/responses/CommonError'
qrcodePayConfirm:
parameters:
@@ -177,7 +177,7 @@
application/json:
schema:
$ref: 'definitions.yaml#/components/schemas/ErrorResponse'
- default:
+ '500':
$ref: 'definitions.yaml#/components/responses/CommonError'
qrcodePayQuery:
parameters:
@@ -201,7 +201,7 @@
application/json:
schema:
$ref: '#/components/schemas/QrcodePayConfirmResponse'
- default:
+ '500':
$ref: 'definitions.yaml#/components/responses/CommonError'
refund:
parameters:
@@ -230,7 +230,7 @@
application/json:
schema:
$ref: 'definitions.yaml#/components/schemas/ErrorResponse'
- default:
+ '500':
$ref: 'definitions.yaml#/components/responses/CommonError'
refundQuery:
parameters:
@@ -260,5 +260,5 @@
application/json:
schema:
$ref: 'definitions.yaml#/components/schemas/ErrorResponse'
- default:
+ '500':
$ref: 'definitions.yaml#/components/responses/CommonError'
diff --git a/payapi-spec/definitions.yaml b/payapi-spec/definitions.yaml
index ed1adb4..a72bb54 100644
--- a/payapi-spec/definitions.yaml
+++ b/payapi-spec/definitions.yaml
@@ -82,7 +82,7 @@
- canceled
- closed
- notexists
- SubAccountMetadata:
+ SubAccountBalance:
type: object
required:
- name
@@ -94,6 +94,9 @@
status:
title: 子账户状态
$ref: '#/components/schemas/UserStatus'
+ offline:
+ type: boolean
+ title: 是否允许脱机使用
balance:
type: integer
title: 子账户余额
@@ -101,3 +104,18 @@
type: string
title: 余额有效期
format: date-time
+ SubAccountMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: 账户名
+ title:
+ type: string
+ title: 账户类型
+ description:
+ type: string
+ title: 账户描述
+ offline:
+ type: boolean
+ title: 是否可以脱机使用
diff --git a/payapi-spec/payapi-spec.yaml b/payapi-spec/payapi-spec.yaml
index b00d7ed..91197ef 100644
--- a/payapi-spec/payapi-spec.yaml
+++ b/payapi-spec/payapi-spec.yaml
@@ -17,9 +17,13 @@
$ref: consumeapi.yaml#/components/paths/refundQuery
/account/query:
$ref: accountapi.yaml#/components/paths/accountQuery
- /account/apy:
+ /account/pay:
$ref: accountapi.yaml#/components/paths/accountPay
+ /account/subaccPay:
+ $ref: accountapi.yaml#/components/paths/subaccPay
/account/preAuthorizedDebit:
$ref: accountapi.yaml#/components/paths/accountPreAuthorizedDebit
/account/preAuthorizedSettle:
$ref: accountapi.yaml#/components/paths/accountPreAuthorizedSettle
+ /account/subaccountMetadata:
+ $ref: accountapi.yaml#/components/paths/querySubAccountMetadata