From 6fb06e3d4ffbc792b3fb24bfb2b4dd09eaf28191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E7=82=9C=20=E5=8D=A2?= <307958040@qq.com> Date: Mon, 17 Jun 2024 16:06:27 +0800 Subject: [PATCH] =?UTF-8?q?pay=E9=A1=B9=E7=9B=AE=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E5=BC=82=E6=AD=A5=E6=8E=A8=E9=80=81=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E8=AE=BE=E7=BD=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/pay/client.go | 14 +++++++---- services/pay/client_test.go | 7 +++--- services/pay/complaint_notify_url.go | 35 ++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 services/pay/complaint_notify_url.go diff --git a/services/pay/client.go b/services/pay/client.go index d3d01a9..97c58ea 100644 --- a/services/pay/client.go +++ b/services/pay/client.go @@ -10,12 +10,12 @@ const ( ) var HOST requests.Host = requests.Host{ - Default: "pay.uu89.com", + Default: "pay.gaore.com", Func: func(s string) string { var a = map[string]string{ - requests.RELEASE: "pay.uu89.com", - requests.PRE: "pay.uu89.com", - requests.TEST: "pay.uu89.com", + requests.RELEASE: "pay.gaore.com", + requests.PRE: "pay.gaore.com", + requests.TEST: "pay.gaore.com", } return a[s] }, @@ -48,3 +48,9 @@ func (c *Client) ComplaintUpload(req *ComplaintUploadRequest) (response *Complai err = c.DoAction(req, response) return } + +func (c *Client) ComplaintNotifyUrl(req *ComplaintNotifyUrlRequest) (response *ComplaintNotifyUrlResponse, err error) { + response = CreateComplaintNotifyUrlResponse() + err = c.DoAction(req, response) + return +} diff --git a/services/pay/client_test.go b/services/pay/client_test.go index 90cea14..bb73885 100644 --- a/services/pay/client_test.go +++ b/services/pay/client_test.go @@ -13,12 +13,13 @@ func TestClient_GetUserInfo(t *testing.T) { t.Error(err) } - req := CreateComplaintUploadRequest() + req := CreateComplaintNotifyUrlRequest() req.MchId = "3503" - req.ImageUrl = "https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64" + req.NotifyUrl = "https://pay.uu89.com/api/complaint/wxNotify/3503" + req.Type = 1 - resp, err := c.ComplaintUpload(req) + resp, err := c.ComplaintNotifyUrl(req) if err != nil { log.Fatalln(err) } diff --git a/services/pay/complaint_notify_url.go b/services/pay/complaint_notify_url.go new file mode 100644 index 0000000..571fdb9 --- /dev/null +++ b/services/pay/complaint_notify_url.go @@ -0,0 +1,35 @@ +package pay + +import ( + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" +) + +type ComplaintNotifyUrlRequest struct { + *requests.RpcRequest + MchId string `position:"Body" field:"mch_id" default:"" ` + NotifyUrl string `position:"Body" field:"notify_url" default:"" ` + Type int `position:"Body" field:"type" default:""` +} + +type ComplaintNotifyUrlResponse struct { + *responses.BaseResponse + Code int `json:"code"` + Msg string `json:"msg"` +} + +func CreateComplaintNotifyUrlRequest() (req *ComplaintNotifyUrlRequest) { + req = &ComplaintNotifyUrlRequest{ + RpcRequest: &requests.RpcRequest{}, + } + req.InitWithApiInfo(HOST, VERSION, "/api/complaint/createWxNotifyUrl") + req.Method = requests.POST + return +} + +func CreateComplaintNotifyUrlResponse() (response *ComplaintNotifyUrlResponse) { + response = &ComplaintNotifyUrlResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +}