feat(tenpayv3): 新增 Credentials 类型,存储初始化客户端时的凭证副本

This commit is contained in:
Fu Diwei
2021-07-27 00:50:03 +08:00
parent 191c781d27
commit 4d70b2ac5e
20 changed files with 186 additions and 179 deletions

View File

@@ -18,7 +18,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
if (client == null) throw new ArgumentNullException(nameof(client));
if (string.IsNullOrEmpty(callbackJson)) throw new ArgumentNullException(callbackJson);
return client.FlurlJsonSerializer.Deserialize<WechatTenpayEvent>(callbackJson);
return client.JsonSerializer.Deserialize<WechatTenpayEvent>(callbackJson);
}
/// <summary>
@@ -57,7 +57,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
try
{
plainJson = Utilities.AESUtility.DecryptWithGCM(
key: client.WechatMerchantV3Secret,
key: client.Credentials.MerchantV3Secret,
iv: resource.Nonce,
aad: resource.AssociatedData,
cipherText: resource.CipherText
@@ -73,7 +73,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
throw new Exceptions.WechatTenpayEventDecryptionException("Unknown encrypt algorithm of the resource.");
}
return client.FlurlJsonSerializer.Deserialize<T>(plainJson);
return client.JsonSerializer.Deserialize<T>(plainJson);
}
}
}