Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wechat-client-sdk
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
go
wechat-client-sdk
Commits
7f2c922b
Commit
7f2c922b
authored
Oct 31, 2022
by
yemin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
e1b52624
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
Client.go
partnerpay/Client.go
+4
-5
partnerpayclient_test.go
test/partnerpayclient_test.go
+1
-0
No files found.
partnerpay/Client.go
View file @
7f2c922b
...
...
@@ -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
.
Sp
MchId
,
*
s
.
MchSerialNo
,
mchPrivateKey
,
*
s
.
ApiKey
),
}
wc
,
err
:=
core
.
NewClient
(
context
.
Background
(),
opts
...
)
if
err
!=
nil
{
...
...
test/partnerpayclient_test.go
0 → 100644
View file @
7f2c922b
package
test
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment