Skip to content

Commit e50d258

Browse files
authored
Merge pull request #7 from jaaufauvre/master
Generic and improved config.json, updated README, bumped dependencies
2 parents 36c6073 + 9ffde43 commit e50d258

89 files changed

Lines changed: 1172 additions & 2175 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# mastercard-api-client-tutorial
22

3-
[Generating and Configuring a Mastercard API Client](https://developer.mastercard.com/platform/documentation/generating-and-configuring-a-mastercard-api-client/) explains how to generate and configure a simple API client for one of the APIs offered on the [Mastercard Developer portal](https://developer.mastercard.com/apis).
3+
[Generating and Configuring a Mastercard API Client](https://developer.mastercard.com/platform/documentation/security-and-authentication/generating-and-configuring-a-mastercard-api-client/) explains how to generate and configure a simple API client for one of the APIs offered on the [Mastercard Developer portal](https://developer.mastercard.com/apis).
44

55
Languages used in this tutorial: Java, Python, NodeJS, Ruby, PHP and C#.

csharp/.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0
1+
4.3.1

csharp/Mastercard.Developer.DigitalEnablement.Tests/Mastercard.Developer.DigitalEnablement.Tests.csproj renamed to csharp/Acme.App.MastercardApi.Client.Tests/Acme.App.MastercardApi.Client.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
31-
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
32-
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
30+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
31+
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
32+
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<ProjectReference Include="..\Mastercard.Developer.DigitalEnablement.Client\Mastercard.Developer.DigitalEnablement.Client.csproj" />
36+
<ProjectReference Include="..\Acme.App.MastercardApi.Client\Acme.App.MastercardApi.Client.csproj" />
3737
</ItemGroup>
3838
</Project>

csharp/Mastercard.Developer.DigitalEnablement.Tests/TokenizeApiTest.cs renamed to csharp/Acme.App.MastercardApi.Client.Tests/TokenizeApiTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
using Mastercard.Developer.OAuth1Signer.Core.Utils;
66
using Mastercard.Developer.OAuth1Signer.RestSharp.Authenticators;
77
using Microsoft.VisualStudio.TestTools.UnitTesting;
8-
using Mastercard.Developer.DigitalEnablement.Client.Api;
9-
using Mastercard.Developer.DigitalEnablement.Client.Client;
10-
using Mastercard.Developer.DigitalEnablement.Client.Model;
8+
using Acme.App.MastercardApi.Client.Api;
9+
using Acme.App.MastercardApi.Client.Client;
10+
using Acme.App.MastercardApi.Client.Model;
1111
using System.Security.Cryptography.X509Certificates;
1212
using static Mastercard.Developer.ClientEncryption.Core.Encryption.FieldLevelEncryptionConfig;
1313

csharp/Mastercard.Developer.DigitalEnablement.Tests/_Resources/digital-enablement-sandbox-decryption-key.key renamed to csharp/Acme.App.MastercardApi.Client.Tests/_Resources/digital-enablement-sandbox-decryption-key.key

File renamed without changes.

csharp/Mastercard.Developer.DigitalEnablement.Tests/_Resources/digital-enablement-sandbox-encryption-key.crt renamed to csharp/Acme.App.MastercardApi.Client.Tests/_Resources/digital-enablement-sandbox-encryption-key.crt

File renamed without changes.

csharp/Mastercard.Developer.DigitalEnablement.Tests/_Resources/fake-signing-key.p12 renamed to csharp/Acme.App.MastercardApi.Client.Tests/_Resources/fake-signing-key.p12

File renamed without changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard1.3</TargetFramework>
5+
<AssemblyName>Acme.App.MastercardApi.Client</AssemblyName>
6+
<PackageId>Acme.App.MastercardApi.Client</PackageId>
7+
<OutputType>Library</OutputType>
8+
<Authors>OpenAPI</Authors>
9+
<Company>OpenAPI</Company>
10+
<AssemblyTitle>OpenAPI Library</AssemblyTitle>
11+
<Description>A library generated from a OpenAPI doc</Description>
12+
<Copyright>No Copyright</Copyright>
13+
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
14+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15+
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
16+
<RootNamespace>Acme.App.MastercardApi.Client</RootNamespace>
17+
<Version>1.0.0</Version>
18+
</PropertyGroup>
19+
20+
<ItemGroup>
21+
<PackageReference Include="FubarCoder.RestSharp.Portable.Core" Version="4.0.7" />
22+
<PackageReference Include="FubarCoder.RestSharp.Portable.HttpClient" Version="4.0.7" />
23+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
24+
<PackageReference Include="JsonSubTypes" Version="1.6.0" />
25+
<PackageReference Include="Mastercard.Developer.OAuth1Signer.RestSharp" Version="1.2.5" />
26+
<PackageReference Include="Mastercard.Developer.ClientEncryption.RestSharp" Version="1.0.2" />
27+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
28+
</ItemGroup>
29+
30+
31+
</Project>

csharp/Mastercard.Developer.DigitalEnablement.Client/Api/DeleteApi.cs renamed to csharp/Acme.App.MastercardApi.Client/Api/DeleteApi.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* The MDES APIs are designed as RPC style stateless web services where each API endpoint represents an operation to be performed. All request and response payloads are sent in the JSON (JavaScript Object Notation) data-interchange format. Each endpoint in the API specifies the HTTP Method used to access it. All strings in request and response objects are to be UTF-8 encoded. Each API URI includes the major and minor version of API that it conforms to. This will allow multiple concurrent versions of the API to be deployed simultaneously. <br> __Authentication__ Mastercard uses OAuth 1.0a with body hash extension for authenticating the API clients. This requires every request that you send to Mastercard to be signed with an RSA private key. A private-public RSA key pair must be generated consisting of: <br> 1 . A private key for the OAuth signature for API requests. It is recommended to keep the private key in a password-protected or hardware keystore. <br> 2. A public key is shared with Mastercard during the project setup process through either a certificate signing request (CSR) or the API Key Generator. Mastercard will use the public key to verify the OAuth signature that is provided on every API call.<br> An OAUTH1.0a signer library is available on [GitHub](https://github.com/Mastercard/oauth1-signer-java) <br> __Encryption__<br> All communications between Issuer web service and the Mastercard gateway is encrypted using TLS. <br> __Additional Encryption of Sensitive Data__ In addition to the OAuth authentication, when using MDES Digital Enablement Service, any PCI sensitive and all account holder Personally Identifiable Information (PII) data must be encrypted. This requirement applies to the API fields containing encryptedData. Sensitive data is encrypted using a symmetric session (one-time-use) key. The symmetric session key is then wrapped with an RSA Public Key supplied by Mastercard during API setup phase (the Customer Encryption Key). <br> Java Client Encryption Library available on [GitHub](https://github.com/Mastercard/client-encryption-java)
55
*
6-
* The version of the OpenAPI document: 1.2.9
6+
* The version of the OpenAPI document: 1.2.10
77
*
88
* Generated by: https://github.com/openapitools/openapi-generator.git
99
*/
@@ -13,10 +13,10 @@
1313
using System.Collections.ObjectModel;
1414
using System.Linq;
1515
using RestSharp.Portable;
16-
using Mastercard.Developer.DigitalEnablement.Client.Client;
17-
using Mastercard.Developer.DigitalEnablement.Client.Model;
16+
using Acme.App.MastercardApi.Client.Client;
17+
using Acme.App.MastercardApi.Client.Model;
1818

19-
namespace Mastercard.Developer.DigitalEnablement.Client.Api
19+
namespace Acme.App.MastercardApi.Client.Api
2020
{
2121
/// <summary>
2222
/// Represents a collection of functions to interact with the API endpoints
@@ -30,7 +30,7 @@ public interface IDeleteApi : IApiAccessor
3030
/// <remarks>
3131
/// This API is used to delete one or more Tokens. The API is limited to 10 Tokens per request. MDES will coordinate the deactivation of the Tokens and notify any relevant parties that the Tokens have now been deactivated.
3232
/// </remarks>
33-
/// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
33+
/// <exception cref="Acme.App.MastercardApi.Client.Client.ApiException">Thrown when fails to make API call</exception>
3434
/// <param name="deleteRequestSchema">Contains the details of the request message. (optional)</param>
3535
/// <returns>DeleteResponseSchema</returns>
3636
DeleteResponseSchema DeleteDigitization (DeleteRequestSchema deleteRequestSchema = default(DeleteRequestSchema));
@@ -41,7 +41,7 @@ public interface IDeleteApi : IApiAccessor
4141
/// <remarks>
4242
/// This API is used to delete one or more Tokens. The API is limited to 10 Tokens per request. MDES will coordinate the deactivation of the Tokens and notify any relevant parties that the Tokens have now been deactivated.
4343
/// </remarks>
44-
/// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
44+
/// <exception cref="Acme.App.MastercardApi.Client.Client.ApiException">Thrown when fails to make API call</exception>
4545
/// <param name="deleteRequestSchema">Contains the details of the request message. (optional)</param>
4646
/// <returns>ApiResponse of DeleteResponseSchema</returns>
4747
ApiResponse<DeleteResponseSchema> DeleteDigitizationWithHttpInfo (DeleteRequestSchema deleteRequestSchema = default(DeleteRequestSchema));
@@ -53,7 +53,7 @@ public interface IDeleteApi : IApiAccessor
5353
/// <remarks>
5454
/// This API is used to delete one or more Tokens. The API is limited to 10 Tokens per request. MDES will coordinate the deactivation of the Tokens and notify any relevant parties that the Tokens have now been deactivated.
5555
/// </remarks>
56-
/// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
56+
/// <exception cref="Acme.App.MastercardApi.Client.Client.ApiException">Thrown when fails to make API call</exception>
5757
/// <param name="deleteRequestSchema">Contains the details of the request message. (optional)</param>
5858
/// <returns>Task of DeleteResponseSchema</returns>
5959
System.Threading.Tasks.Task<DeleteResponseSchema> DeleteDigitizationAsync (DeleteRequestSchema deleteRequestSchema = default(DeleteRequestSchema));
@@ -64,7 +64,7 @@ public interface IDeleteApi : IApiAccessor
6464
/// <remarks>
6565
/// This API is used to delete one or more Tokens. The API is limited to 10 Tokens per request. MDES will coordinate the deactivation of the Tokens and notify any relevant parties that the Tokens have now been deactivated.
6666
/// </remarks>
67-
/// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
67+
/// <exception cref="Acme.App.MastercardApi.Client.Client.ApiException">Thrown when fails to make API call</exception>
6868
/// <param name="deleteRequestSchema">Contains the details of the request message. (optional)</param>
6969
/// <returns>Task of ApiResponse (DeleteResponseSchema)</returns>
7070
System.Threading.Tasks.Task<ApiResponse<DeleteResponseSchema>> DeleteDigitizationAsyncWithHttpInfo (DeleteRequestSchema deleteRequestSchema = default(DeleteRequestSchema));
@@ -76,17 +76,17 @@ public interface IDeleteApi : IApiAccessor
7676
/// </summary>
7777
public partial class DeleteApi : IDeleteApi
7878
{
79-
private Mastercard.Developer.DigitalEnablement.Client.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
79+
private Acme.App.MastercardApi.Client.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
8080

8181
/// <summary>
8282
/// Initializes a new instance of the <see cref="DeleteApi"/> class.
8383
/// </summary>
8484
/// <returns></returns>
8585
public DeleteApi(String basePath)
8686
{
87-
this.Configuration = new Mastercard.Developer.DigitalEnablement.Client.Client.Configuration { BasePath = basePath };
87+
this.Configuration = new Acme.App.MastercardApi.Client.Client.Configuration { BasePath = basePath };
8888

89-
ExceptionFactory = Mastercard.Developer.DigitalEnablement.Client.Client.Configuration.DefaultExceptionFactory;
89+
ExceptionFactory = Acme.App.MastercardApi.Client.Client.Configuration.DefaultExceptionFactory;
9090
}
9191

9292
/// <summary>
@@ -95,9 +95,9 @@ public DeleteApi(String basePath)
9595
/// <returns></returns>
9696
public DeleteApi()
9797
{
98-
this.Configuration = Mastercard.Developer.DigitalEnablement.Client.Client.Configuration.Default;
98+
this.Configuration = Acme.App.MastercardApi.Client.Client.Configuration.Default;
9999

100-
ExceptionFactory = Mastercard.Developer.DigitalEnablement.Client.Client.Configuration.DefaultExceptionFactory;
100+
ExceptionFactory = Acme.App.MastercardApi.Client.Client.Configuration.DefaultExceptionFactory;
101101
}
102102

103103
/// <summary>
@@ -106,14 +106,14 @@ public DeleteApi()
106106
/// </summary>
107107
/// <param name="configuration">An instance of Configuration</param>
108108
/// <returns></returns>
109-
public DeleteApi(Mastercard.Developer.DigitalEnablement.Client.Client.Configuration configuration = null)
109+
public DeleteApi(Acme.App.MastercardApi.Client.Client.Configuration configuration = null)
110110
{
111111
if (configuration == null) // use the default one in Configuration
112-
this.Configuration = Mastercard.Developer.DigitalEnablement.Client.Client.Configuration.Default;
112+
this.Configuration = Acme.App.MastercardApi.Client.Client.Configuration.Default;
113113
else
114114
this.Configuration = configuration;
115115

116-
ExceptionFactory = Mastercard.Developer.DigitalEnablement.Client.Client.Configuration.DefaultExceptionFactory;
116+
ExceptionFactory = Acme.App.MastercardApi.Client.Client.Configuration.DefaultExceptionFactory;
117117
}
118118

119119
/// <summary>
@@ -139,12 +139,12 @@ public void SetBasePath(String basePath)
139139
/// Gets or sets the configuration object
140140
/// </summary>
141141
/// <value>An instance of the Configuration</value>
142-
public Mastercard.Developer.DigitalEnablement.Client.Client.Configuration Configuration {get; set;}
142+
public Acme.App.MastercardApi.Client.Client.Configuration Configuration {get; set;}
143143

144144
/// <summary>
145145
/// Provides a factory method hook for the creation of exceptions.
146146
/// </summary>
147-
public Mastercard.Developer.DigitalEnablement.Client.Client.ExceptionFactory ExceptionFactory
147+
public Acme.App.MastercardApi.Client.Client.ExceptionFactory ExceptionFactory
148148
{
149149
get
150150
{
@@ -182,7 +182,7 @@ public void AddDefaultHeader(string key, string value)
182182
/// <summary>
183183
/// Used to delete one or more Tokens. The API is limited to 10 Tokens per request. This API is used to delete one or more Tokens. The API is limited to 10 Tokens per request. MDES will coordinate the deactivation of the Tokens and notify any relevant parties that the Tokens have now been deactivated.
184184
/// </summary>
185-
/// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
185+
/// <exception cref="Acme.App.MastercardApi.Client.Client.ApiException">Thrown when fails to make API call</exception>
186186
/// <param name="deleteRequestSchema">Contains the details of the request message. (optional)</param>
187187
/// <returns>DeleteResponseSchema</returns>
188188
public DeleteResponseSchema DeleteDigitization (DeleteRequestSchema deleteRequestSchema = default(DeleteRequestSchema))
@@ -194,7 +194,7 @@ public void AddDefaultHeader(string key, string value)
194194
/// <summary>
195195
/// Used to delete one or more Tokens. The API is limited to 10 Tokens per request. This API is used to delete one or more Tokens. The API is limited to 10 Tokens per request. MDES will coordinate the deactivation of the Tokens and notify any relevant parties that the Tokens have now been deactivated.
196196
/// </summary>
197-
/// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
197+
/// <exception cref="Acme.App.MastercardApi.Client.Client.ApiException">Thrown when fails to make API call</exception>
198198
/// <param name="deleteRequestSchema">Contains the details of the request message. (optional)</param>
199199
/// <returns>ApiResponse of DeleteResponseSchema</returns>
200200
public ApiResponse<DeleteResponseSchema> DeleteDigitizationWithHttpInfo (DeleteRequestSchema deleteRequestSchema = default(DeleteRequestSchema))
@@ -253,7 +253,7 @@ public void AddDefaultHeader(string key, string value)
253253
/// <summary>
254254
/// Used to delete one or more Tokens. The API is limited to 10 Tokens per request. This API is used to delete one or more Tokens. The API is limited to 10 Tokens per request. MDES will coordinate the deactivation of the Tokens and notify any relevant parties that the Tokens have now been deactivated.
255255
/// </summary>
256-
/// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
256+
/// <exception cref="Acme.App.MastercardApi.Client.Client.ApiException">Thrown when fails to make API call</exception>
257257
/// <param name="deleteRequestSchema">Contains the details of the request message. (optional)</param>
258258
/// <returns>Task of DeleteResponseSchema</returns>
259259
public async System.Threading.Tasks.Task<DeleteResponseSchema> DeleteDigitizationAsync (DeleteRequestSchema deleteRequestSchema = default(DeleteRequestSchema))
@@ -266,7 +266,7 @@ public void AddDefaultHeader(string key, string value)
266266
/// <summary>
267267
/// Used to delete one or more Tokens. The API is limited to 10 Tokens per request. This API is used to delete one or more Tokens. The API is limited to 10 Tokens per request. MDES will coordinate the deactivation of the Tokens and notify any relevant parties that the Tokens have now been deactivated.
268268
/// </summary>
269-
/// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
269+
/// <exception cref="Acme.App.MastercardApi.Client.Client.ApiException">Thrown when fails to make API call</exception>
270270
/// <param name="deleteRequestSchema">Contains the details of the request message. (optional)</param>
271271
/// <returns>Task of ApiResponse (DeleteResponseSchema)</returns>
272272
public async System.Threading.Tasks.Task<ApiResponse<DeleteResponseSchema>> DeleteDigitizationAsyncWithHttpInfo (DeleteRequestSchema deleteRequestSchema = default(DeleteRequestSchema))

0 commit comments

Comments
 (0)