fix: Organize Plaid env variables for development and sandbox envs (#480)

This commit is contained in:
Ahmed Bouhuolia
2024-06-03 20:50:02 +02:00
committed by GitHub
parent 7c06c8bb8a
commit 175bc243f3
10 changed files with 33 additions and 227 deletions

View File

@@ -204,10 +204,7 @@ module.exports = {
plaid: {
env: process.env.PLAID_ENV || 'sandbox',
clientId: process.env.PLAID_CLIENT_ID,
secretDevelopment: process.env.PLAID_SECRET_DEVELOPMENT,
secretSandbox: process.env.PLAID_SECRET_SANDBOX,
redirectSandBox: process.env.PLAID_SANDBOX_REDIRECT_URI,
redirectDevelopment: process.env.PLAID_DEVELOPMENT_REDIRECT_URI,
secret: process.env.PLAID_SECRET,
linkWebhook: process.env.PLAID_LINK_WEBHOOK,
},

View File

@@ -70,10 +70,7 @@ export class PlaidClientWrapper {
baseOptions: {
headers: {
'PLAID-CLIENT-ID': config.plaid.clientId,
'PLAID-SECRET':
config.plaid.env === 'development'
? config.plaid.secretDevelopment
: config.plaid.secretSandbox,
'PLAID-SECRET': config.plaid.secret,
'Plaid-Version': '2020-09-14',
},
},