init
This commit is contained in:
parent
4fc752416e
commit
4ea7b798dc
|
@ -1,13 +1,13 @@
|
|||
package internal
|
||||
|
||||
import (
|
||||
sdkproto "codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/proto"
|
||||
"codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/proto"
|
||||
"encoding/json"
|
||||
"plugins/zltx/internal/po"
|
||||
"time"
|
||||
)
|
||||
|
||||
func rechargeReq(c *sdkproto.OrderRequest) *po.OrderReq {
|
||||
func rechargeReq(c *proto.OrderRequest) *po.OrderReq {
|
||||
return &po.OrderReq{
|
||||
MerchantId: c.Config.AppId,
|
||||
OutTradeNo: c.Order.OrderNo,
|
||||
|
@ -21,11 +21,11 @@ func rechargeReq(c *sdkproto.OrderRequest) *po.OrderReq {
|
|||
}
|
||||
}
|
||||
|
||||
func rechargeResp(resp po.OrderResp) *sdkproto.OrderResponse {
|
||||
func rechargeResp(resp po.OrderResp) *proto.OrderResponse {
|
||||
data, _ := json.Marshal(resp)
|
||||
return &sdkproto.OrderResponse{
|
||||
Result: &sdkproto.Result{
|
||||
Status: sdkproto.Status_ING,
|
||||
return &proto.OrderResponse{
|
||||
Result: &proto.Result{
|
||||
Status: proto.Status_ING,
|
||||
OrderNo: "",
|
||||
TradeNo: "",
|
||||
Message: resp.Message,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package internal
|
||||
|
||||
import (
|
||||
"codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/utils"
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"net/url"
|
||||
"plugins/sdk/utils"
|
||||
"plugins/zltx/internal/po"
|
||||
"strings"
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package vo
|
||||
|
||||
import (
|
||||
proto2 "plugins/sdk/proto"
|
||||
"codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/proto"
|
||||
)
|
||||
|
||||
type OrderStatus string
|
||||
|
@ -13,10 +13,10 @@ const (
|
|||
OrderAbnormal OrderStatus = "04" // 充值异常,处理中
|
||||
)
|
||||
|
||||
var orderStatusMap = map[OrderStatus]proto2.Status{
|
||||
OrderSuccess: proto2.Status_SUCCESS,
|
||||
OrderPending: proto2.Status_ING,
|
||||
OrderFail: proto2.Status_FAIL,
|
||||
var orderStatusMap = map[OrderStatus]proto.Status{
|
||||
OrderSuccess: proto.Status_SUCCESS,
|
||||
OrderPending: proto.Status_ING,
|
||||
OrderFail: proto.Status_FAIL,
|
||||
}
|
||||
|
||||
func (o OrderStatus) IsSuccess() bool {
|
||||
|
@ -35,9 +35,9 @@ func (o OrderStatus) IsAbnormal() bool {
|
|||
return o == OrderAbnormal
|
||||
}
|
||||
|
||||
func (o OrderStatus) GetOrderStatus() proto2.Status {
|
||||
func (o OrderStatus) GetOrderStatus() proto.Status {
|
||||
if resultStatus, ok := orderStatusMap[o]; ok {
|
||||
return resultStatus
|
||||
}
|
||||
return proto2.Status_ING
|
||||
return proto.Status_ING
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue