/// <summary> /// Create and initialize an API Context. /// </summary> public static ApiContext Create(ApiEnvironmentType environmentType, string apiKey, string deviceDescription, List <string> permittedIps, string proxy = null) { var apiContext = new ApiContext { ApiKey = apiKey, EnvironmentType = environmentType, Proxy = proxy, }; apiContext.Initialize(deviceDescription, permittedIps); return(apiContext); }
/// <summary> /// Create and initialize an API Context. /// </summary> public static ApiContext CreateForPsd2(ApiEnvironmentType environmentType, X509Certificate2 publicCertificate, X509CertificateCollection certificateChain, string deviceDescription, List <string> permittedIps, string proxy = null) { var apiContext = new ApiContext { EnvironmentType = environmentType, Proxy = proxy, }; apiContext.InitializeInstallationContext(); apiContext.ApiKey = apiContext.InitializePsd2Credential(publicCertificate, certificateChain); apiContext.RegisterDevice(deviceDescription, permittedIps); apiContext.InitializeSessionContext(); return(apiContext); }
/// <summary> /// Create and initialize an API Context with current IP as permitted. /// </summary> public static ApiContext Create(ApiEnvironmentType environmentType, string apiKey, string deviceDescription, string proxy = null) { return(Create(environmentType, apiKey, deviceDescription, new List <string>(), proxy)); }