1.3.0 • Published 2 years ago

@sandoval0992/mdes_digital_enablement_api v1.3.0

Weekly downloads
-
License
Unlicense
Repository
github
Last release
2 years ago

mdes_digital_enablement_api

MdesDigitalEnablementApi - JavaScript client for mdes_digital_enablement_api These 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. 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: 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. 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.

An OAUTH1.0a signer library is available on GitHub Encryption All communications between Issuer web service and the Mastercard gateway is encrypted using TLS. 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).

Java Client Encryption Library available on GitHub

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.3.0
  • Package version: 1.3.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install mdes_digital_enablement_api --save
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

Finally, switch to the directory you want to use your mdes_digital_enablement_api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('mdes_digital_enablement_api') in javascript files from the directory you ran the last command above from.

git

If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually use this library):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var MdesDigitalEnablementApi = require('mdes_digital_enablement_api');


var api = new MdesDigitalEnablementApi.DeleteApi()
var opts = {
  'deleteRequestSchema': new MdesDigitalEnablementApi.DeleteRequestSchema() // {DeleteRequestSchema} Contains the details of the request message. 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.deleteDigitization(opts, callback);

Documentation for API Endpoints

All URIs are relative to https://api.mastercard.com/mdes

ClassMethodHTTP requestDescription
MdesDigitalEnablementApi.DeleteApideleteDigitizationPOST /digitization/static/1/0/deleteUsed to delete one or more Tokens. The API is limited to 10 Tokens per request.
MdesDigitalEnablementApi.GetAssetApigetAssetGET /assets/static/1/0/asset/{AssetId}Used to retrieve static Assets from the MDES repository.
MdesDigitalEnablementApi.GetTaskStatusApigetTaskStatusPOST /digitization/static/1/0/getTaskStatusUsed to check the status of any asynchronous task that was previously requested.
MdesDigitalEnablementApi.GetTokenApigetTokenPOST /digitization/static/1/0/getTokenUsed to get the status and details of a single given Token.
MdesDigitalEnablementApi.NotifyTokenUpdatedApinotifyTokenUpdateForTokenStateChangePOST /digitization/static/1/0/notifyTokenUpdatedOutbound API used by MDES to notify the Token Requestor of significant Token updates, such as when the Token is activated, suspended, unsuspended or deleted; or when information about the Token or its product configuration has changed.
MdesDigitalEnablementApi.SearchTokensApisearchTokensPOST /digitization/static/1/0/searchTokensUsed to get basic token information for all tokens on a specified device, or all tokens mapped to the given Account PAN.
MdesDigitalEnablementApi.SuspendApicreateSuspendPOST /digitization/static/1/0/suspendUsed to temporarily suspend one or more Tokens.
MdesDigitalEnablementApi.TokenizeApicreateTokenizePOST /digitization/static/1/0/tokenize
MdesDigitalEnablementApi.TransactApicreateTransactPOST /remotetransaction/static/1/0/transactUsed by the Token Requestor to create a Digital Secure Remote Payment (\"DSRP\") transaction cryptogram using the credentials stored within MDES in order to perform a DSRP transaction.
MdesDigitalEnablementApi.UnsuspendApicreateUnsuspendPOST /digitization/static/1/0/unsuspendUsed to unsuspend one or more previously suspended Tokens. The API is limited to 10 Tokens per request.

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.