微信支付时,body必须填
This commit is contained in:
@@ -124,9 +124,10 @@ func Pay4Order(ctx *jxcontext.Context, orderID int64, payType int, vendorPayType
|
||||
if err == nil {
|
||||
switch payType {
|
||||
case model.PayTypeWX:
|
||||
orderPay, err = pay4OrderByWX(ctx, order, vendorPayType)
|
||||
dao.WrapAddIDCULDEntity(orderPay, ctx.GetUserName())
|
||||
err = dao.CreateEntity(dao.GetDB(), orderPay)
|
||||
if orderPay, err = pay4OrderByWX(ctx, order, vendorPayType); err == nil {
|
||||
dao.WrapAddIDCULDEntity(orderPay, ctx.GetUserName())
|
||||
err = dao.CreateEntity(dao.GetDB(), orderPay)
|
||||
}
|
||||
default:
|
||||
err = fmt.Errorf("支付方式:%d当前不支持", payType)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package localjx
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/wxpay"
|
||||
@@ -18,10 +19,14 @@ func vendorPayType2WxpayType(vendorPayType string) string {
|
||||
return vendorPayType
|
||||
}
|
||||
|
||||
func getOrderBrief(order *model.GoodsOrder) string {
|
||||
return fmt.Sprintf("%s等共%d件商品", order.Skus[0].SkuName, order.GoodsCount)
|
||||
}
|
||||
|
||||
func pay4OrderByWX(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayType string) (orderPay *model.OrderPay, err error) {
|
||||
payCreatedAt := time.Now()
|
||||
param := &wxpay.CreateOrderParam{
|
||||
Body: "",
|
||||
Body: getOrderBrief(order),
|
||||
NotifyURL: globals.WxpayNotifyURL,
|
||||
OutTradeNo: order.VendorOrderID,
|
||||
SpbillCreateIP: ctx.GetRealRemoteIP(),
|
||||
|
||||
Reference in New Issue
Block a user