You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: nodejs/README.md
+27-26Lines changed: 27 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
# mdes_for_merchants
2
2
3
3
MdesForMerchants - JavaScript client for mdes_for_merchants
4
-
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.
4
+
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)
5
5
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
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:
@@ -42,21 +36,17 @@ Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the follow
42
36
npm link
43
37
```
44
38
45
-
To use the link you just defined in your project, switch to the directory you want to use your mdes_for_merchants from, and run:
39
+
Finally, switch to the directory you want to use your mdes_for_merchants from, and run:
46
40
47
41
```shell
48
42
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
49
43
```
50
44
51
-
Finaly, you need to build the module:
45
+
You should now be able to `require('mdes_for_merchants')` in javascript files from the directory you ran the last command above from.
52
46
53
-
```shell
54
-
npm run build
55
-
```
47
+
### git
56
48
57
-
#### git
58
-
59
-
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID
49
+
If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID
60
50
then install it via:
61
51
62
52
```shell
@@ -65,9 +55,7 @@ then install it via:
65
55
66
56
### For browser
67
57
68
-
The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
69
-
the above steps with Node.js and installing browserify with `npm install -g browserify`,
70
-
perform the following (assuming *main.js* is your entry file):
58
+
The library also works in the browser environment via npm and [browserify](http://browserify.org/). 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):
71
59
72
60
```shell
73
61
browserify main.js > bundle.js
@@ -105,6 +93,7 @@ var api = new MdesForMerchants.DeleteApi()
105
93
var opts = {
106
94
'deleteRequestSchema':newMdesForMerchants.DeleteRequestSchema() // {DeleteRequestSchema} Contains the details of the request message.
107
95
};
96
+
108
97
varcallback=function(error, data, response) {
109
98
if (error) {
110
99
console.error(error);
@@ -123,31 +112,41 @@ All URIs are relative to *https://api.mastercard.com/mdes*
*MdesForMerchants.DeleteApi* | [**deleteDigitization**](docs/DeleteApi.md#deleteDigitization) | **POST** /digitization/static/1/0/delete | Used to delete one or more Tokens. The API is limited to 10 Tokens per request.
126
-
*MdesForMerchants.GetAssetApi* | [**getAsset**](docs/GetAssetApi.md#getAsset) | **GET** /assets/static/1/0/asset/{AssetId} | Used to retrieve static Assets from MDES�s repository, such as Card art, MasterCard brand logos, Issuer logos, and Terms and Conditions.
115
+
*MdesForMerchants.GetAssetApi* | [**getAsset**](docs/GetAssetApi.md#getAsset) | **GET** /assets/static/1/0/asset/{AssetId} | Used to retrieve static Assets from the MDES repository.
116
+
*MdesForMerchants.GetDigitalAssetsApi* | [**getDigitalAssets**](docs/GetDigitalAssetsApi.md#getDigitalAssets) | **POST** /digitization/static/1/0/getDigitalAssets | Used to retrieve digital assets derived from a funding PAN.
127
117
*MdesForMerchants.GetTaskStatusApi* | [**getTaskStatus**](docs/GetTaskStatusApi.md#getTaskStatus) | **POST** /digitization/static/1/0/getTaskStatus | Used to check the status of any asynchronous task that was previously requested.
128
118
*MdesForMerchants.GetTokenApi* | [**getToken**](docs/GetTokenApi.md#getToken) | **POST** /digitization/static/1/0/getToken | Used to get the status and details of a single given Token.
129
119
*MdesForMerchants.NotifyTokenUpdatedApi* | [**notifyTokenUpdateForTokenStateChange**](docs/NotifyTokenUpdatedApi.md#notifyTokenUpdateForTokenStateChange) | **POST** /digitization/static/1/0/notifyTokenUpdated | Outbound 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.
130
120
*MdesForMerchants.SearchTokensApi* | [**searchTokens**](docs/SearchTokensApi.md#searchTokens) | **POST** /digitization/static/1/0/searchTokens | Used to get basic token information for all tokens on a specified device, or all tokens mapped to the given Account PAN.
131
-
*MdesForMerchants.SuspendApi* | [**createSuspend**](docs/SuspendApi.md#createSuspend) | **POST** /digitization/static/1/0/suspend | Used to temporarily suspend one or more Tokens (for example, suspending all Tokens on a device in response to the device being lost). The API is limited to 10 Tokens per request.
121
+
*MdesForMerchants.SuspendApi* | [**createSuspend**](docs/SuspendApi.md#createSuspend) | **POST** /digitization/static/1/0/suspend | Used to temporarily suspend one or more Tokens.
132
122
*MdesForMerchants.TokenizeApi* | [**createTokenize**](docs/TokenizeApi.md#createTokenize) | **POST** /digitization/static/1/0/tokenize | Used to digitize a card to create a server-based Token.
133
123
*MdesForMerchants.TransactApi* | [**createTransact**](docs/TransactApi.md#createTransact) | **POST** /remotetransaction/static/1/0/transact | Used 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.
134
124
*MdesForMerchants.UnsuspendApi* | [**createUnsuspend**](docs/UnsuspendApi.md#createUnsuspend) | **POST** /digitization/static/1/0/unsuspend | Used to unsuspend one or more previously suspended Tokens. The API is limited to 10 Tokens per request.
0 commit comments