mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-31 01:57:45 +08:00
34 lines
762 B
JavaScript
34 lines
762 B
JavaScript
import { connectorDetails as adyenConnectorDetails } from "./Adyen.js";
|
|
|
|
const connectorDetails = {
|
|
adyen: adyenConnectorDetails,
|
|
};
|
|
|
|
export const getConnectorDetails = (connectorId) => {
|
|
let x = getValueByKey(connectorDetails, connectorId);
|
|
return x;
|
|
};
|
|
|
|
function getValueByKey(jsonObject, key) {
|
|
const data =
|
|
typeof jsonObject === "string" ? JSON.parse(jsonObject) : jsonObject;
|
|
|
|
if (data && typeof data === "object" && key in data) {
|
|
return data[key];
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
export const should_continue_further = (res_data) => {
|
|
if (
|
|
res_data.body.error !== undefined ||
|
|
res_data.body.error_code !== undefined ||
|
|
res_data.body.error_message !== undefined
|
|
) {
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
};
|