Skip to content

Commit

Permalink
Merge pull request #5 from cybersource-tpi/v24.2.0
Browse files Browse the repository at this point in the history
V24.2.0
  • Loading branch information
cybersource-tpi authored Apr 17, 2024
2 parents b591488 + c5da658 commit 4406e5d
Show file tree
Hide file tree
Showing 27 changed files with 932 additions and 370 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

* **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)
* **Categories:** Payment Processing, Fraud Detection, Address Validation, Tax Computation
* **Version:** 24.1.0
* **Last Certification Date:** February-2024
* **Version:** 24.2.0
* **Last Certification Date:** April-2024
* **Supports SFRA v6.3.0**
* **JavaScript Controllers Friendly:** **YES**

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

----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@ window.onload = function () {
// Auto submit form on page load
document.getElementById('collectionForm').submit();
};

window.addEventListener('message', function(event) {
if (event.origin === 'https://centinelapistag.cardinalcommerce.com' || event.origin === 'https://centinelapi.cardinalcommerce.com') {
console.log(event.data);
document.payerAuthRedirect.submit();
}
}, false);
setTimeout(function () {
document.payerAuthRedirect.submit();}, 10000);
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<link rel="stylesheet" href="${URLUtils.staticURL('/css/deviceDataCollection.css')}">
<div id="deviceDataCollection">
<h1 id="paymentprocessingmessage">
<h2 id="paymentprocessingmessage">
${Resource.msg('processing.payment', 'payments', null)}
</h1>
</h2>
<form id="collectionForm" name="devicedata" target="paFrame" method="POST" action="${pdict.deviceDataUrl}">
<input type="hidden" id="bin" name="Bin" value="${pdict.cardNumber}" />
<input type="hidden" name="JWT" value="${pdict.jwtToken}" />
</form>
<iframe scrolling="no" id="paFrame" name="paFrame" src=""></iframe>

<form class="payerAuthRedirect" action="${pdict.action}" method="POST" name="payerAuthRedirect"
target="_parent">
<input type="hidden" name="MD" value="${pdict.orderNo}" />
</form>

<script src="${URLUtils.staticURL('/js/deviceDataCollection.js')}" type="text/javascript"></script>
</div>

</div>
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
<iscomment> <isdecorate template="common/layout/checkout"> </iscomment>
<iscomment>
<isdecorate template="common/layout/checkout">
</iscomment>
<iscontent type="text/html" charset="UTF-8" compact="true">

<iscomment> <style>
.iframe-stepUp {
display: flex;
justify-content: center;
}
</style> </iscomment>

<iscomment> target="myStepUpFrame" </iscomment>
<form id="stepUpForm" name="stepup" method="POST" action="${pdict.stepUpUrl}">

<form id="stepUpForm" name="stepup" target="myStepUpFrame" method="POST" action="${pdict.stepUpUrl}">
<input type="hidden" name="JWT" value="${pdict.jwtToken}" />
</form>
<iscomment>
<div class="iframe-stepUp">
<iframe name="myStepUpFrame" height="600" width="400"></iframe>
</div>
</iscomment>

<iframe width="100%" height="100%" scrolling="auto" name="myStepUpFrame"> </iframe>

</form>
<iscomment> <iFrame width="100%" height="100%" scrolling="auto" name="myStepUpFrame"> </iscomment>
<iscomment> </iFrame> </iscomment>
<script>window.onload = function() {
// Auto submit form on page load

document.getElementById('stepUpForm').submit();
}
</script>
document.getElementById('stepUpForm').submit();
}
</script>

</iscontent>
<iscomment> </isdecorate> </iscomment>
<iscomment>
</isdecorate>
</iscomment>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--- TEMPLATENAME: Redirect.isml --->
<iscomment>
This template the use to redirect
</iscomment>
<link rel="stylesheet" href="${URLUtils.staticURL('/css/deviceDataCollection.css')}">
<iscomment> <script src="${URLUtils.staticURL('/custom/lib/jquery/jquery-3.5.1.min.js')}" type="text/javascript"></script> </iscomment>
<form id="ScaRedirect" action="${URLUtils.url('CheckoutServices-PlaceOrder')}" method="POST" name="ScaRedirect" target="_parent">
<input type="hidden" name="orderID" value="${pdict.orderID}"/>
</form>

<iscomment> <script src="${URLUtils.staticURL('/js/scaRedirect.js')}" type="text/javascript"></script> </iscomment>

