|
@@ -2,8 +2,8 @@ package pay_controller
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
"fmt"
|
|
"fmt"
|
|
|
- "fohow.com/apps/models/base_config"
|
|
|
|
|
"fohow.com/apps/models/cent_model"
|
|
"fohow.com/apps/models/cent_model"
|
|
|
|
|
+ "fohow.com/apps/models/sys_config"
|
|
|
"fohow.com/libs/lib_redis"
|
|
"fohow.com/libs/lib_redis"
|
|
|
|
|
|
|
|
// "net/url"
|
|
// "net/url"
|
|
@@ -149,8 +149,8 @@ func (self *PayController) payExchange(oId, payWay, tradPwd, returnUrl, source,
|
|
|
totalCoupon := int64(0)
|
|
totalCoupon := int64(0)
|
|
|
userLeftBalanceCount := balance_model.GetUserTotalBalance(wxUId)
|
|
userLeftBalanceCount := balance_model.GetUserTotalBalance(wxUId)
|
|
|
tp := order.TotalPrice
|
|
tp := order.TotalPrice
|
|
|
- freight := base_config.GetFreight()
|
|
|
|
|
- if tp >= base_config.GetOrderLimit() {
|
|
|
|
|
|
|
+ freight := sys_config.GetFreight()
|
|
|
|
|
+ if tp >= sys_config.GetOrderLimit() {
|
|
|
freight = int64(0)
|
|
freight = int64(0)
|
|
|
}
|
|
}
|
|
|
tp += freight
|
|
tp += freight
|
|
@@ -203,15 +203,15 @@ func (self *PayController) payExchange(oId, payWay, tradPwd, returnUrl, source,
|
|
|
order.Source = source
|
|
order.Source = source
|
|
|
order.Save()
|
|
order.Save()
|
|
|
if order.Source == order_model.SOURCE_XCX { //小程序微信支付
|
|
if order.Source == order_model.SOURCE_XCX { //小程序微信支付
|
|
|
- freight := base_config.GetFreight()
|
|
|
|
|
- if order.TotalPrice >= base_config.GetOrderLimit() {
|
|
|
|
|
|
|
+ freight := sys_config.GetFreight()
|
|
|
|
|
+ if order.TotalPrice >= sys_config.GetOrderLimit() {
|
|
|
freight = int64(0)
|
|
freight = int64(0)
|
|
|
}
|
|
}
|
|
|
order.TotalPrice += freight
|
|
order.TotalPrice += freight
|
|
|
notifyUrl := fmt.Sprintf("%s/v1/pay/%s/async/%s", beego.AppConfig.String("ApiHost"), EXCHANGE_TARGET, pay_model.PAYWAY_WEIXINPAY)
|
|
notifyUrl := fmt.Sprintf("%s/v1/pay/%s/async/%s", beego.AppConfig.String("ApiHost"), EXCHANGE_TARGET, pay_model.PAYWAY_WEIXINPAY)
|
|
|
body := fmt.Sprintf("FOHOW玖玖-购买商品")
|
|
body := fmt.Sprintf("FOHOW玖玖-购买商品")
|
|
|
//获取paycode
|
|
//获取paycode
|
|
|
- payCode := pay_model.GetPayConfigByDepart(wxUser.Depart, true)
|
|
|
|
|
|
|
+ payCode := sys_config.GetPayConfigByDepart(wxUser.Depart, true)
|
|
|
payData := wx_mp.GetPayData(wxUser.Openid, order.OrderId, order.PaiedPrice, body, notifyUrl, self.Ctx.Input.IP(), payCode)
|
|
payData := wx_mp.GetPayData(wxUser.Openid, order.OrderId, order.PaiedPrice, body, notifyUrl, self.Ctx.Input.IP(), payCode)
|
|
|
|
|
|
|
|
//返回数据
|
|
//返回数据
|
|
@@ -248,7 +248,7 @@ func (self *PayController) payExchange(oId, payWay, tradPwd, returnUrl, source,
|
|
|
if wxGzh == nil {
|
|
if wxGzh == nil {
|
|
|
self.ReturnError(403, apps.NoExist, "", nil)
|
|
self.ReturnError(403, apps.NoExist, "", nil)
|
|
|
}
|
|
}
|
|
|
- payCode := pay_model.GetPayConfigByDepart(wxUser.Depart, true)
|
|
|
|
|
|
|
+ payCode := sys_config.GetPayConfigByDepart(wxUser.Depart, true)
|
|
|
payData := wx_mp.GetPayData(wxGzh.GzhOpenId, order.OrderId, order.PaiedPrice, body, notifyUrl, self.Ctx.Input.IP(), payCode)
|
|
payData := wx_mp.GetPayData(wxGzh.GzhOpenId, order.OrderId, order.PaiedPrice, body, notifyUrl, self.Ctx.Input.IP(), payCode)
|
|
|
|
|
|
|
|
//返回数据
|
|
//返回数据
|
|
@@ -267,7 +267,7 @@ func (self *PayController) payExchange(oId, payWay, tradPwd, returnUrl, source,
|
|
|
|
|
|
|
|
notifyUrl := fmt.Sprintf("%s/v1/pay/%s/async/%s", beego.AppConfig.String("ApiHost"), EXCHANGE_TARGET, pay_model.PAYWAY_WEIXINPAY)
|
|
notifyUrl := fmt.Sprintf("%s/v1/pay/%s/async/%s", beego.AppConfig.String("ApiHost"), EXCHANGE_TARGET, pay_model.PAYWAY_WEIXINPAY)
|
|
|
body := fmt.Sprintf("FOHOW玖玖-购买商品")
|
|
body := fmt.Sprintf("FOHOW玖玖-购买商品")
|
|
|
- payCode := pay_model.GetPayConfigByDepart(wxUser.Depart, true)
|
|
|
|
|
|
|
+ payCode := sys_config.GetPayConfigByDepart(wxUser.Depart, true)
|
|
|
payData := wx_mp.GetPayData(wxUser.Openid, order.OrderId, order.PaiedPrice, body, notifyUrl, self.Ctx.Input.IP(), payCode)
|
|
payData := wx_mp.GetPayData(wxUser.Openid, order.OrderId, order.PaiedPrice, body, notifyUrl, self.Ctx.Input.IP(), payCode)
|
|
|
|
|
|
|
|
//返回数据
|
|
//返回数据
|
|
@@ -285,7 +285,7 @@ func (self *PayController) payExchange(oId, payWay, tradPwd, returnUrl, source,
|
|
|
if wxGzh == nil {
|
|
if wxGzh == nil {
|
|
|
self.ReturnError(403, apps.NoExist, "", nil)
|
|
self.ReturnError(403, apps.NoExist, "", nil)
|
|
|
}
|
|
}
|
|
|
- payCode := pay_model.GetPayConfigByDepart(wxUser.Depart, true)
|
|
|
|
|
|
|
+ payCode := sys_config.GetPayConfigByDepart(wxUser.Depart, true)
|
|
|
|
|
|
|
|
//payData := wx_mp.GetPayData(wxGzh.GzhOpenId, order.OrderId , order.TotalPrice, body,notifyUrl, self.Ctx.Input.IP())
|
|
//payData := wx_mp.GetPayData(wxGzh.GzhOpenId, order.OrderId , order.TotalPrice, body,notifyUrl, self.Ctx.Input.IP())
|
|
|
payData := wx_mp.GetPayData(wxGzh.GzhOpenId, order.OrderId, order.PaiedPrice, body, notifyUrl, self.Ctx.Input.IP(), payCode)
|
|
payData := wx_mp.GetPayData(wxGzh.GzhOpenId, order.OrderId, order.PaiedPrice, body, notifyUrl, self.Ctx.Input.IP(), payCode)
|
|
@@ -391,8 +391,8 @@ func (self *PayController) payCentExchange(oId, returnUrl, source, remark string
|
|
|
//直接抵扣积分,积分不够则报错
|
|
//直接抵扣积分,积分不够则报错
|
|
|
userLeftCent := cent_model.GetCentTotalBalance(wxUId)
|
|
userLeftCent := cent_model.GetCentTotalBalance(wxUId)
|
|
|
tp := order.TotalPrice
|
|
tp := order.TotalPrice
|
|
|
- freight := base_config.GetFreight()
|
|
|
|
|
- if tp >= base_config.GetOrderLimit() {
|
|
|
|
|
|
|
+ freight := sys_config.GetFreight()
|
|
|
|
|
+ if tp >= sys_config.GetOrderLimit() {
|
|
|
freight = int64(0)
|
|
freight = int64(0)
|
|
|
}
|
|
}
|
|
|
tp += freight
|
|
tp += freight
|