Skip to content

AClerbois/ingenico-sdk-coding-dojo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Ingenico Coding Dojo - What is a good SDK?

The purpose of this coding dojo is to have a work framework and a discussion about what is a good SDK?

Planning

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 

Context

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

Challenges

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;

Resources

Official Ingenico Direct Documentation

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

SDK Ingenico Server Connect

Fake Ingenico Direct APIs

I hosted on Microsoft Azure a Fake API to mock Ingenico Direct.

Build and deployments

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: Build Status

Mock endpoint

The mock doesn't support HMAC security

Environments :

Environment Entry point url Swagger url Deployment Badge
INT https://int-direct.azurewebsites.net https://int-direct.azurewebsites.net/swagger/index.html Badge INT
TEST https://test-direct.azurewebsites.net https://test-direct.azurewebsites.net/swagger/index.html Badge TEST
PROD https://prod-direct.azurewebsites.net https://prod-direct.azurewebsites.net/swagger/index.html Badge PROD

Technical refreshment

.NET

How to use call an API using HttpClient

// 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);
    }
}

Ingenico Proxy

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

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages