mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
parent
4bf72506d5
commit
53f4b32c33
19 changed files with 91 additions and 86 deletions
|
@ -1,4 +1,3 @@
|
|||
# rubocop:disable Layout/ElseAlignment, Layout/IndentationWidth
|
||||
class Family < ApplicationRecord
|
||||
include Plaidable, Syncable
|
||||
|
||||
|
@ -48,22 +47,22 @@ class Family < ApplicationRecord
|
|||
super || accounts.manual.any?(&:syncing?) || plaid_items.any?(&:syncing?)
|
||||
end
|
||||
|
||||
def get_link_token(webhooks_url:, redirect_url:, accountable_type: nil, region: :us)
|
||||
provider = case region
|
||||
when :eu
|
||||
self.class.plaid_eu_provider
|
||||
else
|
||||
self.class.plaid_provider
|
||||
end
|
||||
def eu?
|
||||
country != "US" && country != "CA"
|
||||
end
|
||||
|
||||
return nil unless provider
|
||||
def get_link_token(webhooks_url:, redirect_url:, accountable_type: nil, region: :us)
|
||||
provider = if region.to_sym == :eu
|
||||
self.class.plaid_eu_provider
|
||||
else
|
||||
self.class.plaid_us_provider
|
||||
end
|
||||
|
||||
provider.get_link_token(
|
||||
user_id: id,
|
||||
webhooks_url: webhooks_url,
|
||||
redirect_url: redirect_url,
|
||||
accountable_type: accountable_type,
|
||||
eu: region == :eu
|
||||
).link_token
|
||||
end
|
||||
|
||||
|
@ -238,4 +237,3 @@ class Family < ApplicationRecord
|
|||
)
|
||||
end
|
||||
end
|
||||
# rubocop:enable Layout/ElseAlignment, Layout/IndentationWidth
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue