@nicotordev/flowcl-pagos
Version:
SDK en TypeScript para integrar pagos con la API de Flow.cl de manera sencilla y segura.
22 lines • 1.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.describeFlowIntegration = exports.hasFlowIntegrationCredentials = exports.flowIntegrationConfig = void 0;
const DEFAULT_BASE_URL = 'https://sandbox.flow.cl/api';
const PLACEHOLDER_VALUES = new Set([
'',
'TU_API_KEY_DE_SANDBOX',
'TU_SECRET_KEY_DE_SANDBOX',
]);
const hasRealCredential = (value) => value !== undefined && value !== '' && !PLACEHOLDER_VALUES.has(value);
exports.flowIntegrationConfig = {
apiKey: process.env.FLOW_API_KEY ||
process.env.FLOW_PUBLIC_KEY ||
'TU_API_KEY_DE_SANDBOX',
secretKey: process.env.FLOW_SECRET_KEY || 'TU_SECRET_KEY_DE_SANDBOX',
baseUrl: process.env.FLOW_BASE_URL || process.env.FLOW_API_URL || DEFAULT_BASE_URL,
};
const shouldRunIntegrationTests = process.env.FLOW_RUN_INTEGRATION_TESTS === 'true';
exports.hasFlowIntegrationCredentials = hasRealCredential(exports.flowIntegrationConfig.apiKey) &&
hasRealCredential(exports.flowIntegrationConfig.secretKey);
exports.describeFlowIntegration = shouldRunIntegrationTests && exports.hasFlowIntegrationCredentials ? describe : describe.skip;
//# sourceMappingURL=flowIntegration.js.map