Mastercard Api Certificate Integration In C#

Özlem Erden
VakıfBank Teknoloji
3 min readJun 8, 2022

In the 3D Secure 1.0 application, a robotic process is carried out for the registration of the newly opened workplace in order for cards with the Mastercard logo to be approved.

The Certificate in the EMV 3D application should be integrated through the document published on the member merchant registration application via API. Also, member merchant registrations are made with this method during the transition phase. The aim of that process is to automatically define workplace information added to the virtual pos platform in the EMV 3D application .

Merchant Enrollment API enables acquirers and their service providers to manage merchant participation in Mastercard Identity Check on EMV 3DS (3DS2). Acquirers and service providers can add/delete merchants directly in Mastercard Identity Solutions Services Management (ISSM) by sending the enrollment data through API interfaces.

How To Integrate?

[POST]→ Used by service providers or acquirers to add or delete the merchants into DS platform.

[GET]→ Used by service providers or acquirers to retrieve the status of the merchants enrolled through API prior to 6 months from the current date. The maximum number of records that can be returned from this API is 1000.

Certificate is created from the mastercard site for development.

Registered from on the Mastercard Developer site : https://developer.mastercard.com/account/sign-up

After registration new project is created with “Create New Project”.

Select the “ISSM Merchant Enrollment” api name that we want to use.

After completing all the steps in order, the project is created and the Sandbox (for testing) key is created.

We can create and download a new certificate with “Add Sandbox Key”.

The certification process is completed. Now, we need to use the certificate in our project.

Now let’s start coding with Visual Studio.

The Mastercard.Developer.Client Encryption.Core package is installed with Nuget in Visual Studio. After installation off nuget dll ,i created an async method for member merchant registrations .

Request and Response models :

I created my “EkleMastercard3DUyeIsyeri” method.

I used this code blog to upload the certificate to the Certificate Store and read it from Certificate Store.

X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);

store.Open(OpenFlags.ReadOnly);

I read the certificate with the LoadSigningKey method of the AuthenticationUtils class that I referenced fromMastercard.Developer.OAuth1Signer.Core.Utils dll.

var signingKey = AuthenticationUtils.LoadSigningKey(masterSertifika.Export(X509ContentType.SerializedCert), “Ozo1905***”);

I’m adding Header and Content parts of Rest service.

I downloaded the RequestSignerHandler class from the Mastercard site and used it in my project for signing operations.

Service parameters:

After all steps are completed, the integration is finished sucessfully.

The TransactionObjectId value is returned when the Add Merchant Api works successfully.

References

Mastercard Developers

--

--