Skip to content

Commit 6d9ed14

Browse files
committed
April release : New KMS api.
1 parent bd65369 commit 6d9ed14

10 files changed

+520
-7
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# CyberSource.CreateSharedSecretKeysVerifiRequest
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**clientReferenceInformation** | [**Kmsv2keyssymClientReferenceInformation**](Kmsv2keyssymClientReferenceInformation.md) | | [optional]
7+
**keyInformation** | [**[Kmsv2keyssymverifiKeyInformation]**](Kmsv2keyssymverifiKeyInformation.md) | | [optional]
8+
9+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# CyberSource.Kmsv2keyssymverifiKeyInformation
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**organizationId** | **String** | Merchant Id |
7+
**referenceNumber** | **String** | Reference number is a unique identifier provided by the client along with the organization Id. This is an optional field provided solely for the client’s convenience. If client specifies value for this field in the request, it is expected to be available in the response. | [optional]
8+
**digestAlgorithm** | **String** | Algorithm for message signature authentication | [optional] [default to 'HMACSHA2']
9+
10+
11+
<a name="DigestAlgorithmEnum"></a>
12+
## Enum: DigestAlgorithmEnum
13+
14+
15+
* `HMACSHA1` (value: `"HMACSHA1"`)
16+
17+
* `HMACSHA2` (value: `"HMACSHA2"`)
18+
19+
20+
21+

