feat(donate): PayPal integration

This commit is contained in:
Ahmad Abdolsaheb
2020-03-13 12:25:57 +03:00
committed by Mrugesh Mohapatra
parent e3db423abf
commit 6c6eadfbe4
24 changed files with 1040 additions and 70 deletions

View File

@@ -39,6 +39,30 @@ const donationSubscriptionConfig = {
}
};
// Shared paypal configuration
const paypalConfig = {
production: {
webhookId: '8AM40465WC915574A',
durationPlans: {
month: {
'500': {
planId: 'P-1L11422374370240ULZKX3PA'
}
}
}
},
development: {
webhookId: '2UL63757DN298592C',
durationPlans: {
month: {
'500': {
planId: 'P-146249205C631091BLZKRHGA'
}
}
}
}
};
module.exports = {
durationsConfig,
amountsConfig,
@@ -47,5 +71,6 @@ module.exports = {
durationKeysConfig,
donationOneTimeConfig,
donationSubscriptionConfig,
modalDefaultStateConfig
modalDefaultStateConfig,
paypalConfig
};

View File

@@ -20,7 +20,8 @@ const {
STRIPE_PUBLIC_KEY: stripePublicKey,
SERVICEBOT_ID: servicebotId,
ALGOLIA_APP_ID: algoliaAppId,
ALGOLIA_API_KEY: algoliaAPIKey
ALGOLIA_API_KEY: algoliaAPIKey,
PAYPAL_CLIENT_ID: paypalClientId
} = process.env;
const locations = {
@@ -49,5 +50,9 @@ module.exports = Object.assign(locations, {
algoliaAPIKey:
!algoliaAPIKey || algoliaAPIKey === 'Algolia api key from dashboard'
? null
: algoliaAPIKey
: algoliaAPIKey,
paypalClientId:
!paypalClientId || paypalClientId === 'id_from_paypal_dashboard'
? null
: paypalClientId
});

View File

@@ -33,7 +33,11 @@ const {
STRIPE_PUBLIC_KEY,
STRIPE_SECRET_KEY,
SERVICEBOT_ID,
SERVICEBOT_HMAC_SECRET_KEY
SERVICEBOT_HMAC_SECRET_KEY,
PAYPAL_CLIENT_ID,
PAYPAL_SECRET
} = process.env;
module.exports = {
@@ -98,6 +102,11 @@ module.exports = {
secret: STRIPE_SECRET_KEY
},
paypal: {
client: PAYPAL_CLIENT_ID,
secret: PAYPAL_SECRET
},
servicebot: {
servicebotId: SERVICEBOT_ID,
hmacKey: SERVICEBOT_HMAC_SECRET_KEY