From 8223878f08a9ceced2fc8da7ee6a92964d1808d4 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Mon, 18 Mar 2019 17:49:28 +0200 Subject: [PATCH] Remove deprecated subcomponents --- src/config.js | 7 +- .../PayoutDetailsFormCompany.js | 235 ------------------ .../PayoutDetailsFormIndividual.js | 48 ---- src/stripe-config.js | 7 - src/translations/en.json | 4 - 5 files changed, 1 insertion(+), 300 deletions(-) delete mode 100644 src/forms/PayoutDetailsForm/PayoutDetailsFormCompany.js delete mode 100644 src/forms/PayoutDetailsForm/PayoutDetailsFormIndividual.js diff --git a/src/config.js b/src/config.js index cc12b4d5..57d0ad06 100644 --- a/src/config.js +++ b/src/config.js @@ -1,10 +1,6 @@ import * as custom from './marketplace-custom-config.js'; import defaultLocationSearches from './default-location-searches'; -import { - stripePublishableKey, - useDeprecatedLegalEntityWithStripe, - stripeSupportedCountries, -} from './stripe-config'; +import { stripePublishableKey, stripeSupportedCountries } from './stripe-config'; const env = process.env.REACT_APP_ENV; const dev = process.env.REACT_APP_ENV === 'development'; @@ -212,7 +208,6 @@ const config = { stripe: { publishableKey: stripePublishableKey, supportedCountries: stripeSupportedCountries, - useDeprecatedLegalEntityWithStripe, }, canonicalRootURL, address: { diff --git a/src/forms/PayoutDetailsForm/PayoutDetailsFormCompany.js b/src/forms/PayoutDetailsForm/PayoutDetailsFormCompany.js deleted file mode 100644 index a8885c4c..00000000 --- a/src/forms/PayoutDetailsForm/PayoutDetailsFormCompany.js +++ /dev/null @@ -1,235 +0,0 @@ -import React from 'react'; -import { bool, string } from 'prop-types'; -import { compose } from 'redux'; -import { FormattedMessage, injectIntl, intlShape } from 'react-intl'; -import { FieldArray } from 'react-final-form-arrays'; -import { - ExternalLink, - FieldTextInput, - IconAdd, - IconClose, - InlineTextButton, -} from '../../components'; -import * as validators from '../../util/validators'; - -import PayoutDetailsAddress from './PayoutDetailsAddress'; -import PayoutDetailsBankDetails from './PayoutDetailsBankDetails'; -import PayoutDetailsPersonalDetails from './PayoutDetailsPersonalDetails'; -import { stripeCountryConfigs } from './PayoutDetailsForm'; -import css from './PayoutDetailsForm.css'; - -// In EU, there can be a maximum of 4 additional owners -const MAX_NUMBER_OF_ADDITIONAL_OWNERS = 4; - -const PayoutDetailsFormCompanyComponent = ({ fieldRenderProps }) => { - const { - id, - disabled, - form, - intl, - values, - form: { - mutators: { push }, - }, - } = fieldRenderProps; - const { country } = values; - - const companyNameLabel = intl.formatMessage({ id: 'PayoutDetailsForm.companyNameLabel' }); - const companyNamePlaceholder = intl.formatMessage({ - id: 'PayoutDetailsForm.companyNamePlaceholder', - }); - const companyNameRequired = validators.required( - intl.formatMessage({ - id: 'PayoutDetailsForm.companyNameRequired', - }) - ); - - const companyTaxIdLabel = intl.formatMessage({ - id: `PayoutDetailsForm.companyTaxIdLabel.${country}`, - }); - const companyTaxIdPlaceholder = intl.formatMessage( - { - id: 'PayoutDetailsForm.companyTaxIdPlaceholder', - }, - { - idName: companyTaxIdLabel, - } - ); - const companyTaxIdRequired = validators.required( - intl.formatMessage( - { - id: 'PayoutDetailsForm.companyTaxIdRequired', - }, - { - idName: companyTaxIdLabel, - } - ) - ); - - const showPersonalAddressField = - country && - stripeCountryConfigs(country).companyConfig && - stripeCountryConfigs(country).companyConfig.personalAddress; - - const showAdditionalOwnersField = - country && - stripeCountryConfigs(country).companyConfig && - stripeCountryConfigs(country).companyConfig.additionalOwners; - - const hasAdditionalOwners = values.company && values.company.additionalOwners; - const hasMaxNumberOfAdditionalOwners = - hasAdditionalOwners && - values.company.additionalOwners.length >= MAX_NUMBER_OF_ADDITIONAL_OWNERS; - - const additionalOwnersInfoLink = ( - - - - ); - - return ( - - {country ? ( - -
-

- -

- - - -
- - - - - - - - {showPersonalAddressField ? ( - - ) : null} - - {showAdditionalOwnersField ? ( -
- - {({ fields }) => - fields.map((name, index) => ( -
-
fields.remove(index)} - style={{ cursor: 'pointer' }} - > - - - - -
- - {showPersonalAddressField ? ( - - ) : null} -
- )) - } -
- - {!hasAdditionalOwners || !hasMaxNumberOfAdditionalOwners ? ( - - push('company.additionalOwners', undefined)} - > - - - - - -

- -

-
- ) : null} -
- ) : null} -
- ) : null} -
- ); -}; - -PayoutDetailsFormCompanyComponent.defaultProps = { - id: null, - disabled: false, -}; - -PayoutDetailsFormCompanyComponent.propTypes = { - id: string, - disabled: bool, - - // from injectIntl - intl: intlShape.isRequired, -}; - -const PayoutDetailsFormCompany = compose(injectIntl)(PayoutDetailsFormCompanyComponent); - -export default PayoutDetailsFormCompany; diff --git a/src/forms/PayoutDetailsForm/PayoutDetailsFormIndividual.js b/src/forms/PayoutDetailsForm/PayoutDetailsFormIndividual.js deleted file mode 100644 index 55ffe0c9..00000000 --- a/src/forms/PayoutDetailsForm/PayoutDetailsFormIndividual.js +++ /dev/null @@ -1,48 +0,0 @@ -import React from 'react'; -import { bool } from 'prop-types'; -import { compose } from 'redux'; -import { injectIntl, intlShape } from 'react-intl'; - -import PayoutDetailsAddress from './PayoutDetailsAddress'; -import PayoutDetailsBankDetails from './PayoutDetailsBankDetails'; -import PayoutDetailsPersonalDetails from './PayoutDetailsPersonalDetails'; - -const PayoutDetailsFormIndividualComponent = ({ fieldRenderProps }) => { - const { disabled, form, intl, values } = fieldRenderProps; - const { country } = values; - - return ( - - - - - - ); -}; - -PayoutDetailsFormIndividualComponent.defaultProps = { - disabled: false, -}; - -PayoutDetailsFormIndividualComponent.propTypes = { - disabled: bool, - - // from injectIntl - intl: intlShape.isRequired, -}; - -const PayoutDetailsFormIndividual = compose(injectIntl)(PayoutDetailsFormIndividualComponent); - -export default PayoutDetailsFormIndividual; diff --git a/src/stripe-config.js b/src/stripe-config.js index 6753b1e0..611d9bba 100644 --- a/src/stripe-config.js +++ b/src/stripe-config.js @@ -7,13 +7,6 @@ // 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; -// You can check your Stripe API version from Stripe Dashboard -> Developers. -// If you are using the API version that is earlier than '2019-02-19' change this value to 'true' -// See Stripe API changelog: https://stripe.com/docs/upgrades#api-changelog -// NOTE: we are not supporting company accounts with new Stripe API yet! -// The option for company accounts will be hidden if this value is set to 'false' -export const useDeprecatedLegalEntityWithStripe = false; - // Stripe only supports payments in certain countries, see full list // at https://stripe.com/global // diff --git a/src/translations/en.json b/src/translations/en.json index a90a1a51..3594b6b4 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -456,10 +456,6 @@ "PasswordResetPage.resetFailed": "Reset failed. Please try again.", "PasswordResetPage.title": "Reset password", "PayoutDetailsForm.accountTypeTitle": "Account type", - "PayoutDetailsForm.additionalOwnersInfoLink": "Stripe support.", - "PayoutDetailsForm.additionalOwnerInfoText": "For Hong Kong, Singapore, and Single Euro Payments Area member countries, Stripe requires information of every person that owns at least 25% of the company. For more information, see {additionalOwnersInfoLink}", - "PayoutDetailsForm.additionalOwnerLabel": "Add additional owner", - "PayoutDetailsForm.additionalOwnerRemove": "Remove additional owner", "PayoutDetailsForm.addressTitle": "Address", "PayoutDetailsForm.bankDetails": "Bank details", "PayoutDetailsForm.birthdayDatePlaceholder": "dd",