paypal-isomorphic-functions
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -7,4 +7,5 @@ "use strict"; | ||
const btoa_1 = __importDefault(require("btoa")); | ||
const browser_or_node_1 = require("browser-or-node"); | ||
exports.CONFIG = new Map(); | ||
if (process) { | ||
if (browser_or_node_1.isNode) { | ||
exports.CONFIG.set("PAYPAL_CLIENT_ID", process.env.PAYPAL_CLIENT_ID); | ||
@@ -15,3 +16,3 @@ exports.CONFIG.set("PAYPAL_CLIENT_SECRET", process.env.PAYPAL_CLIENT_SECRET); | ||
} | ||
else { | ||
else if (browser_or_node_1.isBrowser) { | ||
exports.CONFIG.set("PAYPAL_CLIENT_ID", window.localStorage.getItem("PAYPAL_CLIENT_ID")); | ||
@@ -22,5 +23,5 @@ exports.CONFIG.set("PAYPAL_CLIENT_SECRET", window.localStorage.getItem("PAYPAL_CLIENT_SECRET")); | ||
} | ||
exports.CONFIG.set("PAYPAL_REST_HOSTNAME", exports.CONFIG.get("PAYPAL_ENVIRONMENT") === "productin" | ||
exports.CONFIG.set("PAYPAL_REST_HOSTNAME", exports.CONFIG.get("PAYPAL_ENVIRONMENT") === "production" | ||
? "https://api.paypal.com" | ||
: "https://api.sandbox.paypal.com"); | ||
//# sourceMappingURL=config.js.map |
{ | ||
"name": "paypal-isomorphic-functions", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Library of helpful paypal functions that can be run in a browser or server", | ||
@@ -15,2 +15,3 @@ "main": "./dist/index.js", | ||
"devDependencies": { | ||
"@types/browser-or-node": "^1.2.0", | ||
"@types/btoa": "^1.2.3", | ||
@@ -24,2 +25,3 @@ "@types/node": "^13.1.7", | ||
"dependencies": { | ||
"browser-or-node": "^1.2.1", | ||
"btoa": "^1.2.1", | ||
@@ -26,0 +28,0 @@ "es6-promise": "^4.2.8", |
import btoa from "btoa"; | ||
import { isNode, isBrowser } from 'browser-or-node'; | ||
@@ -6,3 +7,3 @@ export const CONFIG = new Map(); | ||
// Server Config | ||
if (process) { | ||
if (isNode) { | ||
CONFIG.set("PAYPAL_CLIENT_ID", process.env.PAYPAL_CLIENT_ID); | ||
@@ -15,3 +16,3 @@ CONFIG.set("PAYPAL_CLIENT_SECRET", process.env.PAYPAL_CLIENT_SECRET); | ||
); | ||
} else { | ||
} else if (isBrowser) { | ||
CONFIG.set( | ||
@@ -41,5 +42,5 @@ "PAYPAL_CLIENT_ID", | ||
"PAYPAL_REST_HOSTNAME", | ||
CONFIG.get("PAYPAL_ENVIRONMENT") === "productin" | ||
CONFIG.get("PAYPAL_ENVIRONMENT") === "production" | ||
? "https://api.paypal.com" | ||
: "https://api.sandbox.paypal.com" | ||
); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
344510
1125
5
7
+ Addedbrowser-or-node@^1.2.1
+ Addedbrowser-or-node@1.3.0(transitive)