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:
parent
41873de11d
commit
4bf72506d5
15 changed files with 81 additions and 21 deletions
|
@ -1,3 +1,4 @@
|
|||
# rubocop:disable Layout/ElseAlignment, Layout/IndentationWidth
|
||||
class Family < ApplicationRecord
|
||||
include Plaidable, Syncable
|
||||
|
||||
|
@ -47,14 +48,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)
|
||||
return nil unless plaid_provider
|
||||
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
|
||||
|
||||
plaid_provider.get_link_token(
|
||||
return nil unless provider
|
||||
|
||||
provider.get_link_token(
|
||||
user_id: id,
|
||||
webhooks_url: webhooks_url,
|
||||
redirect_url: redirect_url,
|
||||
accountable_type: accountable_type
|
||||
accountable_type: accountable_type,
|
||||
eu: region == :eu
|
||||
).link_token
|
||||
end
|
||||
|
||||
|
@ -229,3 +238,4 @@ class Family < ApplicationRecord
|
|||
)
|
||||
end
|
||||
end
|
||||
# rubocop:enable Layout/ElseAlignment, Layout/IndentationWidth
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue