mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Require min age for Stripe accounts
This commit is contained in:
parent
33f50aacce
commit
7fa8f4a9c0
2 changed files with 15 additions and 1 deletions
|
|
@ -17,6 +17,8 @@ import * as validators from '../../util/validators';
|
|||
|
||||
import css from './PayoutDetailsForm.css';
|
||||
|
||||
const MIN_STRIPE_ACCOUNT_AGE = 18;
|
||||
|
||||
const supportedCountries = config.stripe.supportedCountries.map(c => c.code);
|
||||
|
||||
export const stripeCountryConfigs = countryCode => {
|
||||
|
|
@ -78,6 +80,17 @@ const PayoutDetailsFormComponent = props => {
|
|||
id: 'PayoutDetailsForm.birthdayRequired',
|
||||
})
|
||||
);
|
||||
const birthdayMinAge = validators.ageAtLeast(
|
||||
intl.formatMessage(
|
||||
{
|
||||
id: 'PayoutDetailsForm.birthdayMinAge',
|
||||
},
|
||||
{
|
||||
minAge: MIN_STRIPE_ACCOUNT_AGE,
|
||||
}
|
||||
),
|
||||
MIN_STRIPE_ACCOUNT_AGE
|
||||
);
|
||||
|
||||
const countryLabel = intl.formatMessage({ id: 'PayoutDetailsForm.countryLabel' });
|
||||
const countryPlaceholder = intl.formatMessage({ id: 'PayoutDetailsForm.countryPlaceholder' });
|
||||
|
|
@ -218,7 +231,7 @@ const PayoutDetailsFormComponent = props => {
|
|||
labelForMonth={birthdayLabelMonth}
|
||||
labelForYear={birthdayLabelYear}
|
||||
format={null}
|
||||
validate={birthdayRequired}
|
||||
validate={[birthdayRequired, birthdayMinAge]}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -317,6 +317,7 @@
|
|||
"PayoutDetailsForm.birthdayLabel": "Birth date",
|
||||
"PayoutDetailsForm.birthdayLabelMonth": "Month",
|
||||
"PayoutDetailsForm.birthdayLabelYear": "Year",
|
||||
"PayoutDetailsForm.birthdayMinAge": "You should be at least {minAge} years old.",
|
||||
"PayoutDetailsForm.birthdayMonthPlaceholder": "mm",
|
||||
"PayoutDetailsForm.birthdayRequired": "Birthday is required and must be a valid date.",
|
||||
"PayoutDetailsForm.birthdayYearPlaceholder": "yyyy",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue