Skip to content

Commit 1d35db5

Browse files
authored
Merge pull request #652 from ArtisanCloud/develop
Develop
2 parents 31fe104 + 5bfc22a commit 1d35db5

File tree

5 files changed

+85
-2
lines changed

5 files changed

+85
-2
lines changed

src/payment/bill/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (comp *Client) GetFlowBill(ctx context.Context, date string, accountType st
5959
return result, err
6060
}
6161

62-
// https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_8.shtml
62+
// https://pay.weixin.qq.com/doc/v3/merchant/4013071238
6363
func (comp *Client) DownloadBill(ctx context.Context, requestDownload *power.RequestDownload, filePath string) (int64, error) {
6464
return comp.StreamDownload(ctx, requestDownload, filePath)
6565
}

src/payment/fundApp/client.go

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"github.com/ArtisanCloud/PowerLibs/v3/object"
7+
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/power"
78
"github.com/ArtisanCloud/PowerWeChat/v3/src/payment/fundApp/request"
89
"github.com/ArtisanCloud/PowerWeChat/v3/src/payment/fundApp/response"
910
payment "github.com/ArtisanCloud/PowerWeChat/v3/src/payment/kernel"
@@ -77,3 +78,52 @@ func (comp *Client) Cancel(ctx context.Context, outBillNO string) (*response.Res
7778

7879
return result, err
7980
}
81+
82+
// 商户单号申请电子回单
83+
// https://pay.weixin.qq.com/doc/v3/merchant/4012716452
84+
func (comp *Client) ApplyForElecSign(ctx context.Context, outBillNO string) (*response.ResponseApplyForElecSign, error) {
85+
86+
result := &response.ResponseApplyForElecSign{}
87+
88+
endpoint := "/v3/fund-app/mch-transfer/elecsign/out-bill-no"
89+
_, err := comp.SafeRequestV3(ctx, endpoint, nil, http.MethodPost, &object.HashMap{
90+
"out_bill_no": outBillNO,
91+
}, nil, result)
92+
93+
return result, err
94+
}
95+
96+
// 商户单号查询电子回单
97+
// https://pay.weixin.qq.com/doc/v3/merchant/4012716436
98+
func (comp *Client) QueryElecSign(ctx context.Context, outBillNO string) (*response.ResponseQueryElecSign, error) {
99+
result := &response.ResponseQueryElecSign{}
100+
endpoint := comp.Wrap(fmt.Sprintf("/v3/fund-app/mch-transfer/elecsign/out-bill-no/%s", outBillNO))
101+
_, err := comp.SafeRequestV3(ctx, endpoint, nil, http.MethodGet, &object.HashMap{}, nil, result)
102+
return result, err
103+
}
104+
105+
// 微信单号申请电子回单
106+
// https://pay.weixin.qq.com/doc/v3/merchant/4012716456
107+
func (comp *Client) ApplyForElecSignByTransferBillNo(ctx context.Context, transferBillNO string) (*response.ResponseApplyForElecSign, error) {
108+
result := &response.ResponseApplyForElecSign{}
109+
endpoint := "/v3/fund-app/mch-transfer/elecsign/transfer-bill-no"
110+
_, err := comp.SafeRequestV3(ctx, endpoint, nil, http.MethodPost, &object.HashMap{
111+
"transfer_bill_no": transferBillNO,
112+
}, nil, result)
113+
return result, err
114+
}
115+
116+
// 微信单号查询电子回单
117+
// https://pay.weixin.qq.com/doc/v3/merchant/4012716455
118+
func (comp *Client) QueryElecSignByTransferBillNo(ctx context.Context, transferBillNO string) (*response.ResponseQueryElecSign, error) {
119+
result := &response.ResponseQueryElecSign{}
120+
endpoint := comp.Wrap(fmt.Sprintf("/v3/fund-app/mch-transfer/elecsign/transfer-bill-no/%s", transferBillNO))
121+
_, err := comp.SafeRequestV3(ctx, endpoint, nil, http.MethodGet, &object.HashMap{}, nil, result)
122+
return result, err
123+
}
124+
125+
// 下载电子回单
126+
// https://pay.weixin.qq.com/doc/v3/merchant/4013866774
127+
func (comp *Client) DownloadElecSignToFilePath(ctx context.Context, requestDownload *power.RequestDownload, filePath string) (int64, error) {
128+
return comp.StreamDownload(ctx, requestDownload, filePath)
129+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package response
2+
3+
import (
4+
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/response"
5+
"time"
6+
)
7+
8+
type ResponseApplyForElecSign struct {
9+
response.ResponsePayment
10+
11+
State string `json:"state"`
12+
CreateTime time.Time `json:"create_time"`
13+
}
14+
15+
type ResponseQueryElecSign struct {
16+
State string `json:"state"`
17+
CreateTime time.Time `json:"create_time"`
18+
UpdateTime time.Time `json:"update_time"`
19+
HashType string `json:"hash_type"`
20+
HashValue string `json:"hash_value"`
21+
DownloadUrl string `json:"download_url"`
22+
}
23+
24+
type RequestDownloadUrl struct {
25+
HashType string `json:"hash_type"`
26+
HashValue string `json:"hash_value"`
27+
DownloadUrl string `json:"download_url"`
28+
}

src/work/accountService/message/request/requestAccountServiceSendMsg.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ type RequestAccountServiceSendMsg struct {
88
Text *RequestAccountServiceMsgText `json:"text,omitempty"`
99
Image *RequestAccountServiceMsgImage `json:"image,omitempty"`
1010
Voice *RequestAccountServiceMsgVoice `json:"voice,omitempty"`
11+
Video *RequestAccountServiceMsgVideo `json:"video,omitempty"`
1112
File *RequestAccountServiceMsgFile `json:"file,omitempty"`
1213
Link *RequestAccountServiceMsgLink `json:"link,omitempty"`
1314
MiniProgram *RequestAccountServiceMsgMiniProgram `json:"miniprogram,omitempty"`
@@ -28,6 +29,10 @@ type RequestAccountServiceMsgVoice struct {
2829
MediaID string `json:"media_id"`
2930
}
3031

32+
type RequestAccountServiceMsgVideo struct {
33+
MediaID string `json:"media_id"`
34+
}
35+
3136
type RequestAccountServiceMsgFile struct {
3237
MediaID string `json:"media_id"`
3338
}

src/work/externalContact/contactWay/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func NewClient(app kernel.ApplicationInterface) (*Client, error) {
2424
}
2525

2626
// 配置客户联系「联系我」方式.
27-
// https://developer.work.weixin.qq.com/document/path/92572
27+
// https://developer.work.weixin.qq.com/document/path/92228
2828
func (comp *Client) Add(ctx context.Context, options *request2.RequestAddContactWay) (*response3.ResponseAddContactWay, error) {
2929

3030
result := &response3.ResponseAddContactWay{}

0 commit comments

Comments
 (0)