Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持微信支付公钥验签 (全新商户) #220

Closed
wants to merge 2 commits into from

Conversation

xy-peng
Copy link
Contributor

@xy-peng xy-peng commented Apr 20, 2024

方案

  1. 扩展了 verifierencryptors,支持微信支付公钥
  2. 将本地平台证书的方法标识为废弃

如何使用

// 初始化 Client
opts := []core.ClientOption{
	option.WithWechatPayPublicKeyAuthCipher(
		mchID,
		mchCertificateSerialNumber, mchPrivateKey,
		wechatpayPublicKeyID, wechatpayPublicKey),
}
client, err := core.NewClient(ctx, opts...)

// 初始化 notify.Handler
handler := notify.NewNotifyHandler(
	mchAPIv3Key, 
	verifiers.NewSHA256WithRSAPubkeyVerifier(wechatpayPublicKeyID, *wechatPayPublicKey))

@xy-peng xy-peng requested a review from wujunjiesd April 20, 2024 04:53
@xy-peng xy-peng force-pushed the feat/verify_signature_using_publickey branch from 7abb40c to 5737c5a Compare April 20, 2024 06:43
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@xy-peng xy-peng closed this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant