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