Преглед на файлове

fix: restore cash recharge wx pay

Codex преди 1 месец
родител
ревизия
e50ed58fa5

+ 1 - 1
go/gopath/src/fohow.com/apps/controllers/cron_controller/wechat_order_shipping.go

@@ -125,7 +125,7 @@ func syncRechargeCashOrders(accessToken string, startAt, endAt time.Time, ret *W
 			continue
 		}
 		shippingItem := wx_mp.OrderShippingItem{ItemDesc: "余额充值"}
-		if !uploadWechatOrderShippingIfNeeded(accessToken, order.OrderId, order.TradeNo, wxUser.Openid, wx_mp.OrderShippingLogisticsVirtual, shippingItem, ret) {
+		if !uploadWechatOrderShippingIfNeeded(accessToken, order.OrderId, order.TradeNo, wxUser.Openid, wx_mp.OrderShippingLogisticsPickup, shippingItem, ret) {
 			ret.RechargeSkipped++
 			continue
 		}

+ 12 - 2
go/gopath/src/fohow.com/apps/controllers/pay_controller/after_pay_controller.go

@@ -219,7 +219,17 @@ func (self *PayController) wxPayCashczAsync() {
 
 	orderId := strings.Split(params.OutTradeNO, "_")[0]
 	order := balance_model.GetRechargeCashOrderByOId(orderId, false)
-	payCode := sys_config.GetPayConfigByDepart(order.Id, true)
+	if order == nil {
+		beego.BeeLogger.Error("wxPayCashczAsync.order not found: %s", orderId)
+		self.Ctx.WriteString(wx_mp.MapToXmlString(notifyResponse))
+		return
+	}
+	wxUser := user_model.GetWxUserById(order.WxUserId, true)
+	depart := int64(0)
+	if wxUser != nil {
+		depart = wxUser.Depart
+	}
+	payCode := sys_config.GetPayConfigByDepart(depart, true)
 	// 签名校验参数
 	if !wx_mp.VerifyPayResult(params, payCode) {
 		beego.BeeLogger.Error("wxPayCashczAsync.VerifyPayResult not pass")
@@ -228,7 +238,7 @@ func (self *PayController) wxPayCashczAsync() {
 	}
 
 	totalFee, _ := strconv.ParseInt(params.TotalFee, 10, 64)
-	if order == nil || order.TotalPrice != totalFee {
+	if order.TotalPrice != totalFee {
 		beego.BeeLogger.Error("wxPayCashczAsync.order err: %v", order)
 		self.Ctx.WriteString(wx_mp.MapToXmlString(notifyResponse))
 		return