You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per OOB Adyen cartridge code - print() function is used to render this domain association file content is sfcc and print() removes / trim the ending line ending. So the domain verification fails.
On changing print() to println() the line endings are retained and executing cksum and xxd commands for website URL and comparing with https://eu.adyen.link/.well-known/apple-developer-merchantid-domain-association returns same cksum and xxd value
var server = require('server'); var URLRedirectMgr = require('dw/web/URLRedirectMgr'); var AdyenConfigs = require('*/cartridge/scripts/util/adyenConfigs'); var constants = require('../client/default/js/constants'); server.extend(module.superModule); server.prepend('Start', function (req, res, next) { var origin = URLRedirectMgr.redirectOrigin; // Intercept the incoming path request if (origin.match(constants.APPLE_DOMAIN_URL)) { var applePayDomainAssociation = AdyenConfigs.getApplePayDomainAssociation(); response.getWriter().print(applePayDomainAssociation); return null; } return next(); }); module.exports = server.exports();
Changed code - var server = require('server'); var URLRedirectMgr = require('dw/web/URLRedirectMgr'); var AdyenConfigs = require('*/cartridge/scripts/util/adyenConfigs'); var constants = require('../client/default/js/constants'); server.extend(module.superModule); server.prepend('Start', function (req, res, next) { var origin = URLRedirectMgr.redirectOrigin; // Intercept the incoming path request if (origin.match(constants.APPLE_DOMAIN_URL)) { var applePayDomainAssociation = AdyenConfigs.getApplePayDomainAssociation(); res.setHttpHeader(dw.system.Response.CONTENT_TYPE, 'text/plain'); response.getWriter().println(applePayDomainAssociation); return null; } return next(); }); module.exports = server.exports();
In Adyen SFRA v23.2.1 cartridge, for applepay domain verification, the applepay domain association file content has to be stored in site peference - Adyen_ApplePay_DomainAssociation
The applepay domain association file provided in the Adyen documentation (https://docs.adyen.com/plugins/salesforce-commerce-cloud/set-up-payment-methods/?tab=use_adyen_s_apple_pay_certificate_1#step-5-go-live-with-apple-pay) has a line ending with blank space/blank line
As per OOB Adyen cartridge code - print() function is used to render this domain association file content is sfcc and print() removes / trim the ending line ending. So the domain verification fails.
On changing print() to println() the line endings are retained and executing cksum and xxd commands for website URL and comparing with https://eu.adyen.link/.well-known/apple-developer-merchantid-domain-association returns same cksum and xxd value
Changes-
var server = require('server'); var URLRedirectMgr = require('dw/web/URLRedirectMgr'); var AdyenConfigs = require('*/cartridge/scripts/util/adyenConfigs'); var constants = require('../client/default/js/constants'); server.extend(module.superModule); server.prepend('Start', function (req, res, next) { var origin = URLRedirectMgr.redirectOrigin; // Intercept the incoming path request if (origin.match(constants.APPLE_DOMAIN_URL)) { var applePayDomainAssociation = AdyenConfigs.getApplePayDomainAssociation(); response.getWriter().print(applePayDomainAssociation); return null; } return next(); }); module.exports = server.exports();
Changed code -
var server = require('server'); var URLRedirectMgr = require('dw/web/URLRedirectMgr'); var AdyenConfigs = require('*/cartridge/scripts/util/adyenConfigs'); var constants = require('../client/default/js/constants'); server.extend(module.superModule); server.prepend('Start', function (req, res, next) { var origin = URLRedirectMgr.redirectOrigin; // Intercept the incoming path request if (origin.match(constants.APPLE_DOMAIN_URL)) { var applePayDomainAssociation = AdyenConfigs.getApplePayDomainAssociation(); res.setHttpHeader(dw.system.Response.CONTENT_TYPE, 'text/plain'); response.getWriter().println(applePayDomainAssociation); return null; } return next(); }); module.exports = server.exports();
File path: int_adyen_SFRA/cartridge/controllers/RedirectURL.js
Is it possible to fix this and provide a patch?
The text was updated successfully, but these errors were encountered: