The purpose of this coding dojo is to have a work framework and a discussion about what is a good SDK?
13:00 - Introduction
13:10 - Start thinking and developping your ideal in SDK
14:30 - End hack time and start discussion
15:00 - End of the Coding Dojo
Ingenico Direct is the next generation solution that will allow our merchants to have an API with the latest WEB standards. But also a simplification of resources by following the HTTP Rest standards.
We have started to develop our API based on the SDK of the Ingenico Connect solution provided by our northern neighbours.
This integration aims to minimize the integration of merchants using the Connect SDK and who are integrated with Ingenico Belgium
For the SDK, we have several challenges to kick.
- The SDK should fit with all programming language styles;
- Multiple environment can be reach;
- Defines which complexity the SDK should onboard;
- How to work with several version of SDK;
The Ingenico documentation is based on yaml. We use the framework ReDoc to render a Ingenico theme documentation page.
The documentation (date of 14th November 2019) is embedded to this GitHub repository
I hosted on Microsoft Azure a Fake API to mock Ingenico Direct.
This GitHub has an Continuous integration and deployment using Azure DevOps. The Continuous Integration is based on the azure-pipelines.yml file. And the deployment allow to deploy on three differents environments called INT, TEST & PROD.
The current status of the build:
The mock doesn't support HMAC security
Environment | Entry point url | Swagger url | Deployment Badge |
---|---|---|---|
INT | https://int-direct.azurewebsites.net | https://int-direct.azurewebsites.net/swagger/index.html | |
TEST | https://test-direct.azurewebsites.net | https://test-direct.azurewebsites.net/swagger/index.html | |
PROD | https://prod-direct.azurewebsites.net | https://prod-direct.azurewebsites.net/swagger/index.html |
// HttpClient is intended to be instantiated once per application, rather than per-use. See Remarks.
static readonly HttpClient client = new HttpClient();
static async Task Main()
{
// Call asynchronous network methods in a try/catch block to handle exceptions.
try
{
HttpResponseMessage response = await client.GetAsync("http://www.contoso.com/");
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
// Above three lines can be replaced with new helper method below
// string responseBody = await client.GetStringAsync(uri);
Console.WriteLine(responseBody);
}
catch(HttpRequestException e)
{
Console.WriteLine("\nException Caught!");
Console.WriteLine("Message :{0} ",e.Message);
}
}
new HttpClient(
new HttpClientHandler()
{
Proxy = new WebProxy("http://127.0.0.1:3128")
});
source: https://docs.microsoft.com/fr-fr/dotnet/api/system.net.http.httpclient?view=netstandard-2.0
Go futher:
Make HTTP requests using IHttpClientFactory in ASP.NET Core
- Adrien Clerbois - AClerbois