Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
432 changes: 432 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/CoreApiAppExmaple/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@

app.MapControllers();

app.Run();
app.Run();
2 changes: 1 addition & 1 deletion examples/CoreApiAppExmaple/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion examples/CoreApiAppExmaple/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"Microsoft.AspNetCore": "Warning"
}
}
}
}
2 changes: 1 addition & 1 deletion examples/CoreApiAppExmaple/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
"ApiKey": "{apikey}",
"ClientSecret": "{clientSecret}"
}
}
}
7 changes: 2 additions & 5 deletions examples/CoreConsoleAppExample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// See https://aka.ms/new-console-template for more information



using TBC.OpenAPI.SDK.Core;
using TBC.OpenAPI.SDK.OnlineInstallments;
using TBC.OpenAPI.SDK.OnlineInstallments.Extensions;
Expand All @@ -16,15 +14,14 @@
})
.Build();


var client = factory.GetOnlineInstallmentsClient();

var result = client.GetApplicationStatus(new GetApplicationStatusRequest
var result = client.GetApplicationStatus(new GetApplicationStatusRequest
{
MerchantKey = "aeb32470-4999-4f05-b271-b393325c8d8f",
SessionId = "3293a41f-1ad0-4542-968a-a8480495b2d6"
}).GetAwaiter().GetResult();

Console.WriteLine($"Result: {result.StatusId}");

Console.ReadLine();
Console.ReadLine();
5 changes: 2 additions & 3 deletions examples/NetFrameworkExample/App_Start/BundleConfig.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Web;
using System.Web.Optimization;
using System.Web.Optimization;

namespace NetFrameworkExample
{
Expand All @@ -24,4 +23,4 @@ public static void RegisterBundles(BundleCollection bundles)
"~/Content/site.css"));
}
}
}
}
5 changes: 2 additions & 3 deletions examples/NetFrameworkExample/App_Start/FilterConfig.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc;

namespace NetFrameworkExample
{
Expand All @@ -10,4 +9,4 @@ public static void RegisterGlobalFilters(GlobalFilterCollection filters)
filters.Add(new HandleErrorAttribute());
}
}
}
}
8 changes: 2 additions & 6 deletions examples/NetFrameworkExample/App_Start/RouteConfig.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc;
using System.Web.Routing;

namespace NetFrameworkExample
Expand All @@ -20,4 +16,4 @@ public static void RegisterRoutes(RouteCollection routes)
);
}
}
}
}
7 changes: 2 additions & 5 deletions examples/NetFrameworkExample/App_Start/WebApiConfig.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using System.Web.Http;

namespace NetFrameworkExample
{
Expand All @@ -21,4 +18,4 @@ public static void Register(HttpConfiguration config)
);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Mvc;
using TBC.OpenAPI.SDK.OnlineInstallments.Models.Requests;
using TBC.OpenAPI.SDK.Core;
using TBC.OpenAPI.SDK.OnlineInstallments.Extensions;
using TBC.OpenAPI.SDK.OnlineInstallments.Models.Requests;

namespace NetFrameworkExample.Controllers
{
public class ApplicationsController : ApiController
{

public async Task<IHttpActionResult> Get()
{
var onlineInstallmentsClient = OpenApiClientFactory.Instance.GetOnlineInstallmentsClient();
Expand All @@ -27,4 +21,4 @@ public async Task<IHttpActionResult> Get()
return Ok(result);
}
}
}
}
9 changes: 2 additions & 7 deletions examples/NetFrameworkExample/Global.asax.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using TBC.OpenAPI.SDK.Core;
using TBC.OpenAPI.SDK.OnlineInstallments;
Expand All @@ -32,4 +27,4 @@ protected void Application_Start()
.Build();
}
}
}
}
9 changes: 6 additions & 3 deletions examples/NetFrameworkExample/NetFrameworkExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Extensions.DependencyInjection.6.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -111,8 +114,8 @@
<Private>True</Private>
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="TBC.OpenAPI.SDK.Core, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\TBC.OpenAPI.SDK.Core.1.0.0\lib\netstandard2.0\TBC.OpenAPI.SDK.Core.dll</HintPath>
<Reference Include="TBC.OpenAPI.SDK.Core, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\TBC.OpenAPI.SDK.Core.1.3.0-pre3\lib\netstandard2.0\TBC.OpenAPI.SDK.Core.dll</HintPath>
</Reference>
<Reference Include="WebGrease">
<Private>True</Private>
Expand Down Expand Up @@ -157,7 +160,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\TBC.OpenAPI.SDK.OnlineInstallments\TBC.OpenAPI.SDK.OnlineInstallments.csproj">
<Project>{a10b4f21-4f48-4050-ad60-125aacdbfa08}</Project>
<Project>{A10B4F21-4F48-4050-AD60-125AACDBFA08}</Project>
<Name>TBC.OpenAPI.SDK.OnlineInstallments</Name>
</ProjectReference>
</ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions examples/NetFrameworkExample/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand Down Expand Up @@ -32,4 +31,4 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
6 changes: 3 additions & 3 deletions examples/NetFrameworkExample/Web.Debug.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</connectionStrings>
-->
<system.web>
Expand All @@ -23,8 +23,8 @@

