Skip to content

Commit

Permalink
On payment data changed (#1221)
Browse files Browse the repository at this point in the history
* feat: handle on payment data changed

* feat: redirect to confirmation page

* chore: remove log

* fix: tests for google pau

* fix: async promise lint error
  • Loading branch information
amihajlovski authored Dec 3, 2024
1 parent 42a02a1 commit ea8ecbc
Show file tree
Hide file tree
Showing 8 changed files with 225 additions and 406 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
handleApplePayResponse,
callPaymentFromComponent,
formatCustomerObject,
} = require('../../applePayExpressCommon');
} = require('../../applePayExpress');

beforeEach(() => {
jest.clearAllMocks();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ beforeEach(() => {
paymentMethodsResponse: {
storedPaymentMethods: [{ supportedShopperInteractions: ['Ecommerce'] }],
paymentMethods: [{ type: 'amazonpay' }],
adyenDescriptions: {
amazonpay: 'testDescription'
}
},
}));
window.installments = '[[0,2,["amex","hipercard"]]]';
Expand All @@ -69,11 +72,9 @@ beforeEach(() => {
countryCode: 'mocked_countrycode',
};
getPaymentMethods.mockReturnValue({
json: jest.fn().mockReturnValue({
adyenConnectedTerminals: { uniqueTerminalIds: ['mocked_id'] },
imagePath: 'example.com',
adyenDescriptions: {},
}),
adyenConnectedTerminals: { uniqueTerminalIds: ['mocked_id'] },
imagePath: 'example.com',
adyenDescriptions: {},
});
});
describe('Render Generic Component', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ function setGiftCardContainerVisibility() {
}

export async function initializeCheckout() {
const paymentMethods = await getPaymentMethods();
const paymentMethodsResponse = await paymentMethods.json();
const paymentMethodsResponse = await getPaymentMethods();
const giftCardsData = await fetchGiftCards();

setCheckoutConfiguration(paymentMethodsResponse);
Expand Down
Loading

0 comments on commit ea8ecbc

Please sign in to comment.