|
@@ -12,9 +12,10 @@ import (
|
|
|
)
|
|
|
|
|
|
const (
|
|
|
- channelWeChat = "7"
|
|
|
- timeoutSeconds = "900"
|
|
|
- BeforeOrderClose = 1 * time.Second
|
|
|
+ channelWeChat = "7"
|
|
|
+ timeoutSeconds = "900"
|
|
|
+ BeforeOrderClose = 1 * time.Second
|
|
|
+ DefaultDescription = "期海通行"
|
|
|
)
|
|
|
|
|
|
var (
|
|
@@ -44,6 +45,10 @@ func PayOrder(userId, templateUserId int, productOrder order.ProductOrderDTO) (p
|
|
|
logger.Error("创建支付订单失败:%v", err)
|
|
|
return
|
|
|
}
|
|
|
+ description := productOrder.ProductDescription
|
|
|
+ if description == "" {
|
|
|
+ description = DefaultDescription
|
|
|
+ }
|
|
|
payOrderDTO.TradeOrderNo = tradeOrderNo
|
|
|
payOrderDTO.AppId = htConfig.GetPaymentAppId()
|
|
|
payOrderDTO.Url = htConfig.GetPaymentApiUrl()
|
|
@@ -51,7 +56,7 @@ func PayOrder(userId, templateUserId int, productOrder order.ProductOrderDTO) (p
|
|
|
payOrderDTO.PaymentToken = token
|
|
|
payOrderDTO.ProductOrderNo = productOrder.OrderID
|
|
|
payOrderDTO.ProductTitle = productOrder.ProductName
|
|
|
- payOrderDTO.ProductDescription = productOrder.ProductDescription
|
|
|
+ payOrderDTO.ProductDescription = description
|
|
|
//微信用户的ID
|
|
|
payOrderDTO.BuyerId = templateUserId
|
|
|
payOrderDTO.PayType = "1,2"
|