Commit 7f2c922b by yemin

no message

parent e1b52624
......@@ -43,24 +43,23 @@ func (s *WechatPartnerPayClient) WxJsApiOrder(p *PaymentJsApiParam) *PaymentJsAp
if !b {
panic(errors.New("金额错误请检查,请检查"))
}
resp, _, err := svc.Prepay(context.Background(),
jsapi.PrepayRequest{
SpAppid: s.AppId,
SpMchid: s.SpMchId,
SubMchid: s.MchId,
Description: p.Title,
OutTradeNo: p.OutTradeNo,
NotifyUrl: p.CallBackUrl,
TimeExpire: core.Time(getTimeExpire(p.TimeExpire)),
Amount: &jsapi.Amount{
Total: core.Int64(money.Int64()),
},
Payer: &jsapi.Payer{
SpOpenid: p.OpenId,
},
Attach: p.Attach,
pr := jsapi.PrepayRequest{
SpAppid: s.AppId,
SpMchid: s.SpMchId,
SubMchid: s.MchId,
Description: p.Title,
OutTradeNo: p.OutTradeNo,
NotifyUrl: p.CallBackUrl,
TimeExpire: core.Time(getTimeExpire(p.TimeExpire)),
Amount: &jsapi.Amount{
Total: core.Int64(money.Int64()),
},
)
Payer: &jsapi.Payer{
SpOpenid: p.OpenId,
},
Attach: p.Attach,
}
resp, _, err := svc.Prepay(context.Background(), pr)
if err != nil {
panic(errors.New(getErrMessage(err.Error())))
}
......@@ -85,7 +84,7 @@ func (s *WechatPartnerPayClient) getWxPayClient() *core.Client {
// 使用商户私钥等初始化 client,并使它具有自动定时获取微信支付平台证书的能力
opts := []core.ClientOption{
option.WithWechatPayAutoAuthCipher(*s.MchId, *s.MchSerialNo, mchPrivateKey, *s.ApiKey),
option.WithWechatPayAutoAuthCipher(*s.SpMchId, *s.MchSerialNo, mchPrivateKey, *s.ApiKey),
}
wc, err := core.NewClient(context.Background(), opts...)
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment