1
This commit is contained in:
parent
f2cc140a95
commit
e1bb4b963d
@ -129,6 +129,12 @@ func (this *InGameApi) PayDone(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sessionkeytime := q5.SafeToInt64(data["update_time"])
|
||||||
|
if service.Wxpay.CheckExpireCache(accountId, sessionkeytime) {
|
||||||
|
f5.RspErr(c, 402, "session expired")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
status := orderModel.Status
|
status := orderModel.Status
|
||||||
rspObj := struct {
|
rspObj := struct {
|
||||||
ErrorCode int32 `json:"errcode"`
|
ErrorCode int32 `json:"errcode"`
|
||||||
@ -140,7 +146,7 @@ func (this *InGameApi) PayDone(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
for status < 2 {
|
for status < 2 {
|
||||||
gameid := q5.SafeToInt64(strs[1])
|
gameid := q5.SafeToInt64(strs[1])
|
||||||
openid := strs[2]
|
openid := q5.SafeToString(data["openid"])
|
||||||
sessionkey := q5.SafeToString(data["session_key"])
|
sessionkey := q5.SafeToString(data["session_key"])
|
||||||
userip := this.getIP(c)
|
userip := this.getIP(c)
|
||||||
balance, errcode, err := int64(0), int32(0), error(nil)
|
balance, errcode, err := int64(0), int32(0), error(nil)
|
||||||
@ -160,6 +166,8 @@ func (this *InGameApi) PayDone(c *gin.Context) {
|
|||||||
status = 1
|
status = 1
|
||||||
orderModel.Status = 3
|
orderModel.Status = 3
|
||||||
orderModel.UpdateFields([]string{"status"})
|
orderModel.UpdateFields([]string{"status"})
|
||||||
|
|
||||||
|
rspObj.Diamond = balance
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,8 +176,6 @@ func (this *InGameApi) PayDone(c *gin.Context) {
|
|||||||
rspObj.ErrMsg = "session overtime"
|
rspObj.ErrMsg = "session overtime"
|
||||||
}
|
}
|
||||||
|
|
||||||
rspObj.Diamond = balance
|
|
||||||
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,10 +232,12 @@ func (this *InGameApi) OrderInfo(c *gin.Context) {
|
|||||||
ErrMsg string `json:"errmsg"`
|
ErrMsg string `json:"errmsg"`
|
||||||
OrderId string `json:"order_id"`
|
OrderId string `json:"order_id"`
|
||||||
GoodsId int32 `json:"goods_id"`
|
GoodsId int32 `json:"goods_id"`
|
||||||
|
Count int32 `json:"count"`
|
||||||
Status int32 `json:"status"`
|
Status int32 `json:"status"`
|
||||||
}{
|
}{
|
||||||
OrderId: orderModel.OrderId,
|
OrderId: orderModel.OrderId,
|
||||||
GoodsId: orderModel.ItemId,
|
GoodsId: orderModel.ItemId,
|
||||||
|
Count: orderModel.SpAmount,
|
||||||
Status: orderModel.Status,
|
Status: orderModel.Status,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,7 +263,8 @@ func (this *InGameApi) OrderInfo(c *gin.Context) {
|
|||||||
errcode = service.Wxpay.QueryPay(openid, gameid, userip, sessionkey, int32(count), orderModel.OrderId)
|
errcode = service.Wxpay.QueryPay(openid, gameid, userip, sessionkey, int32(count), orderModel.OrderId)
|
||||||
if errcode == constant.WX_ERRCODE_OK {
|
if errcode == constant.WX_ERRCODE_OK {
|
||||||
orderModel.Status = 1
|
orderModel.Status = 1
|
||||||
orderModel.UpdateFields([]string{"status"})
|
orderModel.SpAmount = int32(count)
|
||||||
|
orderModel.UpdateFields([]string{"status", "sp_amount"})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user