Skip to content

Commit

Permalink
fix(cypress): fix redirectionHandler from failing to compile (#4846)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixincreate authored Jun 4, 2024
1 parent 1d36798 commit 901b88a
Show file tree
Hide file tree
Showing 4 changed files with 270 additions and 94 deletions.
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

0 comments on commit 901b88a

Please sign in to comment.