forked from stripe-archive/stripe-payments-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
51 lines (44 loc) · 1.94 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* config.js
* Stripe Payments Demo. Created by Romain Huet (@romainhuet).
*/
'use strict';
// Load environment variables from the `.env` file.
require('dotenv').config();
module.exports = {
// Default country for the checkout form.
country: 'US',
// Store currency.
// Note: A few payment methods like iDEAL or SOFORT only work with euros,
// so it's a good common denominator to test both Elements and Sources.
currency: 'eur',
// Configuration for Stripe.
// API Keys: https://dashboard.stripe.com/account/apikeys
// Webhooks: https://dashboard.stripe.com/account/webhooks
// Storing these keys and secrets as environment variables is a good practice.
// You can fill them in your own `.env` file.
stripe: {
// The two-letter country code of your Stripe account (required for Payment Request).
country: process.env.STRIPE_ACCOUNT_COUNTRY || 'US',
// API version to set for this app (Stripe otherwise uses your default account version).
apiVersion: '2018-02-06',
// Use your test keys for development and live keys for real charges in production.
// For non-card payments like iDEAL, live keys will redirect to real banking sites.
publishableKey: process.env.STRIPE_PUBLISHABLE_KEY,
secretKey: process.env.STRIPE_SECRET_KEY,
// Setting the webhook secret is good practice in order to verify signatures.
// After creating a webhook, click to reveal details and find your signing secret.
webhookSecret: process.env.STRIPE_WEBHOOK_SECRET,
},
// Server port.
port: process.env.PORT || 8000,
// Tunnel to serve the app over HTTPS and be able to receive webhooks locally.
// Optionally, if you have a paid ngrok account, you can specify your `subdomain`
// and `authtoken` in your `.env` file to use it.
ngrok: {
enabled: process.env.NODE_ENV !== 'production',
port: process.env.PORT || 8000,
subdomain: process.env.NGROK_SUBDOMAIN,
authtoken: process.env.NGROK_AUTHTOKEN,
},
};