Skip to content

Commit

Permalink
Merge pull request #1250 from sharetribe/add-new-countries-to-bank-ac…
Browse files Browse the repository at this point in the history
…count-token-validations

Add missing countries to StripeBankAccountToken validations
  • Loading branch information
OtterleyW authored Jan 3, 2020
2 parents bef4a71 + bc6bdc0 commit 751a08b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ way to update this template, but currently, we follow a pattern:

## Upcoming version 2019-XX-XX

- [fix] Add missing countries (e.g. MX and JP) to `StripeBankAccountTokenInput` validations.
[#1250])(https://github.com/sharetribe/ftw-daily/pull/1250)

## [v4.0.0] 2019-12-19

- [change] Use Stripe's [Connect onboarding](https://stripe.com/docs/connect/connect-onboarding) for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,21 @@ export const mapInputsToStripeAccountKeys = (country, values) => {
case 'AT':
case 'BE':
case 'DK':
case 'EE':
case 'FI':
case 'FR':
case 'DE':
case 'GR':
case 'IE':
case 'IT':
case 'LV':
case 'LT':
case 'LU':
case 'NL':
case 'PL':
case 'PT':
case 'SK':
case 'SI':
case 'ES':
case 'SE':
case 'CH':
Expand Down Expand Up @@ -222,6 +229,19 @@ export const mapInputsToStripeAccountKeys = (country, values) => {
account_number: cleanedString(values[ACCOUNT_NUMBER]),
};

case 'JP':
return {
bank_name: cleanedString(values[BANK_NAME]),
branch_name: cleanedString(values[BRANCH_NAME]),
routing_number: cleanedString(values[BANK_CODE]).concat(values[BRANCH_CODE]),
account_number: cleanedString(values[ACCOUNT_NUMBER]),
account_holder_name: cleanedString(values[ACCOUNT_OWNER_NAME]),
};

case 'MX':
return {
account_number: cleanedString(values[CLABE]),
};
default:
throw new Error(`Not supported country (${country}) given to validator`);
}
Expand Down

0 comments on commit 751a08b

Please sign in to comment.