Skip to content
This repository was archived by the owner on Mar 2, 2021. It is now read-only.

Commit 7fa9f30

Browse files
author
Hugo Vieilledent
committed
rename to private key
1 parent e1db0e5 commit 7fa9f30

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

src/billings/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const config = require('../utils/config')
77
const billings = express.Router()
88

99
const keyPublishable = config.stripePublicKey;
10-
const keySecret = config.stripeSecretKey;
10+
const keySecret = config.stripePrivateKey;
1111

1212
const stripeApp = stripe(keySecret)
1313

src/utils/config.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
// Global config that respects the node environment
22
const functions = require('firebase-functions');
33

4-
const {NODE_ENV, PORT = 3000} = process.env
4+
const {NODE_ENV,
5+
PORT = 3000} = process.env
56

6-
// The URL of this application
7-
let apiURL = `http://localhost:${PORT}`
7+
let apiURL, // URL of this application
8+
databaseURL, // Firebase database URL
9+
stripePrivateKey,
10+
stripePublicKey;
811

9-
// The Firebase database URL
10-
let databaseURL = 'https://radio4000-staging.firebaseio.com/'
12+
// CDN URL to the radio4000-player script
13+
const playerScriptURL = 'https://unpkg.com/radio4000-player';
1114

12-
// The CDN URL to the radio4000-player script
13-
const playerScriptURL = 'https://unpkg.com/radio4000-player'
14-
15-
// stripe
16-
let stripeSecretKey = functions.config().stripe.secret_key;
17-
let stripePublicKey = functions.config().stripe.public_key;
15+
apiURL = `http://localhost:${PORT}`;
16+
databaseURL = 'https://radio4000-staging.firebaseio.com/';
17+
stripePrivateKey = functions.config().stripe.private_key;
18+
stripePublicKey = functions.config().stripe.public_key;
1819

1920
if (NODE_ENV === 'production') {
20-
apiURL = `https://api.radio4000.com`
21-
databaseURL = 'https://radio4000.firebaseio.com/'
22-
stripeSecretKey = functions.config().stripe_production.secret_key;
23-
stripePublicKey = functions.config().stripe_production.public_key;
21+
apiURL = 'https://api.radio4000.com';
22+
databaseURL = 'https://radio4000.firebaseio.com/';
23+
stripePrivateKey = functions.config().stripe.production_private_key;
24+
stripePublicKey = functions.config().stripe.production_public_key;
2425
}
2526

2627
module.exports = {
2728
apiURL,
2829
databaseURL,
2930
playerScriptURL,
3031
port: PORT,
31-
stripeSecretKey,
32+
stripePrivateKey,
3233
stripePublicKey
3334
}

0 commit comments

Comments
 (0)