diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/IOL.VippsEcommerce.Client/Program.cs | 2 | ||||
| -rw-r--r-- | src/IOL.VippsEcommerce/Models/VippsConfiguration.cs | 22 |
2 files changed, 16 insertions, 8 deletions
diff --git a/src/IOL.VippsEcommerce.Client/Program.cs b/src/IOL.VippsEcommerce.Client/Program.cs index a4faccc..b165f63 100644 --- a/src/IOL.VippsEcommerce.Client/Program.cs +++ b/src/IOL.VippsEcommerce.Client/Program.cs @@ -9,6 +9,8 @@ services.AddVippsEcommerceService(o => { o.PrimarySubscriptionKey = ""; o.ClientSecret = ""; o.ClientId = ""; + o.CacheEncryptionKey = ""; + o.CacheDirectoryPath = ""; }); var provider = services.BuildServiceProvider(); var vippsEcommerceService = provider.GetService<IVippsEcommerceService>(); diff --git a/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs b/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs index 5411ebc..e1b339e 100644 --- a/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs +++ b/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs @@ -8,7 +8,7 @@ namespace IOL.VippsEcommerce.Models public class VippsConfiguration { /// <summary> - /// Url for the vipps api. + /// Url for the vipps api. This property is required. /// <example>https://apitest.vipps.no</example> /// <example>https://api.vipps.no</example> /// <para>Corresponding environment variable name: VIPPS_API_URL</para> @@ -17,28 +17,32 @@ namespace IOL.VippsEcommerce.Models public string ApiUrl { get; set; } /// <summary> - /// Client ID for the merchant (the "username") + /// Client ID for the merchant (the "username"). This property is required. /// <para>Corresponding environment variable name: VIPPS_CLIENT_ID</para> /// </summary> [VippsConfigurationKeyName(VippsConfigurationKeyNames.VIPPS_CLIENT_ID)] public string ClientId { get; set; } /// <summary> - /// Client Secret for the merchant (the "password") + /// Client Secret for the merchant (the "password"). This property is required. /// <para>Corresponding environment variable name: VIPPS_CLIENT_SECRET</para> /// </summary> [VippsConfigurationKeyName(VippsConfigurationKeyNames.VIPPS_CLIENT_SECRET)] public string ClientSecret { get; set; } /// <summary> - /// Primary subscription key for the API product. The primary subscription key take precedence over the secondary subscription key. + /// Primary subscription key for the API product. + /// <para>The primary subscription key take precedence over the secondary subscription key.</para> + /// <para>Either primary subscription key or secondary subscription key is required.</para> /// <para>Corresponding environment variable name: VIPPS_SUBSCRIPTION_KEY_PRIMARY</para> /// </summary> [VippsConfigurationKeyName(VippsConfigurationKeyNames.VIPPS_SUBSCRIPTION_KEY_PRIMARY)] public string PrimarySubscriptionKey { get; set; } /// <summary> - /// Secondary subscription key for the API product. The primary subscription key take precedence over the secondary subscription key. + /// Secondary subscription key for the API product. + /// <para>The primary subscription key take precedence over the secondary subscription key.</para> + /// <para>Either primary subscription key or secondary subscription key is required.</para> /// <para>Corresponding environment variable name: VIPPS_SUBSCRIPTION_KEY_SECONDARY</para> /// </summary> [VippsConfigurationKeyName(VippsConfigurationKeyNames.VIPPS_SUBSCRIPTION_KEY_SECONDARY)] @@ -84,7 +88,7 @@ namespace IOL.VippsEcommerce.Models /// <para>Corresponding environment variable name: VIPPS_CACHE_PATH</para> /// </summary> [VippsConfigurationKeyName(VippsConfigurationKeyNames.VIPPS_CACHE_PATH)] - public string CredentialsCacheFilePath { get; set; } + public string CacheDirectoryPath { get; set; } /// <summary> /// Optional key for AES encryption of the credential cache file. @@ -114,11 +118,13 @@ namespace IOL.VippsEcommerce.Models foreach (var attribute in prop.CustomAttributes) { foreach (var argument in attribute.ConstructorArguments) { if (argument.Value as string == key) { - var value = prop.GetValue(this, null)?.ToString(); #if DEBUG + var value = prop.GetValue(this, null)?.ToString(); Console.WriteLine("Key: " + key + " Value: " + value); -#endif return value; +#else + return prop.GetValue(this, null)?.ToString(); +#endif } } } |
