京东商城订单

This commit is contained in:
苏尹岚
2020-08-03 09:00:51 +08:00
parent 89a3108eee
commit 6f44c537d6

View File

@@ -81,8 +81,8 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err
OrderCreatedAt: utils.Str2Time(msg.OrderStartTime),
ConsigneeAddress: Decrypt(msg.ConsigneeInfo.FullAddress),
ConsigneeName: Decrypt(msg.ConsigneeInfo.Fullname),
ConsigneeMobile: Decrypt(msg.ConsigneeInfo.Telephone),
ConsigneeMobile2: Decrypt(msg.ConsigneeInfo.Mobile),
ConsigneeMobile: Decrypt(msg.ConsigneeInfo.Mobile),
ConsigneeMobile2: Decrypt(msg.ConsigneeInfo.Telephone),
ActualPayPrice: jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderPayment)),
Status: model.OrderStatusNew,
TotalShopMoney: utils.Float64TwoInt64(math.Round(float64(jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderPayment))) * jdshopapi.JdsPayPercentage)),
@@ -170,6 +170,9 @@ func setJdsOrderSeq(order *model.GoodsOrder) (err error) {
}
func Decrypt(p string) (result string) {
if p == "" {
return ""
}
data, _ := base64.StdEncoding.DecodeString(strings.ReplaceAll(p, " ", "+"))
key := GetKey(hex.EncodeToString(data)[4:36])
data2, _ := base64.StdEncoding.DecodeString(key)