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

Rendering the confirm form if order is already processed #1052

Merged
merged 2 commits into from
Feb 26, 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
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ describe('Show Confirmation', () => {
})

it('should not continue processing when order is not open or failed', () => {
const URLUtils = require('dw/web/URLUtils');
const adyenCheckout = require('*/cartridge/scripts/adyenCheckout');
req.querystring.merchantReference = 4;
const adyenHelper = require('*/cartridge/scripts/util/adyenHelper');
adyenHelper.getOrderMainPaymentInstrumentType.mockReturnValue('AdyenComponent');
showConfirmation(req, res, jest.fn());
expect(URLUtils.url.mock.calls[0][0]).toEqual('Cart-Show');
expect(res.render.mock.calls[0][0]).toEqual('orderConfirmForm');
expect(adyenCheckout.doPaymentsDetailsCall).not.toBeCalled();
})

test.each(['Authorised', 'Pending', 'Received'])(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ function showConfirmation(req, res, next) {
AdyenLogs.info_log(
'ShowConfirmation called for an order which has already been processed. This is likely to be caused by shoppers using the back button after order confirmation',
);
res.redirect(URLUtils.url('Cart-Show'));
res.render('orderConfirmForm', {
orderID: order.orderNo,
orderToken: order.orderToken,
});
return next();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/playwright/fixtures/countriesEUR/FR.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ test.describe.parallel(`${environment.name} EUR FR`, () => {
await checkoutPage.expectSuccess();
});

test('Amazon Pay Express @quick', async ({ page }) => {
test.skip('Amazon Pay Express @quick', async ({ page }) => {
redirectShopper = new RedirectShopper(page);
await checkoutPage.addProductToCart();
await checkoutPage.navigateToCart(regionsEnum.EU);
Expand Down
Loading