1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 20:15:22 +02:00

Initial pass at Plaid EU (#1555)

* Initial pass at Plaid EU

* Add EU support to Plaid Items

* Lint

* Temp fix for rubocop isseus

* Merge cleanup

* Pass in region and get tests passing

* Use absolute path for translation

---------

Signed-off-by: Josh Pigford <josh@joshpigford.com>
This commit is contained in:
Josh Pigford 2025-01-31 12:13:58 -06:00 committed by GitHub
parent 41873de11d
commit 4bf72506d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 81 additions and 21 deletions

View file

@ -68,13 +68,13 @@ class Provider::Plaid
@client = self.class.client
end
def get_link_token(user_id:, webhooks_url:, redirect_url:, accountable_type: nil)
def get_link_token(user_id:, webhooks_url:, redirect_url:, accountable_type: nil, eu: false)
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: [ "US", "CA" ],
country_codes: get_country_codes(eu),
language: "en",
webhook: webhooks_url,
redirect_uri: redirect_url,
@ -198,4 +198,12 @@ class Provider::Plaid
def get_additional_consented_products(accountable_type)
MAYBE_SUPPORTED_PLAID_PRODUCTS - [ get_primary_product(accountable_type) ]
end
def get_country_codes(eu)
if eu
[ "ES", "NL", "FR", "IE", "DE", "IT", "PL", "DK", "NO", "SE", "EE", "LT", "LV", "PT", "BE" ] # EU supported countries
else
[ "US", "CA" ] # US + CA only
end
end
end