forked from Mastercard/mastercard-api-client-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToken.js
More file actions
117 lines (104 loc) · 6.46 KB
/
Copy pathToken.js
File metadata and controls
117 lines (104 loc) · 6.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/**
* 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. <br><br> **Authentication** <br><br> 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><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><br> **Encryption** <br><br> All communications between Issuer web service and the Mastercard gateway is encrypted using TLS. <br><br> **Additional Encryption of Sensitive Data** <br><br> 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)
*
* The version of the OpenAPI document: 1.3.0
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
*
* OpenAPI Generator version: 5.2.0
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/ProductConfig', 'model/TokenInfo'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./ProductConfig'), require('./TokenInfo'));
} else {
// Browser globals (root is window)
if (!root.MdesDigitalEnablementApi) {
root.MdesDigitalEnablementApi = {};
}
root.MdesDigitalEnablementApi.Token = factory(root.MdesDigitalEnablementApi.ApiClient, root.MdesDigitalEnablementApi.ProductConfig, root.MdesDigitalEnablementApi.TokenInfo);
}
}(this, function(ApiClient, ProductConfig, TokenInfo) {
'use strict';
/**
* The Token model module.
* @module model/Token
* @version 1.3.0
*/
/**
* Constructs a new <code>Token</code>.
* @alias module:model/Token
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Token</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Token} obj Optional instance to populate.
* @return {module:model/Token} The populated <code>Token</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('tokenUniqueReference')) {
obj['tokenUniqueReference'] = ApiClient.convertToType(data['tokenUniqueReference'], 'String');
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
if (data.hasOwnProperty('suspendedBy')) {
obj['suspendedBy'] = ApiClient.convertToType(data['suspendedBy'], ['String']);
}
if (data.hasOwnProperty('statusTimestamp')) {
obj['statusTimestamp'] = ApiClient.convertToType(data['statusTimestamp'], 'String');
}
if (data.hasOwnProperty('productConfig')) {
obj['productConfig'] = ProductConfig.constructFromObject(data['productConfig']);
}
if (data.hasOwnProperty('tokenInfo')) {
obj['tokenInfo'] = TokenInfo.constructFromObject(data['tokenInfo']);
}
}
return obj;
}
/**
* The unique reference allocated to the Token which is always present even if an error occurs. maxLength: 64
* @member {String} tokenUniqueReference
*/
exports.prototype['tokenUniqueReference'] = undefined;
/**
* The current status of Token. Must be either: * 'INACTIVE' (Token has not yet been activated) * 'ACTIVE' (Token is active and ready to transact) * 'SUSPENDED' (Token is suspended and unable to transact) * 'DEACTIVATED' (Token has been permanently deactivated). maxLength: 32
* @member {String} status
*/
exports.prototype['status'] = undefined;
/**
* (CONDITIONAL only supplied if status is SUSPENDED) Who or what caused the Token to be suspended One or more values of: * ISSUER - Suspended by the Issuer. * TOKEN_REQUESTOR - Suspended by the Token Requestor * MOBILE_PIN_LOCKED - Suspended due to the Mobile PIN being locked * CARDHOLDER - Suspended by the Cardholder
* @member {Array.<String>} suspendedBy
*/
exports.prototype['suspendedBy'] = undefined;
/**
* The date and time the token status was last updated. Expressed in ISO 8601 extended format as one of the following: * YYYY-MM-DDThh:mm:ss[.sss]Z * YYYY-MM-DDThh:mm:ss[.sss]±hh:mm * Where [.sss] is optional and can be 1 to 3 digits.
* @member {String} statusTimestamp
*/
exports.prototype['statusTimestamp'] = undefined;
/**
* @member {module:model/ProductConfig} productConfig
*/
exports.prototype['productConfig'] = undefined;
/**
* @member {module:model/TokenInfo} tokenInfo
*/
exports.prototype['tokenInfo'] = undefined;
return exports;
}));