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

fix(cypress): fix redirectionHandler from failing to compile #4846

Merged
merged 9 commits into from
Jun 4, 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
19 changes: 17 additions & 2 deletions cypress-tests/cypress/e2e/PaymentUtils/Commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,22 @@ const globalState = new State({
connectorAuthFilePath: Cypress.env("CONNECTOR_AUTH_FILE_PATH"),
});

const connectorId = globalState.get("connectorId");
const connectorName = normalise(globalState.get("connectorId"));

function normalise(input) {
const exceptions = {
bankofamerica: "Bank of America",
cybersource: "Cybersource",
paypal: "Paypal",
// Add more known exceptions here
};

if (exceptions[input.toLowerCase()]) {
return exceptions[input.toLowerCase()];
} else {
return input;
}
}

const successfulNo3DSCardDetails = {
card_number: "4111111111111111",
Expand Down Expand Up @@ -42,7 +57,7 @@ const getDefaultExchange = () => ({
body: {
error: {
type: "invalid_request",
message: `Selected payment method through ${connectorId} is not implemented`,
message: `Selected payment method through ${connectorName} is not implemented`,
code: "IR_00",
},
},
Expand Down
Loading
Loading