This commit is contained in:
parent
0821633b0e
commit
2fb16a7687
|
@ -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"),
|
||||
//},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue