|
| 1 | +# mdes_for_merchants |
| 2 | + |
| 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. |
| 5 | +This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: |
| 6 | + |
| 7 | +- API version: 1.2.7 |
| 8 | +- Package version: 1.2.7 |
| 9 | +- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen |
| 10 | + |
| 11 | +## Installation |
| 12 | + |
| 13 | +### For [Node.js](https://nodejs.org/) |
| 14 | + |
| 15 | +#### npm |
| 16 | + |
| 17 | +To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages). |
| 18 | + |
| 19 | +Then install it via: |
| 20 | + |
| 21 | +```shell |
| 22 | +npm install mdes_for_merchants --save |
| 23 | +``` |
| 24 | + |
| 25 | +Finaly, you need to build the module: |
| 26 | + |
| 27 | +```shell |
| 28 | +npm run build |
| 29 | +``` |
| 30 | + |
| 31 | +##### Local development |
| 32 | + |
| 33 | +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: |
| 34 | + |
| 35 | +```shell |
| 36 | +npm install |
| 37 | +``` |
| 38 | + |
| 39 | +Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`: |
| 40 | + |
| 41 | +```shell |
| 42 | +npm link |
| 43 | +``` |
| 44 | + |
| 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: |
| 46 | + |
| 47 | +```shell |
| 48 | +npm link /path/to/<JAVASCRIPT_CLIENT_DIR> |
| 49 | +``` |
| 50 | + |
| 51 | +Finaly, you need to build the module: |
| 52 | + |
| 53 | +```shell |
| 54 | +npm run build |
| 55 | +``` |
| 56 | + |
| 57 | +#### git |
| 58 | + |
| 59 | +If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID |
| 60 | +then install it via: |
| 61 | + |
| 62 | +```shell |
| 63 | + npm install GIT_USER_ID/GIT_REPO_ID --save |
| 64 | +``` |
| 65 | + |
| 66 | +### For browser |
| 67 | + |
| 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): |
| 71 | + |
| 72 | +```shell |
| 73 | +browserify main.js > bundle.js |
| 74 | +``` |
| 75 | + |
| 76 | +Then include *bundle.js* in the HTML pages. |
| 77 | + |
| 78 | +### Webpack Configuration |
| 79 | + |
| 80 | +Using Webpack you may encounter the following error: "Module not found: Error: |
| 81 | +Cannot resolve module", most certainly you should disable AMD loader. Add/merge |
| 82 | +the following section to your webpack config: |
| 83 | + |
| 84 | +```javascript |
| 85 | +module: { |
| 86 | + rules: [ |
| 87 | + { |
| 88 | + parser: { |
| 89 | + amd: false |
| 90 | + } |
| 91 | + } |
| 92 | + ] |
| 93 | +} |
| 94 | +``` |
| 95 | + |
| 96 | +## Getting Started |
| 97 | + |
| 98 | +Please follow the [installation](#installation) instruction and execute the following JS code: |
| 99 | + |
| 100 | +```javascript |
| 101 | +var MdesForMerchants = require('mdes_for_merchants'); |
| 102 | + |
| 103 | + |
| 104 | +var api = new MdesForMerchants.DeleteApi() |
| 105 | +var opts = { |
| 106 | + 'deleteRequestSchema': new MdesForMerchants.DeleteRequestSchema() // {DeleteRequestSchema} Contains the details of the request message. |
| 107 | +}; |
| 108 | +var callback = function(error, data, response) { |
| 109 | + if (error) { |
| 110 | + console.error(error); |
| 111 | + } else { |
| 112 | + console.log('API called successfully. Returned data: ' + data); |
| 113 | + } |
| 114 | +}; |
| 115 | +api.deleteDigitization(opts, callback); |
| 116 | + |
| 117 | +``` |
| 118 | + |
| 119 | +## Documentation for API Endpoints |
| 120 | + |
| 121 | +All URIs are relative to *https://api.mastercard.com/mdes* |
| 122 | + |
| 123 | +Class | Method | HTTP request | Description |
| 124 | +------------ | ------------- | ------------- | ------------- |
| 125 | +*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. |
| 127 | +*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 | +*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 | +*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 | +*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. |
| 132 | +*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 | +*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 | +*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. |
| 135 | + |
| 136 | + |
| 137 | +## Documentation for Models |
| 138 | + |
| 139 | + - [MdesForMerchants.AssetResponseSchema](docs/AssetResponseSchema.md) |
| 140 | + - [MdesForMerchants.AuthenticationMethods](docs/AuthenticationMethods.md) |
| 141 | + - [MdesForMerchants.BillingAddress](docs/BillingAddress.md) |
| 142 | + - [MdesForMerchants.CardInfo](docs/CardInfo.md) |
| 143 | + - [MdesForMerchants.CardInfoData](docs/CardInfoData.md) |
| 144 | + - [MdesForMerchants.DecisioningData](docs/DecisioningData.md) |
| 145 | + - [MdesForMerchants.DeleteRequestSchema](docs/DeleteRequestSchema.md) |
| 146 | + - [MdesForMerchants.DeleteResponseSchema](docs/DeleteResponseSchema.md) |
| 147 | + - [MdesForMerchants.EncryptedPayload](docs/EncryptedPayload.md) |
| 148 | + - [MdesForMerchants.EncryptedPayloadTransact](docs/EncryptedPayloadTransact.md) |
| 149 | + - [MdesForMerchants.Error](docs/Error.md) |
| 150 | + - [MdesForMerchants.ErrorsResponse](docs/ErrorsResponse.md) |
| 151 | + - [MdesForMerchants.GetTaskStatusRequestSchema](docs/GetTaskStatusRequestSchema.md) |
| 152 | + - [MdesForMerchants.GetTaskStatusResponseSchema](docs/GetTaskStatusResponseSchema.md) |
| 153 | + - [MdesForMerchants.GetTokenRequestSchema](docs/GetTokenRequestSchema.md) |
| 154 | + - [MdesForMerchants.GetTokenResponseSchema](docs/GetTokenResponseSchema.md) |
| 155 | + - [MdesForMerchants.MediaContent](docs/MediaContent.md) |
| 156 | + - [MdesForMerchants.NotifyTokenEncryptedPayload](docs/NotifyTokenEncryptedPayload.md) |
| 157 | + - [MdesForMerchants.NotifyTokenUpdatedRequestSchema](docs/NotifyTokenUpdatedRequestSchema.md) |
| 158 | + - [MdesForMerchants.NotifyTokenUpdatedResponseSchema](docs/NotifyTokenUpdatedResponseSchema.md) |
| 159 | + - [MdesForMerchants.ProductConfig](docs/ProductConfig.md) |
| 160 | + - [MdesForMerchants.SearchTokensRequestSchema](docs/SearchTokensRequestSchema.md) |
| 161 | + - [MdesForMerchants.SearchTokensResponseSchema](docs/SearchTokensResponseSchema.md) |
| 162 | + - [MdesForMerchants.SuspendRequestSchema](docs/SuspendRequestSchema.md) |
| 163 | + - [MdesForMerchants.SuspendResponseSchema](docs/SuspendResponseSchema.md) |
| 164 | + - [MdesForMerchants.Token](docs/Token.md) |
| 165 | + - [MdesForMerchants.TokenDetail](docs/TokenDetail.md) |
| 166 | + - [MdesForMerchants.TokenDetailData](docs/TokenDetailData.md) |
| 167 | + - [MdesForMerchants.TokenDetailDataPAR](docs/TokenDetailDataPAR.md) |
| 168 | + - [MdesForMerchants.TokenDetailTokenizeResponse](docs/TokenDetailTokenizeResponse.md) |
| 169 | + - [MdesForMerchants.TokenForLCM](docs/TokenForLCM.md) |
| 170 | + - [MdesForMerchants.TokenInfo](docs/TokenInfo.md) |
| 171 | + - [MdesForMerchants.TokenizeRequestSchema](docs/TokenizeRequestSchema.md) |
| 172 | + - [MdesForMerchants.TokenizeResponseSchema](docs/TokenizeResponseSchema.md) |
| 173 | + - [MdesForMerchants.TransactEncryptedData](docs/TransactEncryptedData.md) |
| 174 | + - [MdesForMerchants.TransactError](docs/TransactError.md) |
| 175 | + - [MdesForMerchants.TransactRequestSchema](docs/TransactRequestSchema.md) |
| 176 | + - [MdesForMerchants.TransactResponseSchema](docs/TransactResponseSchema.md) |
| 177 | + - [MdesForMerchants.UnSuspendRequestSchema](docs/UnSuspendRequestSchema.md) |
| 178 | + - [MdesForMerchants.UnSuspendResponseSchema](docs/UnSuspendResponseSchema.md) |
| 179 | + |
| 180 | + |
| 181 | +## Documentation for Authorization |
| 182 | + |
| 183 | +All endpoints do not require authorization. |
0 commit comments