-
Notifications
You must be signed in to change notification settings - Fork 7
/
资金-商户提现.go
executable file
·51 lines (42 loc) · 1.15 KB
/
资金-商户提现.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
package apis
import (
"encoding/json"
)
// 商户提现
// 文档:https://developers.weixin.qq.com/doc/channels/API/funds/submitwithdraw.html
type ReqFundsSubmitwithdraw struct {
Amount int `json:"amount"`
BankMemo string `json:"bank_memo"`
Remark string `json:"remark"`
}
var _ bodyer = ReqFundsSubmitwithdraw{}
func (x ReqFundsSubmitwithdraw) intoBody() ([]byte, error) {
result, err := json.Marshal(x)
if err != nil {
return nil, err
}
return result, nil
}
type RespFundsSubmitwithdraw struct {
CommonResp
QrcodeTicket string `json:"qrcode_ticket"`
}
var _ bodyer = RespFundsSubmitwithdraw{}
func (x RespFundsSubmitwithdraw) intoBody() ([]byte, error) {
result, err := json.Marshal(x)
if err != nil {
return nil, err
}
return result, nil
}
func (c *ApiClient) ExecFundsSubmitwithdraw(req ReqFundsSubmitwithdraw) (RespFundsSubmitwithdraw, error) {
var resp RespFundsSubmitwithdraw
err := c.executeWXApiPost("/channels/ec/funds/submitwithdraw", req, &resp, true)
if err != nil {
return RespFundsSubmitwithdraw{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return RespFundsSubmitwithdraw{}, bizErr
}
return resp, nil
}