mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-25 22:37:18 +10:00
Move Stripe config to separate file
This commit is contained in:
parent
3707a1bc04
commit
687cf7bbe9
3 changed files with 301 additions and 292 deletions
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
# Mandatory configuration
|
||||
#
|
||||
# Note: You also need to set Stripe secret key in Flex Console.
|
||||
#
|
||||
REACT_APP_SHARETRIBE_SDK_CLIENT_ID=
|
||||
REACT_APP_STRIPE_PUBLISHABLE_KEY=
|
||||
REACT_APP_MAPBOX_ACCESS_TOKEN=
|
||||
|
|
|
|||
293
src/config.js
293
src/config.js
|
|
@ -1,5 +1,6 @@
|
|||
import * as custom from './marketplace-custom-config.js';
|
||||
import defaultLocationSearches from './default-location-searches';
|
||||
import { stripePublishableKey, stripeSupportedCountries } from './stripe-config';
|
||||
|
||||
const env = process.env.REACT_APP_ENV;
|
||||
const dev = process.env.REACT_APP_ENV === 'development';
|
||||
|
|
@ -79,298 +80,6 @@ const currencyConfig = {
|
|||
maximumFractionDigits: 2,
|
||||
};
|
||||
|
||||
const stripePublishableKey = process.env.REACT_APP_STRIPE_PUBLISHABLE_KEY;
|
||||
|
||||
// Stripe only supports payments in certain countries, see full list
|
||||
// at https://stripe.com/global
|
||||
//
|
||||
// We currently only support EU countries, US, and AU.
|
||||
const stripeSupportedCountries = [
|
||||
{
|
||||
// Australia
|
||||
code: 'AU',
|
||||
currency: 'AUD',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
state: true,
|
||||
},
|
||||
accountConfig: {
|
||||
bsb: true,
|
||||
accountNumber: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Austria
|
||||
code: 'AT',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Belgium
|
||||
code: 'BE',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Canada
|
||||
code: 'CA',
|
||||
currency: 'CAD',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
province: true,
|
||||
},
|
||||
accountConfig: {
|
||||
transitNumber: true,
|
||||
institutionNumber: true,
|
||||
accountNumber: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Denmark
|
||||
code: 'DK',
|
||||
currency: 'DKK',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Finland
|
||||
code: 'FI',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// France
|
||||
code: 'FR',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Germany
|
||||
code: 'DE',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Hong Kong
|
||||
code: 'HK',
|
||||
currency: 'HKD',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
},
|
||||
accountConfig: {
|
||||
clearingCode: true,
|
||||
branchCode: true,
|
||||
accountNumber: true,
|
||||
},
|
||||
personalIdNumberRequired: true,
|
||||
},
|
||||
{
|
||||
// Ireland
|
||||
code: 'IE',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Italy
|
||||
code: 'IT',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Luxembourg
|
||||
code: 'LU',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Netherlands
|
||||
code: 'NL',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// New Zealand
|
||||
code: 'NZ',
|
||||
currency: 'NZD',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
accountNumber: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Norway
|
||||
code: 'NO',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Portugal
|
||||
code: 'PT',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Spain
|
||||
code: 'ES',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Sweden
|
||||
code: 'SE',
|
||||
currency: 'SEK',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Switzerland
|
||||
code: 'CH',
|
||||
currency: 'CHF',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// United Kingdom
|
||||
code: 'GB',
|
||||
currency: 'GBP',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
sortCode: true,
|
||||
accountNumber: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// United States
|
||||
code: 'US',
|
||||
currency: 'USD',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
state: true,
|
||||
},
|
||||
accountConfig: {
|
||||
routingNumber: true,
|
||||
accountNumber: true,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
// Address information is used in SEO schema for Organization (http://schema.org/PostalAddress)
|
||||
const addressCountry = 'FI';
|
||||
const addressRegion = 'Helsinki';
|
||||
|
|
|
|||
298
src/stripe-config.js
Normal file
298
src/stripe-config.js
Normal file
|
|
@ -0,0 +1,298 @@
|
|||
/*
|
||||
* Stripe related configuration.
|
||||
*/
|
||||
|
||||
// NOTE: REACT_APP_STRIPE_PUBLISHABLE_KEY is mandatory environment variable.
|
||||
// This variable is set in a hidden file: .env
|
||||
// To make Stripe connection work, you also need to set Stripe's private key in the Flex Console.
|
||||
export const stripePublishableKey = process.env.REACT_APP_STRIPE_PUBLISHABLE_KEY;
|
||||
|
||||
// Stripe only supports payments in certain countries, see full list
|
||||
// at https://stripe.com/global
|
||||
//
|
||||
export const stripeSupportedCountries = [
|
||||
{
|
||||
// Australia
|
||||
code: 'AU',
|
||||
currency: 'AUD',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
state: true,
|
||||
},
|
||||
accountConfig: {
|
||||
bsb: true,
|
||||
accountNumber: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Austria
|
||||
code: 'AT',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Belgium
|
||||
code: 'BE',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Canada
|
||||
code: 'CA',
|
||||
currency: 'CAD',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
province: true,
|
||||
},
|
||||
accountConfig: {
|
||||
transitNumber: true,
|
||||
institutionNumber: true,
|
||||
accountNumber: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Denmark
|
||||
code: 'DK',
|
||||
currency: 'DKK',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Finland
|
||||
code: 'FI',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// France
|
||||
code: 'FR',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Germany
|
||||
code: 'DE',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Hong Kong
|
||||
code: 'HK',
|
||||
currency: 'HKD',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
},
|
||||
accountConfig: {
|
||||
clearingCode: true,
|
||||
branchCode: true,
|
||||
accountNumber: true,
|
||||
},
|
||||
personalIdNumberRequired: true,
|
||||
},
|
||||
{
|
||||
// Ireland
|
||||
code: 'IE',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Italy
|
||||
code: 'IT',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Luxembourg
|
||||
code: 'LU',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Netherlands
|
||||
code: 'NL',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// New Zealand
|
||||
code: 'NZ',
|
||||
currency: 'NZD',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
accountNumber: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Norway
|
||||
code: 'NO',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Portugal
|
||||
code: 'PT',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Spain
|
||||
code: 'ES',
|
||||
currency: 'EUR',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Sweden
|
||||
code: 'SE',
|
||||
currency: 'SEK',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Switzerland
|
||||
code: 'CH',
|
||||
currency: 'CHF',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
iban: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// United Kingdom
|
||||
code: 'GB',
|
||||
currency: 'GBP',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
},
|
||||
accountConfig: {
|
||||
sortCode: true,
|
||||
accountNumber: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
// United States
|
||||
code: 'US',
|
||||
currency: 'USD',
|
||||
addressConfig: {
|
||||
addressLine: true,
|
||||
city: true,
|
||||
postalCode: true,
|
||||
state: true,
|
||||
},
|
||||
accountConfig: {
|
||||
routingNumber: true,
|
||||
accountNumber: true,
|
||||
},
|
||||
ssnLast4Required: true,
|
||||
},
|
||||
];
|
||||
Loading…
Add table
Reference in a new issue