Skip to content

Commit

Permalink
Merge pull request #1152 from Adyen/release/22.2.4
Browse files Browse the repository at this point in the history
Release/22.2.4
  • Loading branch information
amihajlovski authored Aug 28, 2024
2 parents fecddbb + 27e1d00 commit 79269b9
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 6 deletions.
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(),
});
};
8 changes: 7 additions & 1 deletion src/cartridges/int_adyen_SFRA/cartridge/controllers/Adyen.js
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',
};

0 comments on commit 79269b9

Please sign in to comment.