Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/22.2.4 #1152

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "int_adyen_SFRA",
"version": "22.2.3",
"version": "22.2.4",
"description": "Adyen's official cartridge for SFRA and controllers-based SiteGenesis",
"main": "index.js",
"paths": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module.exports.onBrand = function onBrand(brandObject) {
*/
module.exports.createSession = async function createSession() {
return $.ajax({
url: 'Adyen-Sessions',
type: 'get',
url: window.sessionsUrl,
type: 'post',
data: $('#adyen-sessions-token').serialize(),
});
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const server = require('server');
const consentTracking = require('*/cartridge/scripts/middleware/consentTracking');
const csrf = require('*/cartridge/scripts/middleware/csrf');
const adyenGiving = require('*/cartridge/scripts/adyenGiving');
const { adyen } = require('*/cartridge/controllers/middlewares/index');

Expand All @@ -20,7 +21,12 @@ server.post(
adyen.paymentsDetails,
);

server.get('Sessions', server.middleware.https, adyen.callCreateSession);
server.post(
'Sessions',
server.middleware.https,
csrf.validateRequest,
adyen.callCreateSession,
);

/**
* Redirect to Adyen after 3DS1 Authentication When adding a card to an account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@
</div>
<isinclude template="adyenActionModal" />
<iscomment> ### Custom Adyen cartridge end ### </iscomment>
<input type="hidden" id="adyen-sessions-token" name="${pdict.csrf.tokenName}" value="${pdict.csrf.token}"/>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
window.paymentsDetailsURL = "${URLUtils.https('Adyen-PaymentsDetails')}";
window.ShowConfirmationPaymentFromComponent = "${ShowConfirmationPaymentFromComponent}";
window.AdyenSFRA6Enabled = '${pdict.adyen.SFRA6Enabled}';
window.sessionsUrl = "${URLUtils.https('Adyen-Sessions')}";

window.remainingAmountGiftCardResource = "${Resource.msg('remainingAmount.giftCard', 'adyen', null)}";
window.discountedAmountGiftCardResource = "${Resource.msg('discountedAmount.giftCard', 'adyen', null)}";
Expand Down Expand Up @@ -107,3 +108,4 @@

</iselse>
</isif>
<input type="hidden" id="adyen-sessions-token" name="${pdict.csrf.tokenName}" value="${pdict.csrf.token}"/>
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,4 @@
</script>
</iselse>
</isif>
<input type="hidden" id="adyen-sessions-token" name="${pdict.csrf.tokenName}" value="${pdict.csrf.token}"/>
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ module.exports = {
CHECKOUT_ENVIRONMENT_LIVE_IN: 'live-in',

CHECKOUT_COMPONENT_VERSION: '5.28.0',
VERSION: '22.2.2',
VERSION: '22.2.4',
};
Loading