private static async Task TestTransactionProcessing() { using var provider = CreateServiceProvider(); using var scope = provider.CreateScope(); BankOfGeorgiaIpayClient client = scope.ServiceProvider .GetRequiredService <BankOfGeorgiaIpayClient>(); var automaticCaptureOrderResult = await client.MakeOrderAsync(new IpayOrder() { CaptureMethod = CaptureMethod.Automatic, Intent = Intent.Authorize, Items = new[] { new IpayOrderItem(amount: 1.7m, description: "First product", quantity: 1, productId: "P001"), new IpayOrderItem(amount: 2.5m, description: "Second product", quantity: 3, productId: "P002") }, RedirectUrl = "https://mystore.ge/api/ipayreturn", ShopOrderId = Guid.NewGuid().ToString("N"), ShowShopOrderIdOnExtract = true, PurchaseUnits = new[] { new OrderRequestPurchaseUnit(currency: Currency.GEL, value: 1.7m), new OrderRequestPurchaseUnit(currency: Currency.GEL, value: 2.5m) } }); var automaticCaptureOrderResultRedirectUrl = automaticCaptureOrderResult.GetRedirectUrl(); }
private static async Task TestInjectionScopeAuthToken() { using var serviceProvider = CreateServiceProvider(); using var scope1 = serviceProvider.CreateScope(); BankOfGeorgiaIpayClient client1 = scope1.ServiceProvider .GetRequiredService <BankOfGeorgiaIpayClient>(); using var scope2 = serviceProvider.CreateScope(); BankOfGeorgiaIpayClient client2 = scope2.ServiceProvider .GetRequiredService <BankOfGeorgiaIpayClient>(); await client1.AuthenticateAsync(); Thread.Sleep(2000); await client2.AuthenticateAsync(); if (client1.AccessToken == client2.AccessToken) { throw new Exception("Clients share access token"); } }
public IpayCallbackController( BankOfGeorgiaIpayClient IpayClient ) { _iPayClient = IpayClient; }
public HomeController( BankOfGeorgiaIpayClient IpayClient ) { _iPayClient = IpayClient; }