Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 1 | components: |
| 2 | schemas: |
| 3 | AccountQueryRequest: |
| 4 | type: object |
| 5 | title: 账户查询请求 |
| 6 | required: |
| 7 | - userid |
| 8 | properties: |
| 9 | userid: |
| 10 | title: 用户ID |
| 11 | type: string |
| 12 | subaccounts: |
| 13 | title: 子账户列表 |
| 14 | type: array |
| 15 | items: |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame^] | 16 | description: | |
| 17 | 需要查询的子账户名,如果查询所有子账户可以用 ['*'] 来查询 |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 18 | type: string |
| 19 | title: 子账户ID |
| 20 | AccountQueryResponse: |
| 21 | type: object |
| 22 | title: 账户查询应答 |
| 23 | properties: |
| 24 | userid: |
| 25 | title: 用户ID |
| 26 | type: string |
| 27 | username: |
| 28 | title: 用户名 |
| 29 | type: string |
| 30 | status: |
| 31 | title: 账户状态 |
| 32 | $ref: 'definitions.yaml#/components/schemas/UserStatus' |
| 33 | balance: |
| 34 | title: 总余额(分) |
| 35 | type: integer |
| 36 | frozenbal: |
| 37 | title: 冻结金额(分) |
| 38 | type: integer |
| 39 | subaccountList: |
| 40 | type: array |
| 41 | title: 子账户列表 |
| 42 | items: |
| 43 | title: 子账户属性 |
| 44 | $ref: 'definitions.yaml#/components/schemas/SubAccountMetadata' |
| 45 | PreAuthorizedDebitRequest: |
| 46 | type: object |
| 47 | title: 预授权交易请求 |
| 48 | required: |
| 49 | - userid |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 50 | - preAuthorizedAmount |
| 51 | - shopaccno |
| 52 | - transDate |
| 53 | - transTime |
| 54 | properties: |
| 55 | billno: |
| 56 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 57 | userid: |
| 58 | title: 用户ID |
| 59 | type: string |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame^] | 60 | accountName: |
| 61 | title: 账户名 |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 62 | type: string |
| 63 | preAuthorizedAmount: |
| 64 | title: 预授权金额(分) |
| 65 | type: integer |
| 66 | shopaccno: |
| 67 | $ref: 'definitions.yaml#/components/schemas/ShopAccNo' |
| 68 | transDate: |
| 69 | $ref: 'definitions.yaml#/components/schemas/TransDate' |
| 70 | transTime: |
| 71 | $ref: 'definitions.yaml#/components/schemas/TransTime' |
| 72 | PreAuthorizedDebitResponse: |
| 73 | type: object |
| 74 | title: 预授权交易应答 |
| 75 | properties: |
| 76 | refno: |
| 77 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 78 | result: |
| 79 | $ref: 'definitions.yaml#/components/schemas/TransResult' |
| 80 | message: |
| 81 | type: string |
| 82 | title: 预授权交易信息 |
| 83 | PreAuthorizedSettleRequest: |
| 84 | type: object |
| 85 | title: 预授权交易清算 |
| 86 | required: |
| 87 | - refno |
| 88 | - billno |
| 89 | - transTime |
| 90 | - transTime |
| 91 | - amount |
| 92 | properties: |
| 93 | refno: |
| 94 | title: 预授权交易系统交易参考号 |
| 95 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 96 | billno: |
| 97 | title: 预授权交易清算订单号 |
| 98 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 99 | transDate: |
| 100 | $ref: 'definitions.yaml#/components/schemas/TransDate' |
| 101 | transTime: |
| 102 | $ref: 'definitions.yaml#/components/schemas/TransTime' |
| 103 | amount: |
| 104 | title: 清算金额, 小于等于预授权金额(分) |
| 105 | type: integer |
| 106 | PreAuthorizedSettleResponse: |
| 107 | type: object |
| 108 | title: 预授权交易清算结果 |
| 109 | properties: |
| 110 | refno: |
| 111 | title: 预授权交易清算交易系统交易参考号 |
| 112 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 113 | leftPreAuthorizedAmount: |
| 114 | title: 清算后剩余预授权金额 |
| 115 | type: integer |
| 116 | AccountPayRequest: |
| 117 | type: object |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame^] | 118 | title: 主账户余额扣款交易 |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 119 | required: |
| 120 | - billno |
| 121 | - shopaccno |
| 122 | - transTime |
| 123 | - transDate |
| 124 | - userid |
| 125 | - amount |
| 126 | - dtltype |
| 127 | properties: |
| 128 | billno: |
| 129 | title: 交易订单号 |
| 130 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 131 | shopaccno: |
| 132 | $ref: 'definitions.yaml#/components/schemas/ShopAccNo' |
| 133 | transDate: |
| 134 | $ref: 'definitions.yaml#/components/schemas/TransDate' |
| 135 | transTime: |
| 136 | $ref: 'definitions.yaml#/components/schemas/TransTime' |
| 137 | userid: |
| 138 | title: 用户ID |
| 139 | type: string |
| 140 | amount: |
| 141 | title: 扣款金额(分) |
| 142 | type: integer |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame^] | 143 | accountName: |
| 144 | title: 账户名 |
| 145 | type: string |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 146 | description: |
| 147 | title: 交易描述 |
| 148 | type: string |
| 149 | dtltype: |
| 150 | title: 交易类型 |
| 151 | type: string |
| 152 | default: "pos" |
| 153 | AccountPayResponse: |
| 154 | type: object |
| 155 | title: 账户余额扣款交易应答 |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame^] | 156 | required: |
| 157 | - refno |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 158 | properties: |
| 159 | refno: |
| 160 | title: 系统交易参考号 |
| 161 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 162 | description: |
| 163 | title: 系统返回交易描述 |
| 164 | type: string |
| 165 | aftbal: |
| 166 | title: 账户余额(分) |
| 167 | type: integer |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame^] | 168 | realAmount: |
| 169 | title: 实际扣款金额(分) |
| 170 | type: integer |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 171 | |
| 172 | paths: |
| 173 | accountQuery: |
| 174 | parameters: |
| 175 | - $ref: definitions.yaml#/components/headers/TenantId |
| 176 | post: |
| 177 | tags: |
| 178 | - pos |
| 179 | requestBody: |
| 180 | description: 账户余额查询 |
| 181 | content: |
| 182 | application/json: |
| 183 | schema: |
| 184 | $ref: '#/components/schemas/AccountQueryRequest' |
| 185 | responses: |
| 186 | '200': |
| 187 | description: 查询账户成功 |
| 188 | content: |
| 189 | application/json: |
| 190 | schema: |
| 191 | $ref: '#/components/schemas/AccountQueryResponse' |
| 192 | '404': |
| 193 | description: 指定用户不存在 |
| 194 | content: |
| 195 | application/json: |
| 196 | schema: |
| 197 | $ref: 'definitions.yaml#/components/schemas/ErrorResponse' |
| 198 | default: |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame^] | 199 | $ref: 'definitions.yaml#/components/responses/CommonError' |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 200 | accountPay: |
| 201 | parameters: |
| 202 | - $ref: definitions.yaml#/components/headers/TenantId |
| 203 | post: |
| 204 | tags: |
| 205 | - pos |
| 206 | requestBody: |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame^] | 207 | description: 主账户余额消费 |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 208 | content: |
| 209 | application/json: |
| 210 | schema: |
| 211 | $ref: '#/components/schemas/AccountPayRequest' |
| 212 | responses: |
| 213 | '200': |
| 214 | description: 账户消费成功 |
| 215 | content: |
| 216 | application/json: |
| 217 | schema: |
| 218 | $ref: '#/components/schemas/AccountPayResponse' |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame^] | 219 | '400': |
| 220 | description: | |
| 221 | 消费失败, code 用于定义错误信息 |
| 222 | * short_of_balance 余额不足 |
| 223 | * account_status_error 账户状态异常 |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 224 | content: |
| 225 | application/json: |
| 226 | schema: |
| 227 | $ref: 'definitions.yaml#/components/schemas/ErrorResponse' |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame^] | 228 | default: |
| 229 | $ref: 'definitions.yaml#/components/responses/CommonError' |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 230 | accountPreAuthorizedDebit: |
| 231 | parameters: |
| 232 | - $ref: definitions.yaml#/components/headers/TenantId |
| 233 | post: |
| 234 | tags: |
| 235 | - pos |
| 236 | requestBody: |
| 237 | description: 账户预授权交易 |
| 238 | content: |
| 239 | application/json: |
| 240 | schema: |
| 241 | $ref: '#/components/schemas/PreAuthorizedDebitRequest' |
| 242 | responses: |
| 243 | '200': |
| 244 | description: 预授权交易成功 |
| 245 | content: |
| 246 | application/json: |
| 247 | schema: |
| 248 | $ref: '#/components/schemas/PreAuthorizedDebitResponse' |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame^] | 249 | default: |
| 250 | $ref: 'definitions.yaml#/components/responses/CommonError' |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 251 | accountPreAuthorizedSettle: |
| 252 | parameters: |
| 253 | - $ref: definitions.yaml#/components/headers/TenantId |
| 254 | post: |
| 255 | tags: |
| 256 | - pos |
| 257 | requestBody: |
| 258 | description: 预授权交易清算 |
| 259 | content: |
| 260 | application/json: |
| 261 | schema: |
| 262 | $ref: '#/components/schemas/PreAuthorizedSettleRequest' |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 263 | responses: |
| 264 | '200': |
| 265 | description: 预授权交易清算成功 |
| 266 | content: |
| 267 | application/json: |
| 268 | schema: |
| 269 | $ref: '#/components/schemas/PreAuthorizedSettleResponse' |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame^] | 270 | default: |
| 271 | $ref: 'definitions.yaml#/components/responses/CommonError' |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 272 | |