public CheckoutStoreTests() { _checkoutStore = new CheckoutStore(new ApiSession { ApiUrl = ConfigurationManager.AppSettings["Klarna:ApiUrl"], UserAgent = "Klarna Episerver Integration Tests", Credentials = new ApiCredentials { Username = ConfigurationManager.AppSettings["Klarna:Username"], Password = ConfigurationManager.AppSettings["Klarna:Password"] } }, new JsonSerializer()); }
/// <summary> /// Creates an instance of the Klarna client. /// </summary> /// <param name="apiSession">Session representation object for communicating with the Klarna API</param> /// <param name="jsonSerializer">Instance of a class implementing the IJsonSerializer interface</param> public Klarna(ApiSession apiSession, IJsonSerializer jsonSerializer) { if (string.IsNullOrEmpty(apiSession.UserAgent)) { apiSession.UserAgent = GetDefaultUserAgent(); } Checkout = new CheckoutStore(apiSession, jsonSerializer); Payment = new PaymentStore(apiSession, jsonSerializer); OrderManagement = new OrderManagementStore(apiSession, jsonSerializer); Settlement = new SettlementStore(apiSession, jsonSerializer); CustomerToken = new CustomerTokenStore(apiSession, jsonSerializer); HostedPaymentPage = new HostedPaymentPageStore(apiSession, jsonSerializer); VirtualCardService = new VirtualCardServiceStore(apiSession, jsonSerializer); ApiSession = apiSession; }