forked from stripe-archive/stripe-payments-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
85 lines (76 loc) · 3.1 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/**
* config.js
* Stripe Payments Demo. Created by Romain Huet (@romainhuet)
* and Thorsten Schaeff (@thorwebdev).
*/
'use strict';
// Load environment variables from the `.env` file.
require('dotenv').config();
module.exports = {
// Default country for the checkout form.
country: 'US',
// Store currency.
currency: 'eur',
// Supported payment methods for the store.
// Some payment methods support only a subset of currencies.
// Make sure to check the docs: https://stripe.com/docs/sources
paymentMethods: [
// 'ach_credit_transfer', // usd (ACH Credit Transfer payments must be in U.S. Dollars)
'alipay', // aud, cad, eur, gbp, hkd, jpy, nzd, sgd, or usd.
'bancontact', // eur (Bancontact must always use Euros)
'card', // many (https://stripe.com/docs/currencies#presentment-currencies)
'eps', // eur (EPS must always use Euros)
'ideal', // eur (iDEAL must always use Euros)
'giropay', // eur (Giropay must always use Euros)
'multibanco', // eur (Multibanco must always use Euros)
// 'sepa_debit', // Restricted. See docs for activation details: https://stripe.com/docs/sources/sepa-debit
'p24', // eur, pln
'sofort', // eur (SOFORT must always use Euros)
'wechat', // aud, cad, eur, gbp, hkd, jpy, sgd, or usd.
'au_becs_debit', //aud
],
// 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: '2019-03-14',
// 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,
},
// Shipping options for the Payment Request API.
shippingOptions: [
{
id: 'free',
label: 'Free Shipping',
detail: 'Delivery within 5 days',
amount: 0,
},
{
id: 'express',
label: 'Express Shipping',
detail: 'Next day delivery',
amount: 500,
},
],
// 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,
},
};