public WeChatPayCertificateClient(WeChatPayOptions options) { Options = options; if (string.IsNullOrEmpty(Options.Certificate) || string.IsNullOrEmpty(Options.MchId)) { throw new Exception("Error Certificate or MchId is Empty!"); } var clientHandler = new HttpClientHandler(); clientHandler.ClientCertificates.Add(new X509Certificate2(Convert.FromBase64String(Options.Certificate), Options.MchId, X509KeyStorageFlags.MachineKeySet)); Client = new HttpClientEx(clientHandler); }
public WeChatPayNotifyClient(IOptions <WeChatPayOptions> optionsAccessor) { Options = optionsAccessor?.Value ?? new WeChatPayOptions(); }
public WeChatPayNotifyClient(WeChatPayOptions options) { Options = options; }
public WeChatPayClient(WeChatPayOptions options) { Options = options; Client = new HttpClientEx(); }