Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function environment(config) {
const clientId = process.env.PAYPAL_CLIENT_ID || config.clientId;
const clientSecret = process.env.PAYPAL_CLIENT_SECRET || config.secret;
const method = config.env ? `${capitalizeFirstLetter(config.env)}Environment` : 'SandboxEnvironment'
return new checkoutNodeJssdk.core[method](clientId, clientSecret);
}
function client(config) {
return new checkoutNodeJssdk.core.PayPalHttpClient(environment(config));
}