From e173afb2220f7a372b630fd0598999dc67d8128c Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Thu, 1 Apr 2021 00:05:09 +0200 Subject: Update XML-Documentation --- src/IOL.VippsEcommerce.Client/Program.cs | 15 ++++++--------- src/IOL.VippsEcommerce/Models/VippsConfiguration.cs | 5 ++--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/IOL.VippsEcommerce.Client/Program.cs b/src/IOL.VippsEcommerce.Client/Program.cs index 2f83dc1..7488da2 100644 --- a/src/IOL.VippsEcommerce.Client/Program.cs +++ b/src/IOL.VippsEcommerce.Client/Program.cs @@ -6,15 +6,12 @@ using Microsoft.Extensions.DependencyInjection; var services = new ServiceCollection(); services.AddVippsEcommerceService(o => { - o.ApiUrl = ""; - o.PrimarySubscriptionKey = ""; - o.ClientSecret = ""; - o.ClientId = ""; - o.CacheEncryptionKey = ""; - o.CacheDirectoryPath = ""; - o.ConfigurationMode = VippsConfigurationMode.ONLY_OBJECT; + o.ConfigurationMode = VippsConfigurationMode.ONLY_ENVIRONMENT; }); var provider = services.BuildServiceProvider(); var vippsEcommerceService = provider.GetService(); -var res = vippsEcommerceService?.GetPaymentDetailsAsync("asdf").Result; -Console.WriteLine(JsonSerializer.Serialize(res)); \ No newline at end of file +if (vippsEcommerceService == default) { + return; +} + +Console.WriteLine(JsonSerializer.Serialize(vippsEcommerceService.Configuration)); \ No newline at end of file diff --git a/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs b/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs index d8b3a0f..4a78166 100644 --- a/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs +++ b/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs @@ -98,8 +98,7 @@ namespace IOL.VippsEcommerce.Models public string CacheEncryptionKey { get; set; } /// - /// Use environment variables for configuration. - /// If this is true, all requested properties are looked for in the environment. + /// Specify how to retrieve configuration and/or in what order. Defaults to VippsConfigurationMode.ONLY_OBJECT. /// public VippsConfigurationMode ConfigurationMode { get; set; } = VippsConfigurationMode.ONLY_OBJECT; @@ -107,7 +106,7 @@ namespace IOL.VippsEcommerce.Models /// Get value from configuration, either from Dependency injection or from the environment. /// /// Configuration key. - /// A string containing the configuration value (or a fallback). + /// A string containing the configuration value. public string GetValue(string key) { switch (ConfigurationMode) { case VippsConfigurationMode.ONLY_OBJECT: -- cgit v1.3