-
Notifications
You must be signed in to change notification settings - Fork 42
/
wechatpay_type.go
133 lines (121 loc) · 3.95 KB
/
wechatpay_type.go
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
package wechatpay
const (
UNIT_ORDER_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder"
REFUND_URL = "https://api.mch.weixin.qq.com/secapi/pay/refund"
REFUND_QUERY_URL = "https://api.mch.weixin.qq.com/pay/refundquery"
)
type Base struct {
AppId string `xml:"appid"`
MchId string `xml:"mch_id"`
NonceStr string `xml:"nonce_str"`
Sign string `xml:"sign"`
}
//统一下单请求参数
type UnitOrder struct {
Base
Body string `xml:"body"`
NotifyUrl string `xml:"notify_url"`
TradeType string `xml:"trade_type"`
SpbillCreateIp string `xml:"spbill_create_ip"`
TotalFee int `xml:"total_fee"`
OutTradeNo string `xml:"out_trade_no"`
SceneInfo string `xml:"scene_info"`
FeeType string `xml:"fee_type"`
Openid string `xml:"openid"`
Referer string
}
//统一下单返回参数
type UnifyOrderResult struct {
Base
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
Attach string `xml:"attach"`
ResultCode string `xml:"result_code"`
PrepayId string `xml:"prepay_id"`
TradeType string `xml:"trade_type"`
CodeUrl string `xml:"code_url"`
MwebUrl string `xml:"mweb_url"`
}
//订单查询
type OrderQuery struct {
Base
Transaction_id string `xml:"transaction_id"`
}
type OrderQueryResult struct {
Base
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
ResultCode string `xml:"result_code"`
OpenId string `xml:"prepay_id"`
TradeType string `xml:"trade_type"`
TradeState string `xml:"trade_state"`
BankType string `xml:"bank_type"`
TotalTee string `xml:"total_fee"`
CashFee int `xml:"cash_fee"`
TransactionId string `xml:"transaction_id"`
OutTradeNo string `xml:"out_trade_no"`
TimeEnd string `xml:"time_end"`
TradeStateDesc string `xml:"trade_state_desc"`
}
//下单回调
type PayNotifyResult struct {
Base
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
ResultCode string `xml:"result_code"`
OpenId string `xml:"openid"`
IsSubscribe string `xml:"is_subscribe"`
TradeType string `xml:"trade_type"`
BankType string `xml:"bank_type"`
TotalFee int `xml:"total_fee"`
FeeType string `xml:"fee_type"`
CashFee int `xml:"cash_fee"`
CashFeeType string `xml:"cash_fee_type"`
TransactionId string `xml:"transaction_id"`
OutTradeNo string `xml:"out_trade_no"`
Attach string `xml:"attach"`
TimeEnd string `xml:"time_end"`
}
//下单回调返回值
type PayNotifyResp struct {
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
}
//订单退款
type OrderRefund struct {
Base
TotalFee int `xml:"total_fee"`
OutTradeNo string `xml:"out_trade_no"`
OutRefundNo string `xml:"out_refund_no"`
RefundFee int `xml:"refund_fee"`
}
//订单退款结果
type OrderRefundResult struct {
Base
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
ResultCode string `xml:"result_code"`
TransactionId string `xml:"transaction_id"`
OutRefundNo string `xml:"out_refund_no"`
OutTradeNo string `xml:"out_trade_no"`
RefundFee int `xml:"refund_fee"`
TotalFee int `xml:"total_fee"`
CashFee int `xml:"cash_fee"`
ErrCodeDes string `xml:"err_code_des"`
}
//退款查询
type OrderRefundQuery struct {
Base
OutTradeNo string `xml:"out_trade_no"`
}
//退款结果查询
type OrderRefundQueryResult struct {
Base
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
ResultCode string `xml:"result_code"`
OutTradeNo string `xml:"out_trade_no"`
RefundStatus_0 string `xml:"refund_status_0"`
SettlementRefundFee_0 string `xml:"settlement_refund_fee_0"`
ErrCodeDes string `xml:"err_code_des"`
}