<script type="text/javascript">
window.onload = function () {
// Auto submit form on page load
document.getElementById('ScaRedirect').submit();
};</script>
16 changes: 10 additions & 6 deletions cartridges/int_cybs_sfra_base/cartridge/apiClient/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ var MessageDigest = require('dw/crypto/MessageDigest');

var MerchantConfig = require('./merchantConfig');
var Logger = require('./logger');
var PaymentsHttpService = dw.svc.LocalServiceRegistry.createService("PaymentHttpService", {

var _exports = function () {}

_exports.prototype.createService = function (){
var PaymentsHttpService = dw.svc.LocalServiceRegistry.createService("PaymentHttpService", {
createRequest: function (svc, url, headers, method, requestBody) {
var keys = Object.keys(headers);
var StringHeaders = "";
Expand All @@ -32,12 +36,12 @@ var PaymentsHttpService = dw.svc.LocalServiceRegistry.createService("PaymentHttp
return msg;
}
});

var _exports = function () {}
return PaymentsHttpService;
};

_exports.prototype.setConfiguration = function (configObject) {
this.merchantConfig = new MerchantConfig(configObject);
this.basePath = PaymentsHttpService.configuration.credential.getURL();
this.basePath = this.createService().configuration.credential.getURL();
this.logger = Logger.getLogger(this);
};

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

// Calling service.
if (method === 'post' || method === 'patch') {
var response = PaymentsHttpService.call(url, normalizedHeaders, method, payload);
var response = this.createService().call(url, normalizedHeaders, method, payload);
} else {
var response = PaymentsHttpService.call(url, normalizedHeaders, method);
var response = this.createService().call(url, normalizedHeaders, method);
}

if (response.ok) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var LogfileMaxSize = '5242880'; // 10 MB In Bytes
* Send this value in all requests that are sent through the partner solution. CyberSource assigns the ID to the partner.
* Note When you see a partner ID of 999 in reports, the partner ID that was submitted is incorrect.
*/
var SolutionId = 'J3P4XU2P';
var SolutionId = 'QBZT2URS';

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

// Tax configuration
taxServiceEnabled: config.taxServiceEnabled || customPreferences.TaxConfiguration.Preferences.TaxCalculationEnabled.getValue(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,17 @@ module.exports = {
}
},
/** @type {CustomPreference} */
NetworkTokenUpdates: {
id: 'Cybersource_NetworkToken',
display_name: 'Network Token Updates',
description: 'Subscribe to Network Token life cycle updates',
type: Types.boolean,
default: false,
flags: {
mandatory: false
}
},
/** @type {CustomPreference} */
LimitSavedCardEnabled: {
id: 'Cybersource_LimitSavedCardEnabled',
display_name: 'Enable limiting Saved Card',
Expand Down Expand Up @@ -481,46 +492,12 @@ module.exports = {
}
},
/** @type {CustomPreference} */
CruiseAPIKey: {
id: 'Cybersource_CruiseApiKey',
display_name: 'Cruise API Key',
description: 'A shared secret value between the merchant and Payer Authentication system. This value should never be exposed to the public',
type: Types.Password,
default: undefined,
flags: {
mandatory: false
}
},
/** @type {CustomPreference} */
CruiseOrgUnitID: {
id: 'Cybersource_CruiseOrgUnitId',
display_name: 'Cruise Org Unit Id',
description: 'GUID to identify the merchant organization within Payer Authentication systems',
type: Types.string,
default: undefined,
flags: {
mandatory: false
}
},

/** @type {CustomPreference} */
CruiseAPIIdentifier: {
id: 'Cybersource_CruiseApiIdentifier',
display_name: 'Cruise API Identifier',
description: 'GUID used to identify the specific API Key',
type: Types.string,
default: undefined,
flags: {
mandatory: false
}
},
/** @type {CustomPreference} */
CruiseEndPoint: {
id: 'Cybersource_CruiseEndPoint',
display_name: 'Cruise End Point',
description: 'Environment details of Cruise API',
type: Types.EnumOfString,
default: 'Stage',
EnableSCA: {
id: 'Cybersource_IsSCAEnabled',
display_name: 'Enable SCA',
description: 'Enable or Disable Strong Customer Authentication',
type: Types.boolean,
default: false,
flags: {
mandatory: false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ server.prepend(
res.redirectUrl = URLUtils.url('Checkout-Begin').toString() + '?stage=payment';
return next();
}

session.custom.Flag3ds = false;
// eslint-disable-next-line no-undef
if (session.getCustomer().getProfile() !== null) {
// eslint-disable-next-line no-undef
Expand Down
Loading

0 comments on commit 4406e5d

Please sign in to comment.