Skip to content

Commit 4406e5d

Browse files
Merge pull request #5 from cybersource-tpi/v24.2.0
V24.2.0
2 parents b591488 + c5da658 commit 4406e5d

27 files changed

+932
-370
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
* **Description:** Cybersource, a Visa solution, is the only global, modular payment management platform built on secure Visa infrastructure with the payment reach and fraud insights of a massive $500B+ global processing network. You can find out more about what Cybersource does [here](https://www.cybersource.com/en-gb.html)
55
* **Categories:** Payment Processing, Fraud Detection, Address Validation, Tax Computation
6-
* **Version:** 24.1.0
7-
* **Last Certification Date:** February-2024
6+
* **Version:** 24.2.0
7+
* **Last Certification Date:** April-2024
88
* **Supports SFRA v6.3.0**
99
* **JavaScript Controllers Friendly:** **YES**
1010

1111
### Contact ###
12-
* Lindsey Rodgers: <SFCC@cybersource.com>
12+
* Global Partner Solutions - Customer Support : <GlobalPartnerSolutionsCS@visa.com>
1313

1414
----
1515

cartridges/int_cybs_sfra/cartridge/client/default/js/deviceDataCollection.js

+9
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,12 @@ window.onload = function () {
44
// Auto submit form on page load
55
document.getElementById('collectionForm').submit();
66
};
7+
8+
window.addEventListener('message', function(event) {
9+
if (event.origin === 'https://centinelapistag.cardinalcommerce.com' || event.origin === 'https://centinelapi.cardinalcommerce.com') {
10+
console.log(event.data);
11+
document.payerAuthRedirect.submit();
12+
}
13+
}, false);
14+
setTimeout(function () {
15+
document.payerAuthRedirect.submit();}, 10000);
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
<link rel="stylesheet" href="${URLUtils.staticURL('/css/deviceDataCollection.css')}">
22
<div id="deviceDataCollection">
3-
<h1 id="paymentprocessingmessage">
3+
<h2 id="paymentprocessingmessage">
44
${Resource.msg('processing.payment', 'payments', null)}
5-
</h1>
5+
</h2>
66
<form id="collectionForm" name="devicedata" target="paFrame" method="POST" action="${pdict.deviceDataUrl}">
77
<input type="hidden" id="bin" name="Bin" value="${pdict.cardNumber}" />
88
<input type="hidden" name="JWT" value="${pdict.jwtToken}" />
99
</form>
1010
<iframe scrolling="no" id="paFrame" name="paFrame" src=""></iframe>
11+
12+
<form class="payerAuthRedirect" action="${pdict.action}" method="POST" name="payerAuthRedirect"
13+
target="_parent">
14+
<input type="hidden" name="MD" value="${pdict.orderNo}" />
15+
</form>
16+
1117
<script src="${URLUtils.staticURL('/js/deviceDataCollection.js')}" type="text/javascript"></script>
12-
</div>
18+
19+
</div>
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
1-
<iscomment> <isdecorate template="common/layout/checkout"> </iscomment>
1+
<iscomment>
2+
<isdecorate template="common/layout/checkout">
3+
</iscomment>
24
<iscontent type="text/html" charset="UTF-8" compact="true">
3-
5+
<iscomment> <style>
6+
.iframe-stepUp {
7+
display: flex;
8+
justify-content: center;
9+
}
10+
</style> </iscomment>
411

512
<iscomment> target="myStepUpFrame" </iscomment>
6-
<form id="stepUpForm" name="stepup" method="POST" action="${pdict.stepUpUrl}">
7-
13+
<form id="stepUpForm" name="stepup" target="myStepUpFrame" method="POST" action="${pdict.stepUpUrl}">
814
<input type="hidden" name="JWT" value="${pdict.jwtToken}" />
15+
</form>
16+
<iscomment>
17+
<div class="iframe-stepUp">
18+
<iframe name="myStepUpFrame" height="600" width="400"></iframe>
19+
</div>
20+
</iscomment>
21+
22+
<iframe width="100%" height="100%" scrolling="auto" name="myStepUpFrame"> </iframe>
923

10-
</form>
11-
<iscomment> <iFrame width="100%" height="100%" scrolling="auto" name="myStepUpFrame"> </iscomment>
12-
<iscomment> </iFrame> </iscomment>
1324
<script>window.onload = function() {
1425
// Auto submit form on page load
15-
16-
document.getElementById('stepUpForm').submit();
17-
}
18-
</script>
26+
document.getElementById('stepUpForm').submit();
27+
}
28+
</script>
1929

