Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial pass at Plaid EU #1555

Merged
merged 11 commits into from
Jan 31, 2025
Merged

Initial pass at Plaid EU #1555

merged 11 commits into from
Jan 31, 2025

Conversation

Shpigford
Copy link
Member

No description provided.

@Shpigford Shpigford requested a review from zachgoll December 18, 2024 17:04
@Shpigford
Copy link
Member Author

@zachgoll First high-level pass at adding EU support. You've got a better handle of how the Plaid stuff works, so let me know if I'm off base here.

Copy link
Collaborator

@zachgoll zachgoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reached out to Plaid and they said there is no way to figure out whether an "Item" is US or EU just based on the Plaid Item data.

So the biggest thing we're missing currently here is that identifying piece of data stored on PlaidItem. I think since there are only 2 possible clients, we could consider a field called plaid_region that is a string and in our model we could probably validate that too:

class PlaidItem < ApplicationRecord
  enum :plaid_region, { us: "us", eu: "eu" }
end

Which would then allow us to easily access it like, some_item.eu?

Otherwise, I think EU should work largely the same as US and I believe our existing implementation will properly handle these multi-currency accounts fine.

.env.example Outdated Show resolved Hide resolved
db/schema.rb Outdated Show resolved Hide resolved
app/models/concerns/plaidable.rb Show resolved Hide resolved
app/views/accounts/new/_method_selector.html.erb Outdated Show resolved Hide resolved
@Shpigford
Copy link
Member Author

@zachgoll Take a look now.

@Shpigford Shpigford requested a review from zachgoll December 19, 2024 15:20
Copy link
Collaborator

@zachgoll zachgoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I like this strategy of passing it from the Stimulus controller. Should work nicely!

db/schema.rb Outdated Show resolved Hide resolved
app/controllers/plaid_items_controller.rb Show resolved Hide resolved
app/models/plaid_item.rb Outdated Show resolved Hide resolved
@Shpigford Shpigford marked this pull request as ready for review January 31, 2025 17:09
@Shpigford
Copy link
Member Author

@zachgoll Two things I'm not sure on...

  1. Do we need to add Canada ("CA") to the region stuff? Or will "US" properly cover it thanks to get_country_codes?
  2. There are failing system tests that I'm not familiar enough with to not potentially completely break them.

@Shpigford Shpigford requested a review from zachgoll January 31, 2025 17:10
Copy link
Collaborator

@zachgoll zachgoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Shpigford to my understanding, you have the CA configuration correct here. I believe CA is fully covered under the "US" client:

CleanShot 2025-01-31 at 12 19 42

@Shpigford
Copy link
Member Author

@zachgoll ✅ Anything else before merging this?

@zachgoll
Copy link
Collaborator

@Shpigford I think we're all set. Only thing I can think of is making sure these are set in prod:

PLAID_EU_CLIENT_ID=
PLAID_EU_SECRET=

@Shpigford Shpigford merged commit 4bf7250 into main Jan 31, 2025
5 checks passed
@Shpigford Shpigford deleted the plaid-eu branch January 31, 2025 18:14
@henrikbjorn
Copy link

Not to hijack, but would GoCardless be an idea also? That is easily obtainable for self-hosting.

@Shpigford
Copy link
Member Author

Not to hijack, but would GoCardless be an idea also? That is easily obtainable for self-hosting.

#141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants