feat(connector): [Fiuu] Add support for cards recurring payments (#6361)

Co-authored-by: Chikke Srujan <chikke.srujan@Chikke-Srujan-N7WRTY72X7.local>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
chikke srujan
2024-10-25 18:24:22 +05:30
committed by GitHub
parent ce732db9b2
commit 4647a2f6ae
11 changed files with 796 additions and 68 deletions

View File

@ -1843,7 +1843,11 @@ Cypress.Commands.add(
const nextActionUrl = response.body.next_action.redirect_to_url;
cy.log(nextActionUrl);
} else if (response.body.authentication_type === "no_three_ds") {
expect(response.body.status).to.equal("succeeded");
if (response.body.connector === "fiuu") {
expect(response.body.status).to.equal("failed");
} else {
expect(response.body.status).to.equal("succeeded");
}
} else {
throw new Error(
`Invalid authentication type ${response.body.authentication_type}`
@ -2446,51 +2450,55 @@ Cypress.Commands.add(
}
);
Cypress.Commands.add("updateConfig", (configType, configData, globalState, value) => {
const base_url = globalState.get("baseUrl");
const merchant_id = globalState.get("merchantId");
const api_key = globalState.get("adminApiKey");
Cypress.Commands.add(
"updateConfig",
(configType, configData, globalState, value) => {
const base_url = globalState.get("baseUrl");
const merchant_id = globalState.get("merchantId");
const api_key = globalState.get("adminApiKey");
let key;
let url;
let body;
switch (configType) {
case 'autoRetry':
key = `should_call_gsm_${merchant_id}`;
url = `${base_url}/configs/${key}`;
body = { key: key, value: value };
break;
case 'maxRetries':
key = `max_auto_retries_enabled_${merchant_id}`;
url = `${base_url}/configs/${key}`;
body = { key: key, value: value };
break;
case 'stepUp':
key = `step_up_enabled_${merchant_id}`;
url = `${base_url}/configs/${key}`;
body = { key: key, value: value };
break;
default:
throw new Error(`Invalid config type passed into the configs: "${api_key}: ${value}"`);
}
let key;
let url;
let body;
cy.request({
method: 'POST',
url: url,
headers: {
"Content-Type": "application/json",
"api-key": api_key,
},
body: body,
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
if (response.status === 200) {
expect(response.body).to.have.property("key").to.equal(key);
expect(response.body).to.have.property("value").to.equal(value);
switch (configType) {
case "autoRetry":
key = `should_call_gsm_${merchant_id}`;
url = `${base_url}/configs/${key}`;
body = { key: key, value: value };
break;
case "maxRetries":
key = `max_auto_retries_enabled_${merchant_id}`;
url = `${base_url}/configs/${key}`;
body = { key: key, value: value };
break;
case "stepUp":
key = `step_up_enabled_${merchant_id}`;
url = `${base_url}/configs/${key}`;
body = { key: key, value: value };
break;
default:
throw new Error(
`Invalid config type passed into the configs: "${api_key}: ${value}"`
);
}
});
});
cy.request({
method: "POST",
url: url,
headers: {
"Content-Type": "application/json",
"api-key": api_key,
},
body: body,
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
if (response.status === 200) {
expect(response.body).to.have.property("key").to.equal(key);
expect(response.body).to.have.property("value").to.equal(value);
}
});
}
);