From c79fb7e14104fb76a503a7779bbb3755fa53581c Mon Sep 17 00:00:00 2001 From: Jenni Nurmi Date: Wed, 5 Dec 2018 14:45:35 +0200 Subject: [PATCH] Add Stripe support for New Zealand --- .../StripeBankAccountTokenInputField.util.js | 4 ++++ src/config.js | 13 +++++++++++++ src/translations/en.json | 1 + 3 files changed, 18 insertions(+) diff --git a/src/components/StripeBankAccountTokenInputField/StripeBankAccountTokenInputField.util.js b/src/components/StripeBankAccountTokenInputField/StripeBankAccountTokenInputField.util.js index 60b6d645..53cebfc7 100644 --- a/src/components/StripeBankAccountTokenInputField/StripeBankAccountTokenInputField.util.js +++ b/src/components/StripeBankAccountTokenInputField/StripeBankAccountTokenInputField.util.js @@ -156,6 +156,10 @@ export const mapInputsToStripeAccountKeys = (country, values) => { case 'ES': case 'SE': return { account_number: cleanedString(values[IBAN]) }; + case 'NZ': + // NZ account number is typically presented in the format xx-xxxx-xxxxxxx-xxx + // '-' separators must be removed before sending value to Stripe API + return { account_number: cleanedString(values[ACCOUNT_NUMBER]).replace(/-/g, '') }; case 'AU': return { routing_number: cleanedString(values[BSB]), diff --git a/src/config.js b/src/config.js index 133971d5..59af03ff 100644 --- a/src/config.js +++ b/src/config.js @@ -247,6 +247,19 @@ const stripeSupportedCountries = [ iban: true, }, }, + { + // New Zealand + code: 'NZ', + currency: 'NZD', + addressConfig: { + addressLine: true, + city: true, + postalCode: true, + }, + accountConfig: { + accountNumber: true, + }, + }, { // Portugal code: 'PT', diff --git a/src/translations/en.json b/src/translations/en.json index 9de33dc9..09695bc0 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -479,6 +479,7 @@ "PayoutDetailsForm.countryNames.IT": "Italy", "PayoutDetailsForm.countryNames.LU": "Luxembourg", "PayoutDetailsForm.countryNames.NL": "Netherlands", + "PayoutDetailsForm.countryNames.NZ": "New Zealand", "PayoutDetailsForm.countryNames.PT": "Portugal", "PayoutDetailsForm.countryNames.SE": "Sweden", "PayoutDetailsForm.countryNames.US": "United States",