summaryrefslogtreecommitdiffstats
path: root/src/IOL.VippsEcommerce.Client/Program.cs
blob: 2f83dc18c2419b774c5d46662def6dc4ea049676 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System;
using System.Text.Json;
using IOL.VippsEcommerce;
using IOL.VippsEcommerce.Models;
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;
});
var provider = services.BuildServiceProvider();
var vippsEcommerceService = provider.GetService<IVippsEcommerceService>();
var res = vippsEcommerceService?.GetPaymentDetailsAsync("asdf").Result;
Console.WriteLine(JsonSerializer.Serialize(res));