<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
<error statusCode="500" redirect="InternalError.htm" />
</customErrors>
-->
</system.web>
</configuration>
</configuration>
6 changes: 3 additions & 3 deletions examples/NetFrameworkExample/Web.Release.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</connectionStrings>
-->
<system.web>
Expand All @@ -24,8 +24,8 @@

<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
<error statusCode="500" redirect="InternalError.htm" />
</customErrors>
-->
</system.web>
</configuration>
</configuration>
5 changes: 2 additions & 3 deletions examples/NetFrameworkExample/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<add key="OnlineInstallmentsUrl" value="https://test-api.tbcbank.ge/v1/online-installments/" />
<add key="OnlineInstallmentsKey" value="{apikey}" />
<add key="OnlineInstallmentsClientSecret" value="{clientSecret}" />

</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.7.2" />
Expand All @@ -33,15 +32,15 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
Expand Down
3 changes: 2 additions & 1 deletion examples/NetFrameworkExample/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net472" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" targetFramework="net472" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net472" />
<package id="Microsoft.Extensions.DependencyInjection" version="6.0.0" targetFramework="net472" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="6.0.0" targetFramework="net472" />
<package id="Microsoft.Extensions.Http" version="6.0.0" targetFramework="net472" />
<package id="Microsoft.Extensions.Logging" version="6.0.0" targetFramework="net472" />
Expand All @@ -28,5 +29,5 @@
<package id="System.Text.Json" version="6.0.3" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
<package id="TBC.OpenAPI.SDK.Core" version="1.0.0" targetFramework="net472" />
<package id="TBC.OpenAPI.SDK.Core" version="1.3.0-pre3" targetFramework="net472" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ public static OpenApiClientFactoryBuilder AddOnlineInstallmentsClient(this OpenA

public static OpenApiClientFactoryBuilder AddOnlineInstallmentsClient(this OpenApiClientFactoryBuilder builder,
OnlineInstallmentsClientOptions options,
Action<HttpClient> configureClient = null,
Action<HttpClient> configureClient,
Func<HttpClientHandler> configureHttpMessageHandler = null)
{
return builder.AddClient<IOnlineInstallmentsClient, OnlineInstallmentsClient, OnlineInstallmentsClientOptions>(options, configureClient, configureHttpMessageHandler);
return builder?.AddClient<IOnlineInstallmentsClient, OnlineInstallmentsClient, OnlineInstallmentsClientOptions>(options, configureClient, configureHttpMessageHandler);
}

public static IOnlineInstallmentsClient GetOnlineInstallmentsClient(this OpenApiClientFactory factory) =>
factory.GetOpenApiClient<IOnlineInstallmentsClient>();

factory?.GetOpenApiClient<IOnlineInstallmentsClient>();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace TBC.OpenAPI.SDK.OnlineInstallments.Extensions
{
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddOnlineInstallmentsClient(this IServiceCollection services, OnlineInstallmentsClientOptions options)
public static IServiceCollection AddOnlineInstallmentsClient(this IServiceCollection services, OnlineInstallmentsClientOptions options)
=> AddOnlineInstallmentsClient(services, options, null, null);

public static IServiceCollection AddOnlineInstallmentsClient(this IServiceCollection services, OnlineInstallmentsClientOptions options,
Expand All @@ -20,4 +20,4 @@ public static IServiceCollection AddOnlineInstallmentsClient(this IServiceCollec
return services;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@


using TBC.OpenAPI.SDK.Core;
using TBC.OpenAPI.SDK.OnlineInstallments.Models;
using TBC.OpenAPI.SDK.Core;
using TBC.OpenAPI.SDK.OnlineInstallments.Models.Requests;
using TBC.OpenAPI.SDK.OnlineInstallments.Models.Responses;

Expand All @@ -10,10 +7,15 @@ namespace TBC.OpenAPI.SDK.OnlineInstallments.Interfaces
public interface IOnlineInstallmentsClient : IOpenApiClient
{
Task<InitiateInstallmentResponce> InitiateOnlineInstallment(InitiateInstallmentRequest model, CancellationToken cancellationToken = default);

Task<ConfirmApplicationResponse> ConfirmApplication(ConfirmApplicationRequest model, CancellationToken cancellationToken = default);

Task<CancelApplicationResponse> CancelApplication(CancelApplicationRequest model, CancellationToken cancellationToken = default);

Task<GetApplicationStatusResponse> GetApplicationStatus(GetApplicationStatusRequest model, CancellationToken cancellationToken = default);

Task<MerchantApplicationStatusesResponse> GetMerchantApplicationStatuses(MerchantApplicationStatusRequest model, CancellationToken cancellationToken = default);

Task MerchantApplicationStatusSync(MerchantApplicationStatusSyncRequest model, CancellationToken cancellationToken = default);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TBC.OpenAPI.SDK.OnlineInstallments.Models.Requests
namespace TBC.OpenAPI.SDK.OnlineInstallments.Models.Requests
{
public class CancelApplicationRequest : RequestBaseMerchantKey
{
public string SessionId { get; set; }
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TBC.OpenAPI.SDK.OnlineInstallments.Models.Requests
namespace TBC.OpenAPI.SDK.OnlineInstallments.Models.Requests
{
public class ConfirmApplicationRequest: RequestBaseMerchantKey
public class ConfirmApplicationRequest : RequestBaseMerchantKey
{
public string SessionId { get; set; }
}
}
}
Loading