mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
fix(cypress): fix redirectionHandler from failing to compile (#4846)
This commit is contained in:
@ -8,7 +8,22 @@ const globalState = new State({
|
|||||||
connectorAuthFilePath: Cypress.env("CONNECTOR_AUTH_FILE_PATH"),
|
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 = {
|
const successfulNo3DSCardDetails = {
|
||||||
card_number: "4111111111111111",
|
card_number: "4111111111111111",
|
||||||
@ -42,7 +57,7 @@ const getDefaultExchange = () => ({
|
|||||||
body: {
|
body: {
|
||||||
error: {
|
error: {
|
||||||
type: "invalid_request",
|
type: "invalid_request",
|
||||||
message: `Selected payment method through ${connectorId} is not implemented`,
|
message: `Selected payment method through ${connectorName} is not implemented`,
|
||||||
code: "IR_00",
|
code: "IR_00",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
342
cypress-tests/package-lock.json
generated
342
cypress-tests/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,8 @@
|
|||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"devDependencies": {
|
||||||
|
"cypress": "^13.10.0",
|
||||||
"jsqr": "^1.4.0"
|
"jsqr": "^1.4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user