protected TestBase() { var appRoot = AppContext.BaseDirectory.Substring(0, AppContext.BaseDirectory.IndexOf("bin", StringComparison.Ordinal)); Configuration = TestHelper.GetApplicationConfiguration(appRoot); var services = new ServiceCollection(); serviceProvider = services.BuildServiceProvider(); var handler = new HttpClientHandler { AllowAutoRedirect = false }; var checkoutApihttpClient = new HttpClient(handler) { BaseAddress = Configuration.SveaApiUrls.CheckoutApiUri }; var paymentAdminApiHttpClient = new HttpClient(handler) { BaseAddress = Configuration.SveaApiUrls.PaymentAdminApiUri }; this.Sut = new SveaWebPayClient(checkoutApihttpClient, paymentAdminApiHttpClient, new Credentials(Configuration.Credentials.MerchantId, Configuration.Credentials.Secret)); }
public void OneTimeSetUp() { var config = new ConfigurationBuilder() .AddJsonFile("appsettings.json") .AddUserSecrets("6343ea20-120b-4075-a141-c8154cad1d14") .AddEnvironmentVariables() .Build(); var handler = new HttpClientHandler { AllowAutoRedirect = false }; var checkoutApihttpClient = new HttpClient(handler) { BaseAddress = new Uri(config.GetSection("SveaApiUrls").GetSection("CheckoutApiUri").Value) }; var paymentAdminApiHttpClient = new HttpClient(handler) { BaseAddress = new Uri(config.GetSection("SveaApiUrls").GetSection("PaymentAdminApiUri").Value) }; _sveaClient = new SveaWebPayClient( checkoutApihttpClient, paymentAdminApiHttpClient, new Credentials( config.GetSection("Credentials").GetSection("MerchantId").Value, config.GetSection("Credentials").GetSection("Secret").Value ) ); }
public CheckOutController( IOptionsSnapshot <Models.MerchantSettings> merchantsAccessor, Cart cartService, SveaWebPayClient sveaClient) { _merchantSettings = merchantsAccessor.Value; _cartService = cartService; _sveaClient = sveaClient; }
public SveaController(Cart cartService, StoreDbContext context, SveaWebPayClient sveaClient) { _cartService = cartService; _context = context; _sveaClient = sveaClient; }
public OrdersController(StoreDbContext context, SveaWebPayClient sveaClient) { this.context = context; this._sveaClient = sveaClient; }
public PaymentController(SveaWebPayClient sveaClient) { this._sveaClient = sveaClient; }