Skip to content

Commit

Permalink
Merge pull request #973 from Adyen/release/23.3.0
Browse files Browse the repository at this point in the history
Release/23.3.0
  • Loading branch information
amihajlovski authored Oct 4, 2023
2 parents 0c4b104 + a94d92e commit 6d0e22c
Show file tree
Hide file tree
Showing 83 changed files with 875 additions and 280 deletions.
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,9 @@ After Level 3 End-of-support date, there is no support or maintenance from Adyen

[Migration and Upgrade Guide](https://docs.adyen.com/plugins/salesforce-commerce-cloud/upgrade)

| Major version | Release date | Level 1 support until | Level 2 support until | Level 3 support until |
|---------------|--------------|-----------------------|-----------------------|-----------------------|
| V18 | April 2018 | 30 September 2023 | 30 September 2023 | 30 September 2023 |
| V19 | July 2019 | 30 September 2023 | 30 September 2023 | 30 September 2023 |
| V20 | July 2020 | 31 December 2023 | 31 December 2023 | 31 December 2023 |
| V21 | August 2021 | 31 December 2023 | 31 December 2023 | 31 December 2023 |
| V22 | May 2022 | 30 November 2023 | 31 May 2024 | 30 November 2024 |
| V23<sup id="fnref1">[[1]](#fn1)</sup><sup id="fnref2">[[2]](#fn2)</sup> | February 2023 | 12 months after release | 18 months after release| 24 months after release|
| V24 | soon in development | 12 months after release | 18 months after release| 24 months after release|

<span id="fn1">[1]:From this version onward, we do not provide any level of support for SiteGenesis integrations.</span>

<span id="fn2">[2]:From this version onward, all major releases will follow the V23 support schedule.</span>
[SFCC Cartridge Support Schedule for SFRA and SiteGenesis](https://docs.adyen.com/plugins/salesforce-commerce-cloud/#support-levels)

From version 23 onward, we do not provide any level of support for SiteGenesis integrations.

## Contributing
We strongly encourage you to join us in contributing to this repository so everyone can benefit from:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@
padding-left: 30px;
}

#hmacKey{
padding-left: 30px;
}

.line-divider{
padding-left: 48px;
padding-right: 51px;
Expand Down Expand Up @@ -405,6 +409,28 @@ ul{
margin-right: 48px;
}

.log-list{
margin-left: 17px;
margin-right: 48px;
}

.log-list > li {
border: 1px solid #ced4da;
color: #34444f;
height: 95px;
border-bottom: none;
padding-bottom: 110px;
}

.log-list > li .form-check-input{
margin-left: 23px;
}

.log-list .log-checkbox-fatal {
border-bottom: 1px solid #ced4da;
padding-bottom: 95px;
}

.draggable-list li {
background-color: #fff;
display: flex;
Expand Down
3 changes: 3 additions & 0 deletions cartridges/bm_adyen/cartridge/static/default/icons/tools.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions cartridges/bm_adyen/cartridge/static/default/js/adyenSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,25 @@ const expressPaymentMethods = [{
}];
document.addEventListener('DOMContentLoaded', () => {
const form = document.querySelector('#settingsForm');
const troubleshootingForm = document.querySelector('#troubleshootingForm');
const submitButton = document.querySelector('#settingsFormSubmitButton');
const cancelButton = document.querySelector('#settingsFormCancelButton');
const formButtons = Array.from(document.getElementsByClassName('formButton'));
const testConnectionButton = document.querySelector('#testConnectionButton');
const togglePassword = document.querySelector('#togglePassword');
const toggleHmacKey = document.querySelector('#toggleHmacKey');
const toggleApi = document.querySelector('#toggleApi');
const formBody = document.querySelector('#formBody');
const password = document.querySelector('#notificationsPassword');
const hmacKey = document.querySelector('#hmacKey');
const merchAccount = document.getElementById('merchantAccount');
const classicPageButton = document.querySelector('#classicButton');
const debugLogCheckbox = document.getElementById('debugLogs');
const infoLogCheckbox = document.getElementById('infoLogs');
const errorLogCheckbox = document.getElementById('errorLogs');
const fatalLogCheckbox = document.getElementById('fatalLogs');
const troubleshootingCheckboxes = [debugLogCheckbox, infoLogCheckbox, errorLogCheckbox, fatalLogCheckbox];
const downloadLogsButton = document.getElementById('downloadLogsButton');
const apiKeyVal = document.getElementById('apiKey');
const changedSettings = [];
const isValid = 'is-valid';
Expand Down Expand Up @@ -138,6 +147,12 @@ document.addEventListener('DOMContentLoaded', () => {
function getLink() {
window.open(window.classicConfigPageUrl);
}
function downloadFile(filePath) {
const link = document.createElement('a');
link.href = filePath;
link.download = filePath.substr(filePath.lastIndexOf('/') + 1);
link.click();
}
function enableformButtons() {
formButtons.forEach(button => {
button.classList.remove('disabled');
Expand Down Expand Up @@ -178,6 +193,11 @@ document.addEventListener('DOMContentLoaded', () => {
apiKeyVal.setAttribute('type', type);
this.classList.toggle('bi-eye');
}
function showHmacKey() {
const type = hmacKey.getAttribute('type') === 'password' ? 'text' : 'password';
hmacKey.setAttribute('type', type);
this.classList.toggle('bi-eye');
}

// open Adyen Giving Background upload page
function uploadAdyenGivingBackground() {
Expand Down Expand Up @@ -232,13 +252,43 @@ document.addEventListener('DOMContentLoaded', () => {
submitButton.addEventListener('click', showAlertsOnSave);
window.addEventListener('load', checkBrowserSupport);
togglePassword.addEventListener('click', showPassword);
toggleHmacKey.addEventListener('click', showHmacKey);
toggleApi.addEventListener('click', showApiKey);
adyenGivingBackground.addEventListener('click', uploadAdyenGivingBackground);
adyenGivingLogo.addEventListener('click', uploadAdyenGivingLogo);
window.addEventListener('load', printBackgroundImageName);
window.addEventListener('load', printLogoImageName);
adyenGivingBackground.addEventListener('click', saveAndHideAlerts);
adyenGivingLogo.addEventListener('click', saveAndHideAlerts);
troubleshootingForm.addEventListener('input', () => {
downloadLogsButton.classList.add('disabled');
troubleshootingCheckboxes.forEach(checkbox => {
if (checkbox.checked) {
downloadLogsButton.classList.remove('disabled');
downloadLogsButton.classList.add('enabled');
}
});
});
downloadLogsButton.addEventListener('click', () => {
(async () => {
const htmlContent = await (await fetch(window.logCenterUrl)).text();
const doc = new DOMParser().parseFromString(htmlContent, 'text/html');
const logLocations = Array.from(doc.body.getElementsByTagName('a')).map(log => log.href);
const logsToDownload = [];
troubleshootingCheckboxes.forEach(checkbox => {
if (checkbox.checked) {
// eslint-disable-next-line
logsToDownload.push(logLocations.filter(name => name.includes(`custom-Adyen_${checkbox.value}`)));
}
});
const selectedLogs = Array.prototype.concat.apply([], logsToDownload);
selectedLogs.forEach(item => downloadFile(item));
downloadLogsButton.classList.add('disabled');
troubleshootingCheckboxes.forEach(checkbox => {
checkbox.checked = false;
});
})();
});

// add event listener to maintain form updates
form.addEventListener('change', event => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@
<img src="${URLUtils.staticURL('icons/settings.svg')}" width="20" height="20" class="rounded float-start mr-3"/>
Additional settings
</a>
<a class="list-group-item navigation-item border-0" href="#troubleshooting">
<img src="${URLUtils.staticURL('icons/tools.svg')}" width="20" height="20" class="rounded float-start mr-3"/>
Troubleshooting
</a>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@
</div>
</div>
<div class="form-group border-top mt-4">
<label class="form-title mt-4" for="applePayTokenisation">Apple Pay Tokenisation</label>
<label class="form-title mt-4" for="adyenTokenisation">Tokenisation</label>
<small id="applePayHelp" class="form-text mb-1">
To tokenize payment details for Apple Pay, make sure you have enabled Apple Pay in Adyen Customer Area.
To tokenize payment details for all payment methods, make sure you have this feature enabled.
</small>
<div class="radio-buttons">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="AdyenApplePayTokenisationEnabled" id="ApplePayTokenisationYes" value=true ${AdyenConfigs.getAdyenApplePayTokenisationEnabled() ? 'checked': ''}>
<label class="form-check-label" for="ApplePayTokenisationYes">Enable</label>
<input class="form-check-input" type="radio" name="AdyenTokenisationEnabled" id="AdyenTokenisationYes" value=true ${AdyenConfigs.getAdyenTokenisationEnabled() ? 'checked': ''}>
<label class="form-check-label" for="AdyenTokenisationYes">Enable</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="AdyenApplePayTokenisationEnabled" id="ApplePayTokenisationNo" value=false ${!AdyenConfigs.getAdyenApplePayTokenisationEnabled() ? 'checked': ''}>
<label class="form-check-label" for="ApplePayTokenisationNo">Disable</label>
<input class="form-check-input" type="radio" name="AdyenTokenisationEnabled" id="AdyenTokenisationNo" value=false ${!AdyenConfigs.getAdyenTokenisationEnabled() ? 'checked': ''}>
<label class="form-check-label" for="AdyenTokenisationNo">Disable</label>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<iscontent type="text/html" charset="UTF-8" compact="true">
<isset name="AdyenConfigs" value="${require('*/cartridge/scripts/util/adyenConfigs')}" scope="page"/>
<div id="troubleshooting" class="card bg-white mt-4">
<div class="card-body">
<h5 class="card-title mb-0">
Troubleshooting <small class="text-secondary"></small>
</h5>
<h7 class="card-subtitle">
<div class="first-subtitle">You can download Adyen Logs from here.</div>
</h7>
<div class="mt-2">
<div class="form-group">
<label class="form-title mb-0" for="logsDownload">Download Logs</label>
<small id="logsDownloadHelp" class="form-text mb-1">
The logs are generated from the last 14 days. The downloaded files don’t include visuals, just text.
</small>
<div class="checkboxes">
<div class="form-group">
<ul class="log-list">
<li class='log-checkbox-debug'>
<label class="form-title mt-4" for="debugLogs">Debug Log</label>
<input class="form-check-input" type="checkbox" name="AdyenDebugLogs" id="debugLogs" value="debug">
<small id="debugLogsHelp" class="form-text mb-1">
For checking order data, order create date delay, current date, and service config calls to Adyen Checkout API.
</small>
</li>
<li class='log-checkbox-info'>
<label class="form-title mt-4" for="infoLogs">Info Log</label>
<input class="form-check-input" type="checkbox" name="AdyenInfoLogs" id="infoLogs" value="info">
<small id="infoLogsHelp" class="form-text mb-1">
For informational messages about payment results, webhooks processing, authorization, and order updates.
</small>
</li>
<li class='log-checkbox-error'>
<label class="form-title mt-4" for="errorLogs">Error Log</label>
<input class="form-check-input" type="checkbox" name="AdyenErrorLogs" id="errorLogs" value="error">
<small id="errorLogsHelp" class="form-text mb-1">
For errors related to configuration, payment, order processing, card details, and components.
</small>
</li>
<li class='log-checkbox-fatal'>
<label class="form-title mt-4" for="fatalLogs">Fatal Log</label>
<input class="form-check-input" type="checkbox" name="AdyenFatalLogs" id="fatalLogs" value="fatal">
<small id="fatalLogsHelp" class="form-text mb-1">
For severe errors preventing the cartridge from functioning properly.
</small>
</li>
</ul>
</div>
</div>
<div class="d-grid gap-2 d-md-flex justify-content-md-end form-buttons">
<button type="button" id="downloadLogsButton" class="btn btn-primary border disabled formButton">Download</button>
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
placeholder="•••••••••••••••" value="${AdyenConfigs.getAdyenNotificationPassword()}">
</div>
</div>
<div class="form-group">
<label class="form-title mb-0" for="hmacKey">HMAC Key (Optional)</label>
<small id="hmacKeyHelp" class="form-text mb-1">This is the HMAC key you created under the Developers section in the Customer Area.</small>
<span>
<i class="bi bi-eye-slash" id="toggleHmacKey"></i>
</span>
<div class="input-fields">
<input type="password" class="form-control" name="Adyen_Hmac_Key" id="hmacKey"
aria-describedby="hmacKeyHelp" placeholder=""
value="${AdyenConfigs.getAdyenHmacKey() || ''}">
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
const backgroundImageStorage = "!id!c_AdyenGiving_backgroundUrl!instance_type!sandbox!group_id!Adyen";
const logoImageStorage = "!id!c_AdyenGiving_logoUrl!instance_type!sandbox!group_id!Adyen";
window.classicConfigPageUrl = token +"#" + commonPath + classicPagePath + classicPageSubpath;
window.logCenterUrl = "/on/demandware.servlet/webdav/Sites/Logs";
</script>
</head>
<header class="header row bg-white mt-4 mb-4">
Expand Down Expand Up @@ -60,6 +61,9 @@
<isinclude template="adyenSettings/settingCards/adyenGivingSettings"/>
<isinclude template="adyenSettings/settingCards/optionalSettings"/>
</form>
<form id="troubleshootingForm">
<isinclude template="adyenSettings/settingCards/troubleshooting.isml"/>
</form>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ function getAmounts() {
var donationConfig = {
amounts: getAmounts(),
backgroundUrl: adyenGivingBackgroundUrl,
description: charityDescription,
description: decodeURI(charityDescription),
logoUrl: adyenGivingLogoUrl,
name: charityName,
name: decodeURI(charityName),
url: charityWebsite,
showCancelButton: true,
onDonate: handleOnDonate,
Expand Down
Loading

0 comments on commit 6d0e22c

Please sign in to comment.