/
RefundNotify.ts
141 lines (137 loc) · 3.39 KB
/
RefundNotify.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/**
* 退款结果通知
* @see {@link https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=9_16&index=11}
*/
import { BaseReturn } from "./Base";
export interface RefundNotifyBase extends BaseReturn {
/**
* 公众账号ID
* @description 调用接口提交的公众账号ID
* @example wx8888888888888888
* @typedef String(32)
*/
appid: string;
/**
* 商户号
* @description 调用接口提交的商户号
* @example 1900000109
* @typedef String(32)
*/
mch_id: string;
/**
* 随机字符串
* @description 微信返回的随机字符串
* @example 5K8264ILTKCH16CQ2502SI8ZNMTM67VS
* @typedef String(32)
*/
nonce_str: string;
/**
* 加密信息
* @description 加密信息请用商户秘钥进行解密,详见解密方式
* @typedef String(1024)
*/
req_info: string;
}
/**
* 退款结果通知解密出的数据
*/
export interface RefundNotifyDecode {
/**
* 微信订单号
* @example 1217752501201407033233368018
* @typedef String(32)
*/
transaction_id: string;
/**
* 商户订单号
* @description 商户系统内部的订单号
* @example 1217752501201407033233368018
* @typedef String(32)
*/
out_trade_no: string;
/**
* 微信退款单号
* @example 1217752501201407033233368018
* @typedef String(32)
*/
refund_id: string;
/**
* 商户退款单号
* @example 1217752501201407033233368018
* @typedef String(64)
*/
out_refund_no: string;
/**
* 订单金额
* @description 订单总金额,单位为分,只能为整数,详见支付金额
* @example 100
* @typedef Int
*/
total_fee: number;
/**
* 应结订单金额
* @description 当该订单有使用非充值券时,返回此字段。应结订单金额=订单金额-非充值代金券金额,应结订单金额<=订单金额。
* @example 100
* @typedef Int
*/
settlement_total_fee?: number;
/**
* 申请退款金额
* @description 退款总金额,单位为分
* @example 100
* @typedef Int
*/
refund_fee: number;
/**
* 退款金额
* @description 退款金额=申请退款金额-非充值代金券退款金额,退款金额<=申请退款金额
* @example 100
* @typedef Int
*/
settlement_refund_fee: number;
/**
* 退款状态
* @description
* - SUCCESS-退款成功
* - CHANGE-退款异常
* - REFUNDCLOSE—退款关闭
* @example SUCCESS
* @typedef String(16)
*/
refund_status: string;
/**
* 退款成功时间
* @description 资金退款至用户帐号的时间,格式2017-12-15 09:46:01
* @example 2017-12-15 09:46:01
* @typedef String(20)
*/
success_time?: string;
/**
* 退款入账账户
* @description 取当前退款单的退款入账方
* @example 招商银行信用卡0403
* @typedef String(64)
*/
refund_recv_accout: string;
/**
* 退款资金来源
* @description
* - REFUND_SOURCE_RECHARGE_FUNDS 可用余额退款/基本账户
* - REFUND_SOURCE_UNSETTLED_FUNDS 未结算资金退款
* @example REFUND_SOURCE_RECHARGE_FUNDS
* @typedef String(30)
*/
refund_account: string;
/**
* 退款发起来源
* @description
* - API接口
* - VENDOR_PLATFORM商户平台
* @example API
* @typedef String(30)
*/
refund_request_source: string;
}
export type RefundNotifyHandler = (
data: RefundNotifyBase & RefundNotifyDecode
) => Promise<BaseReturn>;