Skip to content

Commit

Permalink
change alipay cert
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed Jun 9, 2023
1 parent bd8f408 commit 026241e
Show file tree
Hide file tree
Showing 13 changed files with 131 additions and 107 deletions.
19 changes: 0 additions & 19 deletions alipay/cert/alipayCertPublicKey_RSA2.crt

This file was deleted.

38 changes: 38 additions & 0 deletions alipay/cert/alipayPublicCert.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
-----BEGIN CERTIFICATE-----
MIIDszCCApugAwIBAgIQICMGCYNKwsloIKi8XMlUgzANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE
BhMCQ04xGzAZBgNVBAoMEkFudCBGaW5hbmNpYWwgdGVzdDElMCMGA1UECwwcQ2VydGlmaWNhdGlv
biBBdXRob3JpdHkgdGVzdDE+MDwGA1UEAww1QW50IEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1
dGhvcml0eSBDbGFzcyAyIFIxIHRlc3QwHhcNMjMwNjA5MTI1MjAzWhcNMjQwNjA4MTI1MjAzWjCB
hDELMAkGA1UEBhMCQ04xHzAdBgNVBAoMFmxhZ21pczYyNTRAc2FuZGJveC5jb20xDzANBgNVBAsM
BkFsaXBheTFDMEEGA1UEAww65pSv5LuY5a6dKOS4reWbvSnnvZHnu5zmioDmnK/mnInpmZDlhazl
j7gtMjA4ODcyMTAwMzIzNjQ0MjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJN/z9yl
+66sFRDJG2ZWPND6gSsTR7DAeKucCm6SlNimX3w4opVd2z6Rz5tcB2iRyh7nZoq1Vo5+uZSLKaiD
IAOEaFNwn9LBLPDH/WgM79BeOygFm9qAYQ8kHGBrR37Sxu6tphgWpVyu0yVlgNvgwdlALX2RCwUW
lYbGhe2wpBndxo00lwWXMlwEoYJx/eAu8k69iEW7/kp8HnU3Qih8V76D0bwAcpTvSq8fDIsiRAgQ
X0EnAOu0rC/hNTCojFXTKJs5UxEO1tFBALc5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jfU7xmS9Yoozuu+iuqZlb6Z0SPLUqqTZAFZejOcmr07ln/pwZxluqplxC
5+B48End4nclDMlT5HPrDr3W0frs6Xsa2ZNcyil/iKNB5MbGll8LRAxntsKvZZj6vUTMb705gYgm
VUMILwi/ZxKTQqBtkT/kQQ5y6nOZsj7XI5rYdz6qqOROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi
t25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG
wpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3
DQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT
yWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf
LTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p
j1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy
1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW
-----END CERTIFICATE-----
19 changes: 0 additions & 19 deletions alipay/cert/appCertPublicKey.crt

This file was deleted.

19 changes: 19 additions & 0 deletions alipay/cert/appPublicCert.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDmTCCAoGgAwIBAgIQICMGCXK2Am4QGbc/5Yi2QjANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE
BhMCQ04xGzAZBgNVBAoMEkFudCBGaW5hbmNpYWwgdGVzdDElMCMGA1UECwwcQ2VydGlmaWNhdGlv
biBBdXRob3JpdHkgdGVzdDE+MDwGA1UEAww1QW50IEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1
dGhvcml0eSBDbGFzcyAyIFIxIHRlc3QwHhcNMjMwNjA5MTI1MjAyWhcNMjQwNjEzMTI1MjAyWjBr
MQswCQYDVQQGEwJDTjEfMB0GA1UECgwWbGFnbWlzNjI1NEBzYW5kYm94LmNvbTEPMA0GA1UECwwG
QWxpcGF5MSowKAYDVQQDDCEyMDg4NzIxMDAzMjM2NDQyLTIwMjEwMDAxMjI2NzIzODgwggEiMA0G
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDDTHpBfR55b5dE2Hi78EbVGzK5hiweap6eTgas9XwS
WtQQ3qctHBJcZIgi4i7IKjS3izAI2n1DniD4BSakB114EJiEcqsBgbifXUyddRiiwR7jfDNSF3s9
penFy0WVIqEWBgGJftxCD87xOEcknQfRDL6T000naAyd8/KmT3/jcOy0eYoRVC+BClyCeGVsrxfi
2EgrjNbTHAeAOFIB5m71Au9/9xzY90qZ3nGJRQzsns+3BPtW9sojbt9g4F7WHHGu+ljq9wYYZqXz
GE04oP56KpcCA+AhFi5eouk+Bpg4iaOecf2UinOOsI7SextrVPi2icOOnmO/QVpIrA5MCM7pAgMB
AAGjEjAQMA4GA1UdDwEB/wQEAwIE8DANBgkqhkiG9w0BAQsFAAOCAQEAZc2RyiGKftnKi/0zIUUl
xKDPyUdVBBYDagcraHROKXafsZEnhO/cdBPC3VAJEiygNvddB51l088cGb8pGS2VqTQqR/Ehmd1x
kLMleWlUocX0Mwctz/J6jNp9/JKcVe1jk492HR7Csqjf+hvsajIVliIWzuhzB7C0eNEb46Js/G8T
QmsX92eHI0r2pcmsVr+PmDioLu4H4miKrDRhXNXLQ2AQfxPOCOtxt0tSNrB97bDNSwB1O4OItmr/
Cimb7l1nqxY3BOY5o8iAWLv4wG4giYu9LSrEJW0nWa2JG059kMlWLSVe7Afx0GzMVQUP6NJNdulP
ddebveu2CNZcJ7ipbA==
-----END CERTIFICATE-----
84 changes: 52 additions & 32 deletions alipay/cert/cert.go
Original file line number Diff line number Diff line change
@@ -1,31 +1,51 @@
package cert

