浏览代码

update

add_mode
DengBiao 1年前
父节点
当前提交
d3f648e02d
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. +3
    -2
      app/customer/svc/svc_pay.go

+ 3
- 2
app/customer/svc/svc_pay.go 查看文件

@@ -18,6 +18,7 @@ import (
jsapi2 "github.com/wechatpay-apiv3/wechatpay-go/services/payments/jsapi"
utils2 "github.com/wechatpay-apiv3/wechatpay-go/utils"
"io/ioutil"
"math"
"net/url"
"strconv"
"time"
@@ -204,7 +205,7 @@ func BuyPackageForWx(c *gin.Context, req md.BuyPackageReq) (outTradeNo, total st
}
wxSvc := jsapi.JsapiApiService{Client: client}
sysCfg := sysCfgDb.SysCfgFindWithDb(enum2.WxAppletAppId, enum2.WxSpAppId, enum2.WxSpMchId, enum2.WxAppletAppId, enum2.WxMchId, enum2.WxJsapiPayNotifyUrl)
fmt.Println(int64(math.Round(totalPrice * 100)))
result, _, err := wxSvc.Prepay(c,
jsapi.PrepayRequest{
SpAppid: core.String(sysCfg[enum2.WxSpAppId]),
@@ -218,7 +219,7 @@ func BuyPackageForWx(c *gin.Context, req md.BuyPackageReq) (outTradeNo, total st
NotifyUrl: core.String(sysCfg[enum2.WxJsapiPayNotifyUrl]),
Amount: &jsapi.Amount{
Currency: core.String("CNY"),
Total: core.Int64(int64(totalPrice * 100)),
Total: core.Int64(int64(math.Round(totalPrice * 100))),
},
Payer: &jsapi.Payer{
//SpOpenid: core.String("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"),


正在加载...
取消
保存