支付和广告调试
This commit is contained in:
@@ -97,17 +97,19 @@ func Recharge(ctx context.Context, in *RechargeRequest, ua ua.UA, deduct *Activi
|
||||
|
||||
// 下单
|
||||
now := time.Now()
|
||||
res, err := (&rchgutil.Recharge{
|
||||
TradeNo: order.ID.Hex(),
|
||||
Money: rchgutil.FenToYuan(order.Money),
|
||||
Type: order.RechargeType,
|
||||
Info: rchgutil.PayInfo{
|
||||
PlayerId: strconv.FormatUint(order.UID, 10),
|
||||
PlayerIp: order.UserIP,
|
||||
DeviceId: order.DevID,
|
||||
Tel: order.Tel,
|
||||
DeviceType: order.DevType,
|
||||
},
|
||||
res, err := (&rchgutil.Rchg{
|
||||
TransNo: order.ID.Hex(),
|
||||
UID: strconv.FormatUint(order.UID, 10),
|
||||
DevID: order.DevID,
|
||||
UserIP: order.UserIP,
|
||||
Name: u.Name,
|
||||
Tel: order.Tel,
|
||||
DevType: order.DevType,
|
||||
Money: order.Money,
|
||||
Channel: "self",
|
||||
CreatedAt: now,
|
||||
PayMethod: order.RechargeType,
|
||||
ProductType: 0,
|
||||
}).ToPayNew(ctx)
|
||||
if err != nil {
|
||||
log.ErrorX(ctx, fmt.Sprintf("用户ID[%d] 支付方式[%s] 购买类型[%d] 产品ID[%v] 产品子ID[%v] 下单请求异常[%v]",
|
||||
@@ -123,8 +125,8 @@ func Recharge(ctx context.Context, in *RechargeRequest, ua ua.UA, deduct *Activi
|
||||
ProgressAt: &now,
|
||||
OID: &res.OID,
|
||||
Mode: &res.Mode,
|
||||
//Channel: &res.CID,
|
||||
Rate: &res.Rebate,
|
||||
Channel: &res.CID,
|
||||
Rate: &res.Rate,
|
||||
}
|
||||
if err = rchgordmod.Update(nil, order.ID, set); err != nil {
|
||||
log.ErrorX(ctx, fmt.Sprintf("用户ID[%d] 支付方式[%s] 购买类型[%d] 产品ID[%v] 产品子ID[%v] 更新订单异常[%v]",
|
||||
@@ -507,6 +509,11 @@ func RechargeCallBack(ctx context.Context, oid string, payMoney int64, tradeNo s
|
||||
if r.ProductType == 1 {
|
||||
return errors.New("瓦力游戏已下架")
|
||||
}
|
||||
// 回调订单号需与下单时支付平台返回的订单号一致
|
||||
if r.OID != "" && oid != r.OID {
|
||||
log.ErrorX(ctx, "充值回调支付平台订单号不一致", log.Any("oid", oid), log.Any("orderOid", r.OID), log.Any("tradeNo", tradeNo))
|
||||
return errors.New("oid 错误")
|
||||
}
|
||||
// 新版充值---根据购买类型处理
|
||||
var (
|
||||
fn func(*db.MongoTool) error
|
||||
|
||||
Reference in New Issue
Block a user