2030
</iscontent>
21-
<iscomment> </isdecorate> </iscomment>
31+
<iscomment>
32+
</isdecorate>
33+
</iscomment>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!--- TEMPLATENAME: Redirect.isml --->
2+
<iscomment>
3+
This template the use to redirect
4+
</iscomment>
5+
<link rel="stylesheet" href="${URLUtils.staticURL('/css/deviceDataCollection.css')}">
6+
<iscomment> <script src="${URLUtils.staticURL('/custom/lib/jquery/jquery-3.5.1.min.js')}" type="text/javascript"></script> </iscomment>
7+
<form id="ScaRedirect" action="${URLUtils.url('CheckoutServices-PlaceOrder')}" method="POST" name="ScaRedirect" target="_parent">
8+
<input type="hidden" name="orderID" value="${pdict.orderID}"/>
9+
</form>
10+
11+
<iscomment> <script src="${URLUtils.staticURL('/js/scaRedirect.js')}" type="text/javascript"></script> </iscomment>
12+
13+
<script type="text/javascript">
14+
window.onload = function () {
15+
// Auto submit form on page load
16+
document.getElementById('ScaRedirect').submit();
17+
};</script>

cartridges/int_cybs_sfra_base/cartridge/apiClient/ApiClient.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ var MessageDigest = require('dw/crypto/MessageDigest');
66

