private static JudoPayApi Create(Credentials credentials, string baseUrl, IJudoConfiguration configuration, ProductInfoHeaderValue userAgent) { var apiVersion = GetConfigValue(ApiVersionKey, VersioningHandler.DEFAULT_API_VERSION, configuration); return Create(credentials, baseUrl, apiVersion, userAgent); }
internal static string GetEnvironmentUrl(JudoEnvironment judoEnvironment, IJudoConfiguration configuration = null) { string key = null; string defaultValue = null; switch (judoEnvironment) { case JudoEnvironment.Sandbox: key = SandboxUrlKey; defaultValue = DEFAULT_SANDBOX_URL; break; case JudoEnvironment.Live: key = LiveUrlKey; defaultValue = DEFAULT_LIVE_URL; break; } return GetConfigValue(key, defaultValue, configuration ?? defaultConfigurationAccess); }
/// <summary> /// Creates an instance of the judopay API client with a custom base url, that will authenticate with your API token and secret. /// </summary> /// <remarks>This is intended for development/sandbox environments</remarks> /// <param name="token">Your API token (from our merchant dashboard)</param> /// <param name="secret">Your API secret (from our merchant dashboard)</param> /// <param name="baseUrl">Base URL for the Judopay api</param> /// <param name="userAgent">The name and version number of the calling application, should be in the form PRODUCT/VERSION</param> /// <param name="configuration">Application configuration accessor</param> /// <returns>Initialized instance of the Judopay api client</returns> public static JudoPayApi Create(string token, string secret, string baseUrl, IJudoConfiguration configuration = null) { var credentials = new Credentials(token, secret); return Create(credentials, baseUrl, configuration ?? defaultConfigurationAccess, null); }