2020-03-16 14:32:35 +05:30
|
|
|
require('dotenv').config();
|
|
|
|
|
2019-11-19 20:30:47 +05:30
|
|
|
// Configuration for client side
|
|
|
|
const durationsConfig = {
|
|
|
|
year: 'yearly',
|
|
|
|
month: 'monthly',
|
|
|
|
onetime: 'one-time'
|
|
|
|
};
|
|
|
|
const amountsConfig = {
|
|
|
|
year: [100000, 25000, 3500],
|
|
|
|
month: [5000, 3500, 500],
|
|
|
|
onetime: [100000, 25000, 3500]
|
|
|
|
};
|
2019-11-20 11:47:46 +05:30
|
|
|
const defaultAmount = {
|
|
|
|
year: 25000,
|
2019-12-20 16:14:16 +05:30
|
|
|
month: 3500,
|
2019-11-20 11:47:46 +05:30
|
|
|
onetime: 25000
|
|
|
|
};
|
2019-11-19 20:30:47 +05:30
|
|
|
const defaultStateConfig = {
|
2019-11-20 11:47:46 +05:30
|
|
|
donationAmount: defaultAmount['month'],
|
2019-11-19 20:30:47 +05:30
|
|
|
donationDuration: 'month',
|
|
|
|
paymentType: 'Card'
|
|
|
|
};
|
2019-12-20 16:14:16 +05:30
|
|
|
const modalDefaultStateConfig = {
|
|
|
|
donationAmount: 500,
|
|
|
|
donationDuration: 'month',
|
|
|
|
paymentType: 'Card'
|
|
|
|
};
|
2019-11-19 20:30:47 +05:30
|
|
|
|
|
|
|
// Configuration for server side
|
|
|
|
const durationKeysConfig = ['year', 'month', 'onetime'];
|
|
|
|
const donationOneTimeConfig = [100000, 25000, 3500];
|
|
|
|
const donationSubscriptionConfig = {
|
|
|
|
duration: {
|
|
|
|
year: 'Yearly',
|
|
|
|
month: 'Monthly'
|
|
|
|
},
|
|
|
|
plans: {
|
|
|
|
year: [100000, 25000, 3500],
|
|
|
|
month: [5000, 3500, 500]
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-03-13 12:25:57 +03:00
|
|
|
// Shared paypal configuration
|
2020-03-16 14:32:35 +05:30
|
|
|
const paypalConfigTypes = {
|
|
|
|
live: {
|
2020-03-13 12:25:57 +03:00
|
|
|
durationPlans: {
|
|
|
|
month: {
|
|
|
|
'500': {
|
|
|
|
planId: 'P-1L11422374370240ULZKX3PA'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2020-03-16 14:32:35 +05:30
|
|
|
staging: {
|
2020-03-13 12:25:57 +03:00
|
|
|
durationPlans: {
|
|
|
|
month: {
|
|
|
|
'500': {
|
|
|
|
planId: 'P-146249205C631091BLZKRHGA'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-03-16 14:32:35 +05:30
|
|
|
const paypalConfig = process.env.DEPLOYMENT_ENV
|
|
|
|
? paypalConfigTypes['live']
|
|
|
|
: paypalConfigTypes['staging'];
|
|
|
|
|
2019-11-19 20:30:47 +05:30
|
|
|
module.exports = {
|
|
|
|
durationsConfig,
|
|
|
|
amountsConfig,
|
2019-11-20 11:47:46 +05:30
|
|
|
defaultAmount,
|
2019-11-19 20:30:47 +05:30
|
|
|
defaultStateConfig,
|
|
|
|
durationKeysConfig,
|
|
|
|
donationOneTimeConfig,
|
2019-12-20 16:14:16 +05:30
|
|
|
donationSubscriptionConfig,
|
2020-03-13 12:25:57 +03:00
|
|
|
modalDefaultStateConfig,
|
|
|
|
paypalConfig
|
2019-11-19 20:30:47 +05:30
|
|
|
};
|