aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 14c1f4abe263f1731707fdb96bf47abf090fcd37 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Implements https://vippsas.github.io/vipps-ecom-api, more or less (see [IVippsEcommerceService.cs](https://git.ivarlovlie.no/dotnet-vipps-ecommerece/tree/src/IOL.VippsEcommerce/IVippsEcommerceService.cs)).

Install: `dotnet add package IOL.VippsEcommerce`
Nuget: https://www.nuget.org/packages/IOL.VippsEcommerce

## Configuration

Use Dependency Injection to add and configure the service with your values, minimal setup example:
```csharp
services.AddVippsEcommerceService(o => {
	o.ApiUrl = "";
	o.PrimarySubscriptionKey = "";
	o.ClientSecret = "";
	o.ClientId = "";
});
```

See [VippsConfiguration.cs](https://git.ivarlovlie.no/dotnet-vipps-ecommerece/tree/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs) for available properties.

## 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 key for AES encryption, if omitted the cache will be readable json with your keys exposed and everything.
	o.CacheDirectoryPath = "/tmp/vippsecom"; // path to a directory that the executing process has write-access to.
});
```