增加虫虫助手支付

This commit is contained in:
ayflying
2025-07-31 19:11:19 +08:00
parent 61d69159ea
commit d54de73e11
6 changed files with 153 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
package honor
import (
"context"
"crypto"
"crypto/rsa"
"crypto/sha256"
@@ -28,7 +29,11 @@ func New(pay *Pay) *Pay {
// sign: 签名的Base64编码字符串
// pubKey: PEM格式的公钥字符串
// 返回验证结果和可能的错误
func (p *Pay) VerifyRSASignature(data []byte, sign string) (bool, error) {
func (p *Pay) VerifyRSASignature(ctx context.Context, data []byte, sign string) (bool, error) {
//req := g.RequestFromCtx(ctx).Request
//post, err := common.ParseNotifyToBodyMap(req)
//var data = gjson.MustEncode(post)
// 解码Base64格式的签名
signBytes, err := base64.StdEncoding.DecodeString(sign)
if err != nil {