Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

EU only allows transactions Plaid product

Zach Gollwitzer89027f1fbfdd
diff --git a/app/models/provider/plaid.rb b/app/models/provider/plaid.rb
index 877a955f..f12a077d 100644
--- a/app/models/provider/plaid.rb
+++ b/app/models/provider/plaid.rb
@@ -180,6 +180,8 @@ class Provider::Plaid
end
def get_primary_product(accountable_type)
+ return "transactions" if eu?
+
case accountable_type
when "Investment"
"investments"
@@ -191,11 +193,17 @@ class Provider::Plaid
end
def get_additional_consented_products(accountable_type)
+ return [] if eu?
+
MAYBE_SUPPORTED_PLAID_PRODUCTS - [ get_primary_product(accountable_type) ]
end
+ def eu?
+ region.to_sym == :eu
+ end
+
def country_codes
- if region.to_sym == :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