Commit 7f2c922b by yemin

no message

parent e1b52624
......@@ -43,8 +43,7 @@ func (s *WechatPartnerPayClient) WxJsApiOrder(p *PaymentJsApiParam) *PaymentJsAp
if !b {
panic(errors.New("金额错误请检查,请检查"))
}
resp, _, err := svc.Prepay(context.Background(),
jsapi.PrepayRequest{
pr := jsapi.PrepayRequest{
SpAppid: s.AppId,
SpMchid: s.SpMchId,
SubMchid: s.MchId,
......@@ -59,8 +58,8 @@ func (s *WechatPartnerPayClient) WxJsApiOrder(p *PaymentJsApiParam) *PaymentJsAp
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