增加配置
This commit is contained in:
parent
d1694f2245
commit
8ac01cf6e5
|
@ -173,9 +173,17 @@ func EncryptRequest(request interface{}) (RequestData front.YouChuRequest) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func DecryptResponse(response string, isRequest bool) (Rsponse string) {
|
func DecryptResponse(response string, isRequest bool) (Rsponse string) {
|
||||||
MerchantId := config.GetConf().YouChuCallBack.MerchantId
|
var MerchantId, PrivateKey, PublicKey string
|
||||||
PrivateKey := config.GetConf().YouChuCallBack.PrivateKey
|
if isRequest {
|
||||||
PublicKey := config.GetConf().YouChuCallBack.SopPublicKey
|
MerchantId = config.GetConf().YouChuCallBack.MerchantId
|
||||||
|
PrivateKey = config.GetConf().YouChuCallBack.PrivateKey
|
||||||
|
PublicKey = config.GetConf().YouChuCallBack.SopPublicKey
|
||||||
|
} else {
|
||||||
|
MerchantId = config.GetConf().YouChu.MerchantId
|
||||||
|
PrivateKey = config.GetConf().Sm2.PrivateKey
|
||||||
|
PublicKey = config.GetConf().YouChu.SopPublicKey
|
||||||
|
}
|
||||||
|
|
||||||
encrypt, err := postbank.Decrypt(MerchantId, PrivateKey, PublicKey, response, isRequest)
|
encrypt, err := postbank.Decrypt(MerchantId, PrivateKey, PublicKey, response, isRequest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Rsponse
|
return Rsponse
|
||||||
|
|
Loading…
Reference in New Issue