334 lines
12 KiB
YAML
334 lines
12 KiB
YAML
WithholdingBackDisc:
|
||
post:
|
||
tags:
|
||
- 代扣管理
|
||
summary: 代扣回盘
|
||
description: |
|
||
银行代扣回盘接口,接收银行返回的代扣结果。
|
||
|
||
## 业务说明
|
||
- 接收银行处理代扣送盘后的结果反馈
|
||
- 包含每笔代扣的成功或失败信息
|
||
- 根据回盘结果更新账单和交易状态
|
||
- 支持XML和JSON两种数据格式
|
||
- 自动处理代扣成功和失败的业务逻辑
|
||
|
||
## 业务规则
|
||
- 回盘数据必须与送盘数据对应
|
||
- 成功的代扣自动更新账单状态为已缴费
|
||
- 失败的代扣保持原账单状态
|
||
- 生成相应的交易记录和状态
|
||
|
||
## 调用频率限制
|
||
- 单个批次只能回盘一次
|
||
- 支持银行异步回盘处理
|
||
|
||
operationId: withholdingBackDisc
|
||
parameters:
|
||
- $ref: '../components/parameters.yaml#/components/parameters/ContentTypeHeader'
|
||
- $ref: '../components/parameters.yaml#/components/parameters/EncryptTypeHeader'
|
||
- $ref: '../components/parameters.yaml#/components/parameters/EncryptModeHeader'
|
||
- $ref: '../components/parameters.yaml#/components/parameters/DataTypeHeader'
|
||
requestBody:
|
||
required: true
|
||
description: 代扣回盘请求数据
|
||
content:
|
||
application/xml:
|
||
schema:
|
||
allOf:
|
||
- $ref: '../components/schemas.yaml#/components/schemas/BaseRequest'
|
||
- type: object
|
||
required:
|
||
- BatchNo
|
||
- TotalCount
|
||
- SuccessCount
|
||
- FailCount
|
||
- ResultList
|
||
properties:
|
||
BatchNo:
|
||
type: string
|
||
description: 原送盘批次号
|
||
example: "BATCH20240101001"
|
||
maxLength: 50
|
||
TotalCount:
|
||
type: integer
|
||
description: 总笔数
|
||
example: 2
|
||
minimum: 1
|
||
SuccessCount:
|
||
type: integer
|
||
description: 成功笔数
|
||
example: 1
|
||
minimum: 0
|
||
FailCount:
|
||
type: integer
|
||
description: 失败笔数
|
||
example: 1
|
||
minimum: 0
|
||
ResultList:
|
||
type: array
|
||
description: 代扣结果列表
|
||
items:
|
||
type: object
|
||
required:
|
||
- BillKey
|
||
- CompanyId
|
||
- AgreementNo
|
||
- PayAmount
|
||
- ResultCode
|
||
- ResultMessage
|
||
properties:
|
||
BillKey:
|
||
type: string
|
||
description: 客户编号
|
||
example: "123456"
|
||
CompanyId:
|
||
type: string
|
||
description: 机构编码
|
||
example: "654321"
|
||
AgreementNo:
|
||
type: string
|
||
description: 协议号
|
||
example: "AGR001"
|
||
PayAmount:
|
||
type: number
|
||
format: decimal
|
||
description: 代扣金额
|
||
example: 150.00
|
||
ResultCode:
|
||
type: string
|
||
description: 代扣结果码
|
||
enum: ["SUCCESS", "FAIL"]
|
||
example: "SUCCESS"
|
||
ResultMessage:
|
||
type: string
|
||
description: 代扣结果信息
|
||
example: "代扣成功"
|
||
FailReason:
|
||
type: string
|
||
description: 失败原因(结果为FAIL时必填)
|
||
example: "余额不足"
|
||
example: |
|
||
<?xml version="1.0" encoding="GBK"?>
|
||
<in>
|
||
<Version>1.0.1</Version>
|
||
<InstId>00001</InstId>
|
||
<TranCode>BackDisc</TranCode>
|
||
<TranDate>20240101</TranDate>
|
||
<TranSeq>123456789017</TranSeq>
|
||
<BatchNo>BATCH20240101001</BatchNo>
|
||
<TotalCount>2</TotalCount>
|
||
<SuccessCount>1</SuccessCount>
|
||
<FailCount>1</FailCount>
|
||
<ResultList>
|
||
<Result>
|
||
<BillKey>123456</BillKey>
|
||
<CompanyId>654321</CompanyId>
|
||
<AgreementNo>AGR001</AgreementNo>
|
||
<PayAmount>150.00</PayAmount>
|
||
<ResultCode>SUCCESS</ResultCode>
|
||
<ResultMessage>代扣成功</ResultMessage>
|
||
</Result>
|
||
<Result>
|
||
<BillKey>123457</BillKey>
|
||
<CompanyId>654321</CompanyId>
|
||
<AgreementNo>AGR002</AgreementNo>
|
||
<PayAmount>150.00</PayAmount>
|
||
<ResultCode>FAIL</ResultCode>
|
||
<ResultMessage>代扣失败</ResultMessage>
|
||
<FailReason>余额不足</FailReason>
|
||
</Result>
|
||
</ResultList>
|
||
</in>
|
||
application/json:
|
||
schema:
|
||
allOf:
|
||
- $ref: '../components/schemas.yaml#/components/schemas/BaseRequest'
|
||
- type: object
|
||
required:
|
||
- BatchNo
|
||
- TotalCount
|
||
- SuccessCount
|
||
- FailCount
|
||
- ResultList
|
||
properties:
|
||
BatchNo:
|
||
type: string
|
||
description: 原送盘批次号
|
||
example: "BATCH20240101001"
|
||
TotalCount:
|
||
type: integer
|
||
description: 总笔数
|
||
example: 2
|
||
SuccessCount:
|
||
type: integer
|
||
description: 成功笔数
|
||
example: 1
|
||
FailCount:
|
||
type: integer
|
||
description: 失败笔数
|
||
example: 1
|
||
ResultList:
|
||
type: array
|
||
description: 代扣结果列表
|
||
items:
|
||
type: object
|
||
properties:
|
||
BillKey:
|
||
type: string
|
||
description: 客户编号
|
||
example: "123456"
|
||
CompanyId:
|
||
type: string
|
||
description: 机构编码
|
||
example: "654321"
|
||
AgreementNo:
|
||
type: string
|
||
description: 协议号
|
||
example: "AGR001"
|
||
PayAmount:
|
||
type: number
|
||
format: decimal
|
||
description: 代扣金额
|
||
example: 150.00
|
||
ResultCode:
|
||
type: string
|
||
description: 代扣结果码
|
||
example: "SUCCESS"
|
||
ResultMessage:
|
||
type: string
|
||
description: 代扣结果信息
|
||
example: "代扣成功"
|
||
FailReason:
|
||
type: string
|
||
description: 失败原因
|
||
example: "余额不足"
|
||
example:
|
||
Version: "1.0.1"
|
||
InstId: "00001"
|
||
TranCode: "BackDisc"
|
||
TranDate: "20240101"
|
||
TranSeq: "123456789017"
|
||
BatchNo: "BATCH20240101001"
|
||
TotalCount: 2
|
||
SuccessCount: 1
|
||
FailCount: 1
|
||
ResultList:
|
||
- BillKey: "123456"
|
||
CompanyId: "654321"
|
||
AgreementNo: "AGR001"
|
||
PayAmount: 150.00
|
||
ResultCode: "SUCCESS"
|
||
ResultMessage: "代扣成功"
|
||
- BillKey: "123457"
|
||
CompanyId: "654321"
|
||
AgreementNo: "AGR002"
|
||
PayAmount: 150.00
|
||
ResultCode: "FAIL"
|
||
ResultMessage: "代扣失败"
|
||
FailReason: "余额不足"
|
||
|
||
responses:
|
||
'200':
|
||
description: 回盘处理成功
|
||
headers:
|
||
Content-Type:
|
||
$ref: '../components/headers.yaml#/components/headers/ContentType'
|
||
X-Response-Time:
|
||
$ref: '../components/headers.yaml#/components/headers/ResponseTime'
|
||
X-Request-Id:
|
||
$ref: '../components/headers.yaml#/components/headers/RequestId'
|
||
content:
|
||
application/xml:
|
||
schema:
|
||
allOf:
|
||
- $ref: '../components/schemas.yaml#/components/schemas/BaseResponse'
|
||
- type: object
|
||
properties:
|
||
Data:
|
||
type: object
|
||
properties:
|
||
BatchNo:
|
||
type: string
|
||
description: 批次号
|
||
example: "BATCH20240101001"
|
||
ProcessedCount:
|
||
type: integer
|
||
description: 已处理笔数
|
||
example: 2
|
||
UpdatedBills:
|
||
type: integer
|
||
description: 更新账单数
|
||
example: 1
|
||
CreatedTransactions:
|
||
type: integer
|
||
description: 创建交易数
|
||
example: 2
|
||
example: |
|
||
<?xml version="1.0" encoding="GBK"?>
|
||
<out>
|
||
<Version>1.0.1</Version>
|
||
<InstId>00001</InstId>
|
||
<TranCode>BackDiscRes</TranCode>
|
||
<TranDate>20240101</TranDate>
|
||
<TranSeq>123456789017</TranSeq>
|
||
<RespCode>AAAAAAA</RespCode>
|
||
<RespMessage>回盘处理成功</RespMessage>
|
||
<Data>
|
||
<BatchNo>BATCH20240101001</BatchNo>
|
||
<ProcessedCount>2</ProcessedCount>
|
||
<UpdatedBills>1</UpdatedBills>
|
||
<CreatedTransactions>2</CreatedTransactions>
|
||
</Data>
|
||
</out>
|
||
application/json:
|
||
schema:
|
||
allOf:
|
||
- $ref: '../components/schemas.yaml#/components/schemas/BaseResponse'
|
||
- type: object
|
||
properties:
|
||
Data:
|
||
type: object
|
||
properties:
|
||
BatchNo:
|
||
type: string
|
||
description: 批次号
|
||
example: "BATCH20240101001"
|
||
ProcessedCount:
|
||
type: integer
|
||
description: 已处理笔数
|
||
example: 2
|
||
UpdatedBills:
|
||
type: integer
|
||
description: 更新账单数
|
||
example: 1
|
||
CreatedTransactions:
|
||
type: integer
|
||
description: 创建交易数
|
||
example: 2
|
||
example:
|
||
Version: "1.0.1"
|
||
InstId: "00001"
|
||
TranCode: "BackDiscRes"
|
||
TranDate: "20240101"
|
||
TranSeq: "123456789017"
|
||
RespCode: "AAAAAAA"
|
||
RespMessage: "回盘处理成功"
|
||
Data:
|
||
BatchNo: "BATCH20240101001"
|
||
ProcessedCount: 2
|
||
UpdatedBills: 1
|
||
CreatedTransactions: 2
|
||
|
||
'400':
|
||
$ref: '../components/responses.yaml#/components/responses/BusinessError'
|
||
'500':
|
||
$ref: '../components/responses.yaml#/components/responses/SystemError'
|
||
'401':
|
||
$ref: '../components/responses.yaml#/components/responses/SecurityError'
|
||
'408':
|
||
$ref: '../components/responses.yaml#/components/responses/NetworkError'
|
||
|
||
security:
|
||
- ApiKeyAuth: []
|
||
- EncryptedData: [] |