From 7629f8c5f2a55dec17c5a31fadf6b108b1755cda Mon Sep 17 00:00:00 2001 From: techiejd <62455039+techiejd@users.noreply.github.com> Date: Wed, 14 Jun 2023 17:49:24 -0500 Subject: [PATCH 1/2] Update package.json to include getenv --- package.json | 1 + 1 file changed, 1 insertion(+) 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" }, From 46107b339d9f031ff25669900638ff205f44d8d1 Mon Sep 17 00:00:00 2001 From: techiejd <62455039+techiejd@users.noreply.github.com> Date: Wed, 14 Jun 2023 17:51:02 -0500 Subject: [PATCH 2/2] Update index.js to include getenv --- lib/resources/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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