diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2021-03-31 19:29:57 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2021-03-31 19:29:57 +0200 |
| commit | e9684072d0621266b7128cc6182bb80351c8386b (patch) | |
| tree | 24a3f20d1696f3e5e804bed24810904b3d25de8b /README.md | |
| parent | a537fc5ccd7c4e71b656deabf97669e99e3fac0d (diff) | |
| parent | de97c81a7acbbde6c2dbfa19e31e252bb8c64337 (diff) | |
| download | dotnet-vipps-ecommerce-e9684072d0621266b7128cc6182bb80351c8386b.tar.xz dotnet-vipps-ecommerce-e9684072d0621266b7128cc6182bb80351c8386b.zip | |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -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 +}); +``` |
