Skip to content

Commit b17ce77

Browse files
author
Matrix-X
committed
feat(payment): add fund app client
1 parent 75a0e9b commit b17ce77

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/payment/fundApp/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ func (comp *Client) TransferBills(ctx context.Context, data *request.RequestTran
3030

3131
result := &response.ResponseTransferBills{}
3232

33-
params, err := object.StructToStringMap(data)
33+
params, err := object.StructToHashMap(data)
3434
if err != nil {
3535
return nil, err
3636
}
3737

3838
endpoint := comp.Wrap("/v3/fund-app/mch-transfer/transfer-bills")
39-
_, err = comp.SafeRequestV3(ctx, endpoint, params, http.MethodPost, &object.HashMap{}, nil, result)
39+
_, err = comp.SafeRequestV3(ctx, endpoint, nil, http.MethodPost, params, nil, result)
4040

4141
return result, err
4242
}

src/payment/fundApp/request/requestTransferBills.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ type RequestPayTransferToPocket struct {
44
}
55

66
type TransferSceneReportInfo struct {
7-
InfoType string `json:"info_type"`
8-
InfoContent string `json:"info_content"`
7+
InfoType string `json:"info_type,omitempty"`
8+
InfoContent string `json:"info_content,omitempty"`
99
}
1010

1111
type RequestTransferBills struct {
12-
Appid string `json:"appid"`
13-
OutBillNo string `json:"out_bill_no"`
14-
TransferSceneId string `json:"transfer_scene_id"`
15-
Openid string `json:"openid"`
16-
UserName string `json:"user_name"`
17-
TransferAmount int `json:"transfer_amount"`
18-
TransferRemark string `json:"transfer_remark"`
19-
NotifyUrl string `json:"notify_url"`
20-
UserRecvPerception string `json:"user_recv_perception"`
21-
TransferSceneReportInfos []TransferSceneReportInfo `json:"transfer_scene_report_infos"`
12+
Appid string `json:"appid,omitempty"`
13+
OutBillNo string `json:"out_bill_no,omitempty"`
14+
TransferSceneId string `json:"transfer_scene_id,omitempty"`
15+
Openid string `json:"openid,omitempty"`
16+
UserName string `json:"user_name,omitempty"`
17+
TransferAmount int `json:"transfer_amount,omitempty"`
18+
TransferRemark string `json:"transfer_remark,omitempty"`
19+
NotifyUrl string `json:"notify_url,omitempty"`
20+
UserRecvPerception string `json:"user_recv_perception,omitempty"`
21+
TransferSceneReportInfos []TransferSceneReportInfo `json:"transfer_scene_report_infos,omitempty"`
2222
}

0 commit comments

Comments
 (0)