diff --git a/src/cartridges/int_adyen_SFRA/cartridge/adyen/webhooks/__tests__/notify.test.js b/src/cartridges/int_adyen_SFRA/cartridge/adyen/webhooks/__tests__/notify.test.js index ff25b2ade..0d67e310b 100644 --- a/src/cartridges/int_adyen_SFRA/cartridge/adyen/webhooks/__tests__/notify.test.js +++ b/src/cartridges/int_adyen_SFRA/cartridge/adyen/webhooks/__tests__/notify.test.js @@ -9,7 +9,7 @@ beforeEach(() => { notify = adyen.notify; jest.clearAllMocks(); req = {}; - res = { render: jest.fn() }; + res = { render: jest.fn(), status: jest.fn(() => res)}; }); afterEach(() => { diff --git a/src/cartridges/int_adyen_SFRA/cartridge/adyen/webhooks/notify.js b/src/cartridges/int_adyen_SFRA/cartridge/adyen/webhooks/notify.js index 984811f46..1f45168e6 100644 --- a/src/cartridges/int_adyen_SFRA/cartridge/adyen/webhooks/notify.js +++ b/src/cartridges/int_adyen_SFRA/cartridge/adyen/webhooks/notify.js @@ -19,7 +19,7 @@ function notify(req, res, next) { const hmacKey = AdyenConfigs.getAdyenHmacKey(); const isHmacValid = handleHmacVerification(hmacKey, req); if (!status || !isHmacValid) { - res.render('/adyen/error'); + res.status(403).render('/adyen/error'); return {}; } Transaction.begin(); @@ -28,7 +28,7 @@ function notify(req, res, next) { Transaction.commit(); res.render('/notify'); } else { - res.render('/notifyError', { + res.status(403).render('/notifyError', { errorMessage: notificationResult.errorMessage, }); Transaction.rollback();