Environment Settings
Why Environment Control Matters?
Environment
Use Case
How to Configure Environment?
const { PaymentClient } = require('hyperswitch-prism');
// Sandbox environment configuration
const sandboxConfig = {
options: { environment: "SANDBOX" },
connectorConfig: {
stripe: {
apiKey: { value: process.env.STRIPE_TEST_API_KEY }
}
}
};
const sandboxClient = new PaymentClient(sandboxConfig);
// Production environment configuration
const prodConfig = {
options: { environment: "PRODUCTION" },
connectorConfig: {
stripe: {
apiKey: { value: process.env.STRIPE_LIVE_API_KEY }
}
}
};
const prodClient = new PaymentClient(prodConfig);Last updated
Was this helpful?

