|
@@ -15,7 +15,7 @@ const (
|
|
channelWeChat = "7"
|
|
channelWeChat = "7"
|
|
timeoutSeconds = "900"
|
|
timeoutSeconds = "900"
|
|
BeforeOrderClose = 1 * time.Second
|
|
BeforeOrderClose = 1 * time.Second
|
|
- DefaultDescription = "期海通行"
|
|
|
|
|
|
+ DefaultDescription = "期海通行小程序商品订单"
|
|
)
|
|
)
|
|
|
|
|
|
var (
|
|
var (
|
|
@@ -23,7 +23,7 @@ var (
|
|
htConfig = config.GetConfig(contants.HT).(*config.HTBizConfig)
|
|
htConfig = config.GetConfig(contants.HT).(*config.HTBizConfig)
|
|
)
|
|
)
|
|
|
|
|
|
-func PayOrder(userId, templateUserId int, productOrder order.ProductOrderDTO) (payOrderDTO order.PayOrderDTO, err error) {
|
|
|
|
|
|
+func PayOrder(userId, templateUserId int, openId string, productOrder order.ProductOrderDTO) (payOrderDTO order.PayOrderDTO, err error) {
|
|
//在redis中生成token,前端通过token获取订单状态
|
|
//在redis中生成token,前端通过token获取订单状态
|
|
expiredTime := productOrder.ExpiredTime.Sub(time.Now().Add(BeforeOrderClose))
|
|
expiredTime := productOrder.ExpiredTime.Sub(time.Now().Add(BeforeOrderClose))
|
|
tradeOrderNo := order.GenerateTradeOrderNo()
|
|
tradeOrderNo := order.GenerateTradeOrderNo()
|
|
@@ -57,6 +57,7 @@ func PayOrder(userId, templateUserId int, productOrder order.ProductOrderDTO) (p
|
|
payOrderDTO.ProductOrderNo = productOrder.OrderID
|
|
payOrderDTO.ProductOrderNo = productOrder.OrderID
|
|
payOrderDTO.ProductTitle = productOrder.ProductName
|
|
payOrderDTO.ProductTitle = productOrder.ProductName
|
|
payOrderDTO.ProductDescription = description
|
|
payOrderDTO.ProductDescription = description
|
|
|
|
+ payOrderDTO.OpenId = openId
|
|
//微信用户的ID
|
|
//微信用户的ID
|
|
payOrderDTO.BuyerId = templateUserId
|
|
payOrderDTO.BuyerId = templateUserId
|
|
payOrderDTO.PayType = "1,2"
|
|
payOrderDTO.PayType = "1,2"
|