Skip to content

Commit 2bca999

Browse files
authored
Merge pull request #565 from ArtisanCloud/develop
Develop
2 parents 953dbb0 + 32da65d commit 2bca999

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

src/payment/apply4Sub/client.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,25 @@ func (comp *Client) ApplyForBusiness(ctx context.Context, params *request.Reques
6666
_, err = comp.Request(ctx, comp.Wrap(endpoint), nil, http.MethodPost, options, false, nil, result)
6767
return result, err
6868
}
69+
70+
// 通过业务申请编号查询申请状态
71+
// https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter11_1_2.shtml
72+
func (comp *Client) GetApplyByBusinessCode(ctx context.Context, businessCode string) (*response.ResponseGetApplyForBusiness, error) {
73+
74+
result := &response.ResponseGetApplyForBusiness{}
75+
76+
endpoint := "/v3/applyment4sub/applyment/business_code/" + businessCode
77+
_, err := comp.Request(ctx, endpoint, &object.StringMap{}, http.MethodGet, &object.HashMap{}, false, nil, result)
78+
return result, err
79+
}
80+
81+
// 通过申请单号查询申请状态
82+
// https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter11_1_2.shtml
83+
func (comp *Client) GetApplyByApplymentId(ctx context.Context, applymentId string) (*response.ResponseGetApplyForBusiness, error) {
84+
85+
result := &response.ResponseGetApplyForBusiness{}
86+
87+
endpoint := "/v3/applyment4sub/applyment/applyment_id/" + applymentId
88+
_, err := comp.Request(ctx, endpoint, &object.StringMap{}, http.MethodGet, &object.HashMap{}, false, nil, result)
89+
return result, err
90+
}

src/payment/apply4Sub/response/responseApply.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,18 @@ package response
33
type ResponseApplyForBusiness struct {
44
ApplymentId int64 `json:"applyment_id"`
55
}
6+
7+
type ResponseGetApplyForBusiness struct {
8+
BusinessCode string `json:"business_code"`
9+
ApplymentId int64 `json:"applyment_id"`
10+
SubMchid string `json:"sub_mchid"`
11+
SignUrl string `json:"sign_url"`
12+
ApplymentState string `json:"applyment_state"`
13+
ApplymentStateMsg string `json:"applyment_state_msg"`
14+
AuditDetail []AuditDetail `json:"audit_detail"`
15+
}
16+
type AuditDetail struct {
17+
Field string `json:"field"`
18+
FieldName string `json:"field_name"`
19+
RejectReason string `json:"reject_reason"`
20+
}

0 commit comments

Comments
 (0)