From 2fb16a768724c3fec616e5bc2f69847922578989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Mon, 1 Jul 2024 14:59:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/zltx/internal/transform.go | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/plugins/zltx/internal/transform.go b/plugins/zltx/internal/transform.go index 2ed79ef..99443c0 100644 --- a/plugins/zltx/internal/transform.go +++ b/plugins/zltx/internal/transform.go @@ -3,6 +3,7 @@ package internal import ( "codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/proto" "encoding/json" + "net/http" "plugins/zltx/internal/po" "time" ) @@ -33,3 +34,38 @@ func rechargeResp(resp po.OrderResp) *proto.OrderResponse { }, } } + +func queryReq(in *proto.QueryRequest) *po.QueryReq { + return &po.QueryReq{ + MerchantId: in.Config.AppId, + //OutTradeNo: in.OutTradeNumber, + TimeStamp: time.Now().Unix(), + Version: "1.0", + } +} + +func queryResp(resp po.QueryResp) *proto.QueryResponse { + _, _ = json.Marshal(resp) + return &proto.QueryResponse{ + //OutTradeNumber: in.OutTradeNumber, + //TradeNumber: "", + //Status: resp.Status.GetOrderStatus(), + //TradePrice: in.Product.Price, + //Data: data, + //Message: resp.Message, + } +} + +func notifyResp(poReq po.Notify) *proto.NotifyResponse { + headers := make(http.Header) + headers.Add("content-type", "text/plain") + _, _ = json.Marshal(headers) + return &proto.NotifyResponse{ + //Result: poReq.Status.IsSuccess(), + //Msg: "ε›žθ°ƒθΏ”ε›ž", + //Data: dto.NotifyResponseData{ + // Headers: h, + // Body: []byte("success"), + //}, + } +}