Skip to content

Commit 40d3e68

Browse files
authored
Merge pull request #32 from CyberSource/dec19-dev
Adding code for auditing
2 parents 23b92f3 + aea9867 commit 40d3e68

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

generator/cybersource-javascript-template/ApiClient.mustache

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,14 @@
381381
382382
var token = AuthenticationSDK.Authorization.getToken(this.merchantConfig, this.logger);
383383
384+
var clientId = getClientId();
385+
386+
headerParams['v-c-client-id'] = clientId;
387+
388+
// if (this.merchantConfig.getSolutionId() != null && this.merchantConfig.getSolutionId() != '') {
389+
// headerParams['v-c-solution-id'] = this.merchantConfig.getSolutionId();
390+
// }
391+
384392
if (this.merchantConfig.getAuthenticationType().toLowerCase() === this.constants.JWT) {
385393
token = 'Bearer ' + token;
386394
headerParams['Authorization'] = token;
@@ -414,6 +422,11 @@
414422

415423
return headerParams;
416424
}
425+
426+
function getClientId() {
427+
var packageInfo = require('./../package.json');
428+
return "cybs-rest-sdk-node-" + packageInfo.version;
429+
}
417430

418431
{{#emitJSDoc}}{{^usePromises}} /**
419432
* Callback function to receive the result of the operation.
@@ -452,7 +465,7 @@
452465
var proxyUser = this.merchantConfig.getProxyUser();
453466
var proxyPassword = this.merchantConfig.getProxyPassword();
454467
455-
var request = superagent(httpMethod, url);
468+
var request = superagent(httpMethod, url);
456469
457470
if (useProxy && (proxyAddress != null && proxyAddress != '')) {
458471
require('superagent-proxy')(require('superagent'));

0 commit comments

Comments
 (0)