From de97c81a7acbbde6c2dbfa19e31e252bb8c64337 Mon Sep 17 00:00:00 2001 From: Ivar Løvlie <38570165+ivarlovlie@users.noreply.github.com> Date: Wed, 31 Mar 2021 19:17:21 +0200 Subject: Update README.md --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index f74522c..617853a 100644 --- a/README.md +++ b/README.md @@ -1 +1,42 @@ # IOL.VippsEcommerce + + +## Install +`dotnet add package IOL.VippsEcommerce --version 1.0.0` + +The service targets net5.0. \ +[Nuget page](https://www.nuget.org/packages/IOL.VippsEcommerce/) +[Fuget page](https://www.fuget.org/packages/IOL.VippsEcommerce/) + +## Configuration + +Use DI to add and configure the service to your liking, example: +```csharp +services.AddVippsEcommerceService(o => { + o.ApiUrl = ""; + o.PrimarySubscriptionKey = ""; + o.ClientSecret = ""; + o.ClientId = ""; +}); +``` + +See [VippsConfiguration.cs](https://github.com/ivarlovlie/IOL.VippsEcommerce/blob/master/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs) for available properties. +You can also use environment variables to configure the service, example: +```csharp +services.AddVippsEcommerceService(o => { + o.UseEnvironment = true; +}); +``` + +With the above example, the service will look for configuration values in the current environment using names specified in [VippsConfigurationKeyNames.cs](https://github.com/ivarlovlie/IOL.VippsEcommerce/blob/master/src/IOL.VippsEcommerce/Models/VippsConfigurationKeyNames.cs). The environment variable name for a given property is also specified in it's XML-documentation. + + +## Caching + +The service can cache the credentials for api-access in a file with optional AES encryption, example: +```csharp +services.AddVippsEcommerceService(o => { + o.CacheEncryptionKey = "randomstring"; // optional + o.CredentialsCacheFilePath = "/tmp/vippsecom"; // path to directory that the executing process has write-access to +}); +``` -- cgit v1.3