diff --git a/lib/resources/index.js b/lib/resources/index.js index e072e50..cf04ce2 100644 --- a/lib/resources/index.js +++ b/lib/resources/index.js @@ -3,12 +3,12 @@ */ const CryptoJS = require('crypto-js'); const fetch = require('node-fetch'); +const getenv = require('getenv'); // Constants -const BASE_URL = getenv("BASE_URL_SDK") ? getenv("BASE_URL_SDK") : "https://api.secure.payco.co", - BASE_URL_SECURE = getenv("SECURE_URL_SDK") ? getenv("SECURE_URL_SDK") :"https://secure.payco.co", - ENTORNO = getenv("ENTORNO_SDK") ? getenv("ENTORNO_SDK") : "/restpagos", - BASE_URL_APIFY = getenv("BASE_URL_APIFY") ? getenv("BASE_URL_APIFY") :"https://apify.epayco.co" +const BASE_URL = getenv("BASE_URL_SDK", "https://api.secure.payco.co"), + BASE_URL_SECURE = getenv("SECURE_URL_SDK", "https://secure.payco.co"), + BASE_URL_APIFY = getenv("BASE_URL_APIFY", "https://apify.epayco.co"); /** * Resource constructor diff --git a/package.json b/package.json index 527c4a6..c21602b 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "license": "MIT", "dependencies": { "crypto-js": "^3.1.9-1", + "getenv": "^1.0.0", "ip": "^1.1.5", "node-fetch": "^2.6.0" },