var (
Appid = ""
Appid = "2021000122672388"

// 私钥
PrivateKey = "MIIEowIBAAKCAQEAnG3YbVuCU0QptQAzHnscy1W3a5pehEoGjPdhvpUu2DRtybapSw16d3rVTnMUdZctvMSmU0fXfuOjPFvzuhJGwkwJBnGqPONAt1ourlUzEzl3sIRbcyXMxVFXOcV2DsKFcCATGLhWev48jNfoLNP0AD3H63g70NuLg/Cx1v6fWE8mZBSSINNNK2xDyP/rDRKbCGBKXxYKD6tJXNpc7GOaT8G6IDQTfHzDQSAoMzcW3SultLcp6UdyLP+pibovW410IAL1vCrD6nmunT1eXKzZFHbKPsGC9OVxyYbJIPu6e/K24LcD5s51OP9bmKjlGsj0TeVW1vBnQrfPiyJ1+mxz8QIDAQABAoIBAHJrgpBTDBvd0uf7MmkMQj6U/yos6w+2md4IoS1nL7Gjf964xlIIlNjKNzY/xOpSX3khGkv2U7ETzvW6iKdE8Q7z0PIuuAf7bf3vcA/CcC6SrXKnDcFHF+YInlW6kqUvMa2XOICvbUpfpmibEM+hZWu7xPz+oDogLIegymRpMKLFcl50vd/mpChJifN7k3/4pC/n8SlAB3K1xakRWvsfEyj2DgzSB/CDCSOsVi1J1P9YfZ1dU0E3GOIRFtrbrtagBaOPeYiS1qSkwlCyy9UXo3RAsooSjbUZtU+IhuqOFXIySG9gV6gMLFzsaGoRRPCnI9yS/cosSHXo8CTDW8urBqUCgYEA6Dn3wI/nTGceUfD+yaqSV159pwWptSRfhbY5iduJCsbEkI3MhP6WW0vHPL5inixm1Gz2c8/0Xr+5fiwK73vPApQu8tj33wjUYOLsZdi2gXEHyi1e341UwIBUubTO13ZlUtAt9pMaYBusAbGV6JXF5/KJzZ5SnnENWuMBo2OlwqcCgYEArHFuqFiNQ9eGpwv8B802BEVU0HKNxkkKBc11MDLoqF4VXWEUp4eenMVFYrVNyrTfeKszcf2bM7gSMpYc89Nsq7njVQxkaJfS8p/cEV1cGYJrNbEHbSofU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ypdHOMIM9Iz9DlL1mrCykbBi
t25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG
wpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3
DQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT
yWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf
LTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p
j1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy
1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW
-----END CERTIFICATE-----
`)

// 支付宝根证书
AlipayRootContent = []byte(`-----BEGIN CERTIFICATE-----
Expand Down Expand Up @@ -119,22 +139,22 @@ Yf4Zr0fJsGuv

// 应用公钥证书
AppPublicContent = []byte(`-----BEGIN CERTIFICATE-----
MIIDmTCCAoGgAwIBAgIQICEGEtdR5YUIwp9bt5LmGjANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE
MIIDmTCCAoGgAwIBAgIQICMGCXK2Am4QGbc/5Yi2QjANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE
BhMCQ04xGzAZBgNVBAoMEkFudCBGaW5hbmNpYWwgdGVzdDElMCMGA1UECwwcQ2VydGlmaWNhdGlv
biBBdXRob3JpdHkgdGVzdDE+MDwGA1UEAww1QW50IEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1
dGhvcml0eSBDbGFzcyAyIFIxIHRlc3QwHhcNMjEwNjEyMTAxMzIxWhcNMjQwNjEwMTAxMzIxWjBr
MQ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LmNvbTEPMA0GA1UECwwG
QWxpcGF5MSowKAYDVQQDDCEyMDg4NzIxMDAzMjM2NDQyLTIwMjEwMDAxMjI2NzIzODgwggEiMA0G
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDDTHpBfR55b5dE2Hi78EbVGzK5hiweap6eTgas9XwS
WtQQ3qctHBJcZIgi4i7IKjS3izAI2n1DniD4BSakB114EJiEcqsBgbifXUyddRiiwR7jfDNSF3s9
penFy0WVIqEWBgGJftxCD87xOEcknQfRDL6T000naAyd8/KmT3/jcOy0eYoRVC+BClyCeGVsrxfi
2EgrjNbTHAeAOFIB5m71Au9/9xzY90qZ3nGJRQzsns+3BPtW9sojbt9g4F7WHHGu+ljq9wYYZqXz
GE04oP56KpcCA+AhFi5eouk+Bpg4iaOecf2UinOOsI7SextrVPi2icOOnmO/QVpIrA5MCM7pAgMB
AAGjEjAQMA4GA1UdDwEB/wQEAwIE8DANBgkqhkiG9w0BAQsFAAOCAQEAZc2RyiGKftnKi/0zIUUl
xKDPyUdVBBYDagcraHROKXafsZEnhO/cdBPC3VAJEiygNvddB51l088cGb8pGS2VqTQqR/Ehmd1x
kLMleWlUocX0Mwctz/J6jNp9/JKcVe1jk492HR7Csqjf+hvsajIVliIWzuhzB7C0eNEb46Js/G8T
QmsX92eHI0r2pcmsVr+PmDioLu4H4miKrDRhXNXLQ2AQfxPOCOtxt0tSNrB97bDNSwB1O4OItmr/
Cimb7l1nqxY3BOY5o8iAWLv4wG4giYu9LSrEJW0nWa2JG059kMlWLSVe7Afx0GzMVQUP6NJNdulP
ddebveu2CNZcJ7ipbA==
-----END CERTIFICATE-----`)
)
2 changes: 1 addition & 1 deletion alipay/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Client struct {
IsProd bool
bodySize int // http response body size(MB), default is 10MB
privateKey *rsa.PrivateKey
aliPayPublicKey *rsa.PublicKey // 支付宝证书公钥内容 alipayCertPublicKey_RSA2.crt
aliPayPublicKey *rsa.PublicKey // 支付宝证书公钥内容 alipayPublicCert.crt
autoSign bool
DebugSwitch gopay.DebugSwitch
location *time.Location
Expand Down
19 changes: 2 additions & 17 deletions alipay/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ func TestMain(m *testing.M) {
SetNotifyUrl("https://www.fmm.ink")

// 自动同步验签(只支持证书模式)
// 传入 alipayCertPublicKey_RSA2.crt 内容
// 传入 支付宝公钥证书 alipayPublicCert.crt 内容
client.AutoVerifySign(cert.AlipayPublicContentRSA2)

// 传入证书内容
err := client.SetCertSnByContent(cert.AppPublicContent, cert.AlipayRootContent, cert.AlipayPublicContentRSA2)
// 传入证书文件路径
//err := client.SetCertSnByPath("cert/appCertPublicKey_2021000117673683.crt", "cert/alipayRootCert.crt", "cert/alipayCertPublicKey_RSA2.crt")
//err := client.SetCertSnByPath("cert/appPublicCert.crt", "cert/alipayRootCert.crt", "cert/alipayPublicCert.crt")
if err != nil {
xlog.Debug("SetCertSn:", err)
return
Expand Down Expand Up @@ -79,21 +79,6 @@ func TestClient_PostAliPayAPISelfV2(t *testing.T) {
xlog.Debug(aliPsp.Response)
}

func TestClient_PostAliPayAPISelf(t *testing.T) {
bm := make(gopay.BodyMap)
bm.Set("subject", "预创建创建订单")
bm.Set("out_trade_no", util.RandomString(32))
bm.Set("total_amount", "100")

aliPsp := new(TradePrecreateResponse)
err := client.PostAliPayAPISelf(ctx, bm, "alipay.trade.precreate", aliPsp)
if err != nil {
xlog.Error(err)
return
}
xlog.Debug(aliPsp.Response)
}

// =================================================

func TestDecryptOpenDataToBodyMap(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions alipay/payment_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ func TestClient_TradeCreate(t *testing.T) {
// 请求参数
bm := make(gopay.BodyMap)
bm.Set("subject", "创建订单").
Set("buyer_id", "2088802095984694").
Set("buyer_id", "2088722003236450").
Set("out_trade_no", util.RandomString(32)).
Set("total_amount", "0.01")
Set("total_amount", "100.10")

// 创建订单
aliRsp, err := client.TradeCreate(ctx, bm)
Expand Down Expand Up @@ -148,7 +148,7 @@ func TestClient_TradePay(t *testing.T) {
}

func TestClient_TradeQuery(t *testing.T) {
const outTradeNo = "Xdhxpe4bI5hhXAldhkMiGTZ03Jm9V6V0"
const outTradeNo = "GZ201909081743431443"
// 请求参数
bm := make(gopay.BodyMap)
bm.Set("out_trade_no", outTradeNo)
Expand Down
Loading

0 comments on commit 026241e

Please sign in to comment.