1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 21:29:38 +02:00

Disable Plaid i18n until we support full i18n

This commit is contained in:
Zach Gollwitzer 2024-11-25 09:48:21 -05:00
parent 03e92e63a5
commit a4adfed82b
2 changed files with 3 additions and 16 deletions

View file

@ -45,8 +45,6 @@ class Family < ApplicationRecord
plaid_provider.get_link_token(
user_id: id,
country: country,
language: locale,
webhooks_url: webhooks_url,
redirect_url: redirect_url,
accountable_type: accountable_type

View file

@ -2,8 +2,6 @@ class Provider::Plaid
attr_reader :client
MAYBE_SUPPORTED_PLAID_PRODUCTS = %w[transactions investments liabilities].freeze
PLAID_COUNTRY_CODES = %w[US GB ES NL FR IE CA DE IT PL DK NO SE EE LT LV PT BE].freeze
PLAID_LANGUAGES = %w[da nl en et fr de hi it lv lt no pl pt ro es sv vi].freeze
MAX_HISTORY_DAYS = Rails.env.development? ? 90 : 730
class << self
@ -70,14 +68,14 @@ class Provider::Plaid
@client = self.class.client
end
def get_link_token(user_id:, country:, language: "en", webhooks_url:, redirect_url:, accountable_type: nil)
def get_link_token(user_id:, webhooks_url:, redirect_url:, accountable_type: nil)
request = Plaid::LinkTokenCreateRequest.new({
user: { client_user_id: user_id },
client_name: "Maybe Finance",
products: [ get_primary_product(accountable_type) ],
additional_consented_products: get_additional_consented_products(accountable_type),
country_codes: [ get_plaid_country_code(country) ],
language: get_plaid_language(language),
country_codes: [ "US" ],
language: "en",
webhook: webhooks_url,
redirect_uri: redirect_url,
transactions: { days_requested: MAX_HISTORY_DAYS }
@ -213,13 +211,4 @@ class Provider::Plaid
def get_additional_consented_products(accountable_type)
MAYBE_SUPPORTED_PLAID_PRODUCTS - [ get_primary_product(accountable_type) ]
end
def get_plaid_country_code(country_code)
PLAID_COUNTRY_CODES.include?(country_code) ? country_code : "US"
end
def get_plaid_language(locale = "en")
language = locale.split("-").first
PLAID_LANGUAGES.include?(language) ? language : "en"
end
end