docs/SymmetricKeyManagementApi.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All URIs are relative to *https://apitest.cybersource.com*
55
Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**createV2SharedSecretKeys**](SymmetricKeyManagementApi.md#createV2SharedSecretKeys) | **POST** /kms/v2/keys-sym | Create Shared-Secret Keys
8+
[**createV2SharedSecretKeysVerifi**](SymmetricKeyManagementApi.md#createV2SharedSecretKeysVerifi) | **POST** /kms/v2/keys-sym/verifi | Create Shared-Secret Keys as per verifi spec
89
[**deleteBulkSymmetricKeys**](SymmetricKeyManagementApi.md#deleteBulkSymmetricKeys) | **POST** /kms/v2/keys-sym/deletes | Delete one or more Symmetric keys
910
[**getKeyDetails**](SymmetricKeyManagementApi.md#getKeyDetails) | **GET** /kms/v2/keys-sym/{keyId} | Retrieves shared secret key details
1011

@@ -50,6 +51,55 @@ Name | Type | Description | Notes
5051

5152
No authorization required
5253

54+
### HTTP request headers
55+
56+
- **Content-Type**: application/json;charset=utf-8
57+
- **Accept**: application/hal+json;charset=utf-8
58+
59+
<a name="createV2SharedSecretKeysVerifi"></a>
60+
# **createV2SharedSecretKeysVerifi**
61+
> KmsV2KeysSymPost201Response createV2SharedSecretKeysVerifi(vIcDomain, createSharedSecretKeysVerifiRequest)
62+
63+
Create Shared-Secret Keys as per verifi spec
64+
65+
Create one or more Shared-Secret Keys as per Verifi spec with 32 chars, store digest algo during key generation.
66+
67+
### Example
68+
```javascript
69+
var CyberSource = require('CyberSource');
70+
71+
var apiInstance = new CyberSource.SymmetricKeyManagementApi();
72+
73+
var vIcDomain = "vIcDomain_example"; // String | domain
74+
75+
var createSharedSecretKeysVerifiRequest = new CyberSource.CreateSharedSecretKeysVerifiRequest(); // CreateSharedSecretKeysVerifiRequest |
76+
77+
78+
var callback = function(error, data, response) {
79+
if (error) {
80+
console.error(error);
81+
} else {
82+
console.log('API called successfully. Returned data: ' + data);
83+
}
84+
};
85+
apiInstance.createV2SharedSecretKeysVerifi(vIcDomain, createSharedSecretKeysVerifiRequest, callback);
86+
```
87+
88+
### Parameters
89+
90+
Name | Type | Description | Notes
91+
------------- | ------------- | ------------- | -------------
92+
**vIcDomain** | **String**| domain |
93+
**createSharedSecretKeysVerifiRequest** | [**CreateSharedSecretKeysVerifiRequest**](CreateSharedSecretKeysVerifiRequest.md)| |
94+
95+
### Return type
96+
97+
[**KmsV2KeysSymPost201Response**](KmsV2KeysSymPost201Response.md)
98+
99+
### Authorization
100+
101+
No authorization required
102+
53103
### HTTP request headers
54104

55105
- **Content-Type**: application/json;charset=utf-8

src/api/SymmetricKeyManagementApi.js

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
(function(root, factory) {
1717
if (typeof define === 'function' && define.amd) {
1818
// AMD. Register as an anonymous module.
19-
define(['ApiClient', 'model/CreateSharedSecretKeysRequest', 'model/DeleteBulkSymmetricKeysRequest', 'model/InlineResponse4002', 'model/KmsV2KeysSymDeletesPost200Response', 'model/KmsV2KeysSymGet200Response', 'model/KmsV2KeysSymPost201Response', 'model/PtsV2PaymentsPost502Response'], factory);
19+
define(['ApiClient', 'model/CreateSharedSecretKeysRequest', 'model/CreateSharedSecretKeysVerifiRequest', 'model/DeleteBulkSymmetricKeysRequest', 'model/InlineResponse4002', 'model/KmsV2KeysSymDeletesPost200Response', 'model/KmsV2KeysSymGet200Response', 'model/KmsV2KeysSymPost201Response', 'model/PtsV2PaymentsPost502Response'], factory);
2020
} else if (typeof module === 'object' && module.exports) {
2121
// CommonJS-like environments that support module.exports, like Node.
22-
module.exports = factory(require('../ApiClient'), require('../model/CreateSharedSecretKeysRequest'), require('../model/DeleteBulkSymmetricKeysRequest'), require('../model/InlineResponse4002'), require('../model/KmsV2KeysSymDeletesPost200Response'), require('../model/KmsV2KeysSymGet200Response'), require('../model/KmsV2KeysSymPost201Response'), require('../model/PtsV2PaymentsPost502Response'));
22+
module.exports = factory(require('../ApiClient'), require('../model/CreateSharedSecretKeysRequest'), require('../model/CreateSharedSecretKeysVerifiRequest'), require('../model/DeleteBulkSymmetricKeysRequest'), require('../model/InlineResponse4002'), require('../model/KmsV2KeysSymDeletesPost200Response'), require('../model/KmsV2KeysSymGet200Response'), require('../model/KmsV2KeysSymPost201Response'), require('../model/PtsV2PaymentsPost502Response'));
2323
} else {
2424
// Browser globals (root is window)
2525
if (!root.CyberSource) {
2626
root.CyberSource = {};
2727
}
28-
root.CyberSource.SymmetricKeyManagementApi = factory(root.CyberSource.ApiClient, root.CyberSource.CreateSharedSecretKeysRequest, root.CyberSource.DeleteBulkSymmetricKeysRequest, root.CyberSource.InlineResponse4002, root.CyberSource.KmsV2KeysSymDeletesPost200Response, root.CyberSource.KmsV2KeysSymGet200Response, root.CyberSource.KmsV2KeysSymPost201Response, root.CyberSource.PtsV2PaymentsPost502Response);
28+
root.CyberSource.SymmetricKeyManagementApi = factory(root.CyberSource.ApiClient, root.CyberSource.CreateSharedSecretKeysRequest, root.CyberSource.CreateSharedSecretKeysVerifiRequest, root.CyberSource.DeleteBulkSymmetricKeysRequest, root.CyberSource.InlineResponse4002, root.CyberSource.KmsV2KeysSymDeletesPost200Response, root.CyberSource.KmsV2KeysSymGet200Response, root.CyberSource.KmsV2KeysSymPost201Response, root.CyberSource.PtsV2PaymentsPost502Response);
2929
}
30-
}(this, function(ApiClient, CreateSharedSecretKeysRequest, DeleteBulkSymmetricKeysRequest, InlineResponse4002, KmsV2KeysSymDeletesPost200Response, KmsV2KeysSymGet200Response, KmsV2KeysSymPost201Response, PtsV2PaymentsPost502Response) {
30+
}(this, function(ApiClient, CreateSharedSecretKeysRequest, CreateSharedSecretKeysVerifiRequest, DeleteBulkSymmetricKeysRequest, InlineResponse4002, KmsV2KeysSymDeletesPost200Response, KmsV2KeysSymGet200Response, KmsV2KeysSymPost201Response, PtsV2PaymentsPost502Response) {
3131
'use strict';
3232

3333
/**
@@ -94,6 +94,58 @@
9494
);
9595
}
9696

97+
/**
98+
* Callback function to receive the result of the createV2SharedSecretKeysVerifi operation.
99+
* @callback module:api/SymmetricKeyManagementApi~createV2SharedSecretKeysVerifiCallback
100+
* @param {String} error Error message, if any.
101+
* @param {module:model/KmsV2KeysSymPost201Response} data The data returned by the service call.
102+
* @param {String} response The complete HTTP response.
103+
*/
104+
105+
/**
106+
* Create Shared-Secret Keys as per verifi spec
107+
* Create one or more Shared-Secret Keys as per Verifi spec with 32 chars, store digest algo during key generation.
108+
* @param {String} vIcDomain domain
109+
* @param {module:model/CreateSharedSecretKeysVerifiRequest} createSharedSecretKeysVerifiRequest
110+
* @param {module:api/SymmetricKeyManagementApi~createV2SharedSecretKeysVerifiCallback} callback The callback function, accepting three arguments: error, data, response
111+
* data is of type: {@link module:model/KmsV2KeysSymPost201Response}
112+
*/
113+
this.createV2SharedSecretKeysVerifi = function(vIcDomain, createSharedSecretKeysVerifiRequest, callback) {
114+
var postBody = createSharedSecretKeysVerifiRequest;
115+
116+
// verify the required parameter 'vIcDomain' is set
117+
if (vIcDomain === undefined || vIcDomain === null) {
118+
throw new Error("Missing the required parameter 'vIcDomain' when calling createV2SharedSecretKeysVerifi");
119+
}
120+
121+
// verify the required parameter 'createSharedSecretKeysVerifiRequest' is set
122+
if (createSharedSecretKeysVerifiRequest === undefined || createSharedSecretKeysVerifiRequest === null) {
123+
throw new Error("Missing the required parameter 'createSharedSecretKeysVerifiRequest' when calling createV2SharedSecretKeysVerifi");
124+
}
125+
126+
127+
var pathParams = {
128+
};
129+
var queryParams = {
130+
};
131+
var headerParams = {
132+
'v-ic-domain': vIcDomain
133+
};
134+
var formParams = {
135+
};
136+
137+
var authNames = [];
138+
var contentTypes = ['application/json;charset=utf-8'];
139+
var accepts = ['application/hal+json;charset=utf-8'];
140+
var returnType = KmsV2KeysSymPost201Response;
141+
142+
return this.apiClient.callApi(
143+
'/kms/v2/keys-sym/verifi', 'POST',
144+
pathParams, queryParams, headerParams, formParams, postBody,
145+
authNames, contentTypes, accepts, returnType, callback
146+
);
147+
}
148+
97149
/**
98150
* Callback function to receive the result of the deleteBulkSymmetricKeys operation.
99151
* @callback module:api/SymmetricKeyManagementApi~deleteBulkSymmetricKeysCallback

src/index.js

Lines changed: 13 additions & 3 deletions
Large diffs are not rendered by default.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/**
2+
* CyberSource Merged Spec
3+
* All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
4+
*
5+
* OpenAPI spec version: 0.0.1
6+
*
7+
* NOTE: This class is auto generated by the swagger code generator program.
8+
* https://github.com/swagger-api/swagger-codegen.git
9+
*
10+
* Swagger Codegen version: 2.3.0
11+
*
12+
* Do not edit the class manually.
13+
*
14+
*/
15+
16+
(function(root, factory) {
17+
if (typeof define === 'function' && define.amd) {
18+
// AMD. Register as an anonymous module.
19+
define(['ApiClient', 'model/Kmsv2keyssymClientReferenceInformation', 'model/Kmsv2keyssymverifiKeyInformation'], factory);
20+
} else if (typeof module === 'object' && module.exports) {
21+
// CommonJS-like environments that support module.exports, like Node.
22+
module.exports = factory(require('../ApiClient'), require('./Kmsv2keyssymClientReferenceInformation'), require('./Kmsv2keyssymverifiKeyInformation'));
23+
} else {
24+
// Browser globals (root is window)
25+
if (!root.CyberSource) {
26+
root.CyberSource = {};
27+
}
28+
root.CyberSource.CreateSharedSecretKeysVerifiRequest = factory(root.CyberSource.ApiClient, root.CyberSource.Kmsv2keyssymClientReferenceInformation, root.CyberSource.Kmsv2keyssymverifiKeyInformation);
29+
}
30+
}(this, function(ApiClient, Kmsv2keyssymClientReferenceInformation, Kmsv2keyssymverifiKeyInformation) {
31+
'use strict';
32+
33+
34+
35+
36+
/**
37+
* The CreateSharedSecretKeysVerifiRequest model module.
38+
* @module model/CreateSharedSecretKeysVerifiRequest
39+
* @version 0.0.1
40+
*/
41+
42+
/**
43+
* Constructs a new <code>CreateSharedSecretKeysVerifiRequest</code>.
44+
* @alias module:model/CreateSharedSecretKeysVerifiRequest
45+
* @class
46+
*/
47+
var exports = function() {
48+
var _this = this;
49+
50+
51+
52+
};
53+
54+
/**
55+
* Constructs a <code>CreateSharedSecretKeysVerifiRequest</code> from a plain JavaScript object, optionally creating a new instance.
56+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
57+
* @param {Object} data The plain JavaScript object bearing properties of interest.
58+
* @param {module:model/CreateSharedSecretKeysVerifiRequest} obj Optional instance to populate.
59+
* @return {module:model/CreateSharedSecretKeysVerifiRequest} The populated <code>CreateSharedSecretKeysVerifiRequest</code> instance.
60+
*/
61+
exports.constructFromObject = function(data, obj) {
62+
if (data) {
63+
obj = obj || new exports();
64+
65+
if (data.hasOwnProperty('clientReferenceInformation')) {
66+
obj['clientReferenceInformation'] = Kmsv2keyssymClientReferenceInformation.constructFromObject(data['clientReferenceInformation']);
67+
}
68+
if (data.hasOwnProperty('keyInformation')) {
69+
obj['keyInformation'] = ApiClient.convertToType(data['keyInformation'], [Kmsv2keyssymverifiKeyInformation]);
70+
}
71+
}
72+
return obj;
73+
}
74+
75+
/**
76+
* @member {module:model/Kmsv2keyssymClientReferenceInformation} clientReferenceInformation
77+
*/
78+
exports.prototype['clientReferenceInformation'] = undefined;
79+
/**
80+
* @member {Array.<module:model/Kmsv2keyssymverifiKeyInformation>} keyInformation
81+
*/
82+
exports.prototype['keyInformation'] = undefined;
83+
84+
85+
86+
return exports;
87+
}));
88+
89+
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/**
2+
* CyberSource Merged Spec
3+
* All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
4+
*
5+
* OpenAPI spec version: 0.0.1
6+
*
7+
* NOTE: This class is auto generated by the swagger code generator program.
8+
* https://github.com/swagger-api/swagger-codegen.git
9+
*
10+
* Swagger Codegen version: 2.3.0
11+
*
12+
* Do not edit the class manually.
13+
*
14+
*/
15+
16+
(function(root, factory) {
17+
if (typeof define === 'function' && define.amd) {
18+
// AMD. Register as an anonymous module.
19+
define(['ApiClient'], factory);
20+
} else if (typeof module === 'object' && module.exports) {
21+
// CommonJS-like environments that support module.exports, like Node.
22+
module.exports = factory(require('../ApiClient'));
23+
} else {
24+
// Browser globals (root is window)
25+
if (!root.CyberSource) {
26+
root.CyberSource = {};
27+
}
28+
root.CyberSource.Kmsv2keyssymverifiKeyInformation = factory(root.CyberSource.ApiClient);
29+
}
30+
}(this, function(ApiClient) {
31+
'use strict';
32+
33+
34+
35+
36+
/**
37+
* The Kmsv2keyssymverifiKeyInformation model module.
38+
* @module model/Kmsv2keyssymverifiKeyInformation
39+
* @version 0.0.1
40+
*/
41+
42+
/**
43+
* Constructs a new <code>Kmsv2keyssymverifiKeyInformation</code>.
44+
* key information
45+
* @alias module:model/Kmsv2keyssymverifiKeyInformation
46+
* @class
47+
* @param organizationId {String} Merchant Id
48+
*/
49+
var exports = function(organizationId) {
50+
var _this = this;
51+
52+
_this['organizationId'] = organizationId;
53+
54+
55+
};
56+
57+
/**
58+
* Constructs a <code>Kmsv2keyssymverifiKeyInformation</code> from a plain JavaScript object, optionally creating a new instance.
59+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
60+
* @param {Object} data The plain JavaScript object bearing properties of interest.
61+
* @param {module:model/Kmsv2keyssymverifiKeyInformation} obj Optional instance to populate.
62+
* @return {module:model/Kmsv2keyssymverifiKeyInformation} The populated <code>Kmsv2keyssymverifiKeyInformation</code> instance.
63+
*/
64+
exports.constructFromObject = function(data, obj) {
65+
if (data) {
66+
obj = obj || new exports();
67+
68+
if (data.hasOwnProperty('organizationId')) {
69+
obj['organizationId'] = ApiClient.convertToType(data['organizationId'], 'String');
70+
}
71+
if (data.hasOwnProperty('referenceNumber')) {
72+
obj['referenceNumber'] = ApiClient.convertToType(data['referenceNumber'], 'String');
73+
}
74+
if (data.hasOwnProperty('digestAlgorithm')) {
75+
obj['digestAlgorithm'] = ApiClient.convertToType(data['digestAlgorithm'], 'String');
76+
}
77+
}
78+
return obj;
79+
}
80+
81+
/**
82+
* Merchant Id
83+
* @member {String} organizationId
84+
*/
85+
exports.prototype['organizationId'] = undefined;
86+
/**
87+
* Reference number is a unique identifier provided by the client along with the organization Id. This is an optional field provided solely for the client’s convenience. If client specifies value for this field in the request, it is expected to be available in the response.
88+
* @member {String} referenceNumber
89+
*/
90+
exports.prototype['referenceNumber'] = undefined;
91+
/**
92+
* Algorithm for message signature authentication
93+
* @member {module:model/Kmsv2keyssymverifiKeyInformation.DigestAlgorithmEnum} digestAlgorithm
94+
* @default 'HMACSHA2'
95+
*/
96+
exports.prototype['digestAlgorithm'] = 'HMACSHA2';
97+
98+
99+
/**
100+
* Allowed values for the <code>digestAlgorithm</code> property.
101+
* @enum {String}
102+
* @readonly
103+
*/
104+
exports.DigestAlgorithmEnum = {
105+
/**
106+
* value: "HMACSHA1"
107+
* @const
108+
*/
109+
"HMACSHA1": "HMACSHA1",
110+
/**
111+
* value: "HMACSHA2"
112+
* @const
113+
*/
114+
"HMACSHA2": "HMACSHA2" };
115+
116+
117+
return exports;
118+
}));
119+
120+

0 commit comments

Comments
 (0)