77
var MerchantConfig = require('./merchantConfig');
88
var Logger = require('./logger');
9-
var PaymentsHttpService = dw.svc.LocalServiceRegistry.createService("PaymentHttpService", {
9+
10+
var _exports = function () {}
11+
12+
_exports.prototype.createService = function (){
13+
var PaymentsHttpService = dw.svc.LocalServiceRegistry.createService("PaymentHttpService", {
1014
createRequest: function (svc, url, headers, method, requestBody) {
1115
var keys = Object.keys(headers);
1216
var StringHeaders = "";
@@ -32,12 +36,12 @@ var PaymentsHttpService = dw.svc.LocalServiceRegistry.createService("PaymentHttp
3236
return msg;
3337
}
3438
});
35-
36-
var _exports = function () {}
39+
return PaymentsHttpService;
40+
};
3741

3842
_exports.prototype.setConfiguration = function (configObject) {
3943
this.merchantConfig = new MerchantConfig(configObject);
40-
this.basePath = PaymentsHttpService.configuration.credential.getURL();
44+
this.basePath = this.createService().configuration.credential.getURL();
4145
this.logger = Logger.getLogger(this);
4246
};
4347

@@ -234,9 +238,9 @@ _exports.prototype.callApi = function (path, httpMethod, pathParams, queryParams
234238

235239
// Calling service.
236240
if (method === 'post' || method === 'patch') {
237-
var response = PaymentsHttpService.call(url, normalizedHeaders, method, payload);
241+
var response = this.createService().call(url, normalizedHeaders, method, payload);
238242
} else {
239-
var response = PaymentsHttpService.call(url, normalizedHeaders, method);
243+
var response = this.createService().call(url, normalizedHeaders, method);
240244
}
241245

242246
if (response.ok) {

cartridges/int_cybs_sfra_base/cartridge/configuration/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var LogfileMaxSize = '5242880'; // 10 MB In Bytes
2323
* Send this value in all requests that are sent through the partner solution. CyberSource assigns the ID to the partner.
2424
* Note When you see a partner ID of 999 in reports, the partner ID that was submitted is incorrect.
2525
*/
26-
var SolutionId = 'J3P4XU2P';
26+
var SolutionId = 'QBZT2URS';
2727

2828
var CruiseDDCEndPoint = {
2929
Stage: 'https://centinelapistag.cardinalcommerce.com/V1/Cruise/Collect',
@@ -76,6 +76,7 @@ function getConfig(config) {
7676
tokenizationPaymentInstrumentAllowedInInterval: config.tokenizationPaymentInstrumentAllowedInInterval || customPreferences.Tokenization.Preferences.PaymentInstrumentAllowedInInterval.getValue(),
7777
tokenizationResetIntervalInHours: config.tokenizationResetIntervalInHours || customPreferences.Tokenization.Preferences.ResetIntervalInHours.getValue(),
7878
tokenizationLimitSavedCardEnabled: config.tokenizationLimitSavedCardEnabled || customPreferences.Tokenization.Preferences.LimitSavedCardEnabled.getValue(),
79+
networkTokenizationEnabled: config.networkTokenizationEnabled || customPreferences.Tokenization.Preferences.NetworkTokenUpdates.getValue(),
7980

8081
// Tax configuration
8182
taxServiceEnabled: config.taxServiceEnabled || customPreferences.TaxConfiguration.Preferences.TaxCalculationEnabled.getValue(),

cartridges/int_cybs_sfra_base/cartridge/configuration/preferences/customPreferences.js

+17-40
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,17 @@ module.exports = {
331331
}
332332
},
333333
/** @type {CustomPreference} */
334+
NetworkTokenUpdates: {
335+
id: 'Cybersource_NetworkToken',
336+
display_name: 'Network Token Updates',
337+
description: 'Subscribe to Network Token life cycle updates',
338+
type: Types.boolean,
339+
default: false,
340+
flags: {
341+
mandatory: false
342+
}
343+
},
344+
/** @type {CustomPreference} */
334345
LimitSavedCardEnabled: {
335346
id: 'Cybersource_LimitSavedCardEnabled',
336347
display_name: 'Enable limiting Saved Card',
@@ -481,46 +492,12 @@ module.exports = {
481492
}
482493
},
483494
/** @type {CustomPreference} */
484-
CruiseAPIKey: {
485-
id: 'Cybersource_CruiseApiKey',
486-
display_name: 'Cruise API Key',
487-
description: 'A shared secret value between the merchant and Payer Authentication system. This value should never be exposed to the public',
488-
type: Types.Password,
489-
default: undefined,
490-
flags: {
491-
mandatory: false
492-
}
493-
},
494-
/** @type {CustomPreference} */
495-
CruiseOrgUnitID: {
496-
id: 'Cybersource_CruiseOrgUnitId',
497-
display_name: 'Cruise Org Unit Id',
498-
description: 'GUID to identify the merchant organization within Payer Authentication systems',
499-
type: Types.string,
500-
default: undefined,
501-
flags: {
502-
mandatory: false
503-
}
504-
},
505-
506-
/** @type {CustomPreference} */
507-
CruiseAPIIdentifier: {
508-
id: 'Cybersource_CruiseApiIdentifier',
509-
display_name: 'Cruise API Identifier',
510-
description: 'GUID used to identify the specific API Key',
511-
type: Types.string,
512-
default: undefined,
513-
flags: {
514-
mandatory: false
515-
}
516-
},
517-
/** @type {CustomPreference} */
518-
CruiseEndPoint: {
519-
id: 'Cybersource_CruiseEndPoint',
520-
display_name: 'Cruise End Point',
521-
description: 'Environment details of Cruise API',
522-
type: Types.EnumOfString,
523-
default: 'Stage',
495+
EnableSCA: {
496+
id: 'Cybersource_IsSCAEnabled',
497+
display_name: 'Enable SCA',
498+
description: 'Enable or Disable Strong Customer Authentication',
499+
type: Types.boolean,
500+
default: false,
524501
flags: {
525502
mandatory: false
526503
}

cartridges/int_cybs_sfra_base/cartridge/controllers/Checkout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ server.prepend(
2323
res.redirectUrl = URLUtils.url('Checkout-Begin').toString() + '?stage=payment';
2424
return next();
2525
}
26-
26+
session.custom.Flag3ds = false;
2727
// eslint-disable-next-line no-undef
2828
if (session.getCustomer().getProfile() !== null) {
2929
// eslint-disable-next-line no-undef

0 commit comments

Comments
 (0)