diff --git a/README.md b/README.md index 507ad9ca2..3660a24cb 100755 --- a/README.md +++ b/README.md @@ -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[[1]](#fn1)[[2]](#fn2) | 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| - -[1]:From this version onward, we do not provide any level of support for SiteGenesis integrations. - -[2]:From this version onward, all major releases will follow the V23 support schedule. +[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: diff --git a/cartridges/bm_adyen/cartridge/static/default/css/configurationSettings.css b/cartridges/bm_adyen/cartridge/static/default/css/configurationSettings.css index 90898a672..156893734 100644 --- a/cartridges/bm_adyen/cartridge/static/default/css/configurationSettings.css +++ b/cartridges/bm_adyen/cartridge/static/default/css/configurationSettings.css @@ -168,6 +168,10 @@ padding-left: 30px; } +#hmacKey{ + padding-left: 30px; +} + .line-divider{ padding-left: 48px; padding-right: 51px; @@ -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; diff --git a/cartridges/bm_adyen/cartridge/static/default/icons/tools.svg b/cartridges/bm_adyen/cartridge/static/default/icons/tools.svg new file mode 100644 index 000000000..999e4da9c --- /dev/null +++ b/cartridges/bm_adyen/cartridge/static/default/icons/tools.svg @@ -0,0 +1,3 @@ + diff --git a/cartridges/bm_adyen/cartridge/static/default/js/adyenSettings.js b/cartridges/bm_adyen/cartridge/static/default/js/adyenSettings.js index 5af817b6b..e5a76e67c 100644 --- a/cartridges/bm_adyen/cartridge/static/default/js/adyenSettings.js +++ b/cartridges/bm_adyen/cartridge/static/default/js/adyenSettings.js @@ -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'; @@ -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'); @@ -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() { @@ -232,6 +252,7 @@ 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); @@ -239,6 +260,35 @@ document.addEventListener('DOMContentLoaded', () => { 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 => { diff --git a/cartridges/bm_adyen/cartridge/templates/default/adyenSettings/navigationCard.isml b/cartridges/bm_adyen/cartridge/templates/default/adyenSettings/navigationCard.isml index 211f9f51c..345074b60 100644 --- a/cartridges/bm_adyen/cartridge/templates/default/adyenSettings/navigationCard.isml +++ b/cartridges/bm_adyen/cartridge/templates/default/adyenSettings/navigationCard.isml @@ -34,5 +34,9 @@ Additional settings + + + Troubleshooting + diff --git a/cartridges/bm_adyen/cartridge/templates/default/adyenSettings/settingCards/optionalSettings.isml b/cartridges/bm_adyen/cartridge/templates/default/adyenSettings/settingCards/optionalSettings.isml index f66005ac7..16cced87e 100644 --- a/cartridges/bm_adyen/cartridge/templates/default/adyenSettings/settingCards/optionalSettings.isml +++ b/cartridges/bm_adyen/cartridge/templates/default/adyenSettings/settingCards/optionalSettings.isml @@ -51,18 +51,18 @@