Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing stripe countries #968

Merged
merged 13 commits into from
Dec 11, 2018
Merged

Add missing stripe countries #968

merged 13 commits into from
Dec 11, 2018

Conversation

OtterleyW
Copy link
Contributor

@OtterleyW OtterleyW commented Dec 5, 2018

Add Stripe support for new countries:

  • Canada
  • New Zealand
  • Switzerland
  • Norway
  • Hong Kong

Update also already existing countries to have all the required information:

  • Australia: address lines
  • United States: address lines and social security number

Note:

  • StripeBankAccountTokenInputField component and PayoutDetailsForm have some changes
  • Stripe related configuration is separated to new stripe-config.js file.
  • Multiple new translation keys were added and they might not be translated into French yet.

Check this commit for new translations keys added to fr.json translations file.

screenshot 2018-12-07 at 14 51 21

@OtterleyW OtterleyW force-pushed the add-missing-stripe-countries branch 2 times, most recently from 4194e5e to 6948113 Compare December 7, 2018 07:50
@OtterleyW OtterleyW requested review from Gnito and lyyder December 7, 2018 09:05
Copy link
Contributor

@lyyder lyyder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 , added one comment.

@@ -117,7 +135,7 @@ export const translateStripeError = (country, intl, stripeError) => {
*
* @return {Object} key - value in Object literal.
*/
export const mapInputsToStripeAccountKeys = (inputType, value) => {
export const mapInputsToStripeAccountKeys = (country, values) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to update the function doc ☝️

@OtterleyW OtterleyW temporarily deployed to sharetribe-starter-app December 7, 2018 12:14 Inactive
})
);

const fields = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just return this? There's no need for a new variable.

Copy link
Contributor

@Gnito Gnito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
Just one comment to existing code, but add changes to fr.json too and update changelog.md.

src/config.js Outdated
accountConfig: {
routingNumber: true,
accountNumber: true,
},
personalIdNumberRequired: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try again with ssn_last_4: '0000'. Test environment might require it to be exactly that.
https://stripe.com/docs/connect/testing#test-personal-id-numbers

@OtterleyW OtterleyW force-pushed the add-missing-stripe-countries branch 3 times, most recently from cafc8db to 4f5cbec Compare December 7, 2018 14:00

const personalIdNumberLabel = showPersonalIdNumber
? intl.formatMessage({
id: `PayoutDetailsForm.personalIdNumberLabel.${country}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have tried to avoid variables in translation keys. The reason is that most of our customers will have hard time finding correct components if they can't search full translation key from files. (We have used them only in situations where there is dynamic content coming from integrations - like Stripe errors.)

So, chained ternary or let should work better here.

CHANGELOG.md Outdated
@@ -14,6 +14,9 @@ way to update this template, but currently, we follow a pattern:

## Upcoming version 2018-XX-XX

* [add] Add Stripe support for new countries: Canada, New Zealand, Switzerland, Norway, and Hong Kong.
Also add more required fields for US and Australia. There are multiple new translation keys that might not be translated into French yet. If you use French translation check PR for the changed keys.
[#968](https://github.com/sharetribe/flex-template-web/pull/968)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn run format-docs

@OtterleyW OtterleyW force-pushed the add-missing-stripe-countries branch from 4f5cbec to 708d423 Compare December 10, 2018 09:10
/*
* Stripe related configuration.
*/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be best that we add more comments to this key. We have had a couple of problems when customizers haven't really understood that Stripe has a publishable key and private key - and they both should be set. So, repeating that info probably helps.

// 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.

@OtterleyW OtterleyW force-pushed the add-missing-stripe-countries branch 3 times, most recently from 20f081d to c78eac7 Compare December 10, 2018 11:53
@OtterleyW OtterleyW force-pushed the add-missing-stripe-countries branch from c78eac7 to abe628a Compare December 10, 2018 12:51
Copy link
Contributor

@Gnito Gnito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@OtterleyW OtterleyW force-pushed the add-missing-stripe-countries branch 2 times, most recently from 72d73cc to 732fa86 Compare December 11, 2018 08:44
@OtterleyW OtterleyW force-pushed the add-missing-stripe-countries branch from 732fa86 to ffa3c7e Compare December 11, 2018 08:46
@OtterleyW OtterleyW merged commit 2625b44 into master Dec 11, 2018
@OtterleyW OtterleyW deleted the add-missing-stripe-countries branch December 11, 2018 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants