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"), + //}, + } +}