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

refactor: plaid connection #42962

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Conversation

batonac
Copy link
Contributor

@batonac batonac commented Aug 28, 2024

This makes the plaid bank connector much more performant and less error-prone.

  • plaid_access_token is updated in the database directly via frappe.db.set_value instead of attempting to loading and save the Bank doc.
  • The try/except clause in add_institution is expanded to include all updates to the plaid_access_token, to catch any errors related to the given bank_name
  • add_institution is refactored to return just the bank_name instead of the bank doc, since only the bank_name is used in the subsequent add_bank_accounts function.
  • Throw a dedicated error if bank_name is not returned in the Plaid response.

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Aug 28, 2024
Copy link

stale bot commented Sep 14, 2024

This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.

@stale stale bot added the inactive label Sep 14, 2024
@batonac
Copy link
Contributor Author

batonac commented Sep 14, 2024

Can I get a review please?

@stale stale bot removed the inactive label Sep 14, 2024
@batonac
Copy link
Contributor Author

batonac commented Sep 16, 2024

@ankush, @deepeshgarg007, @casesolved-co-uk, any comments to help this move forward?

@casesolved-co-uk
Copy link
Contributor

  1. Plaid have withdrawn their free access via their development environment, so their lowest production plan is around $1500 per month making this integration pretty pointless unless you're setting up as a data warehouse
  2. There's nothing broken; working, tested, mature code is always better than new untested unnecessary changes

@batonac
Copy link
Contributor Author

batonac commented Sep 16, 2024

Thanks for the review @casesolved-co-uk.

Re:

  1. Plaid have withdrawn their free access via their development environment, so their lowest production plan is around $1500 per month making this integration pretty pointless unless you're setting up as a data warehouse

I think you might be misunderstanding Plaid's new fee structure. At least here in the US, they're charging $0.3/account/mo for production access to Transaction Sync.

  1. There's nothing broken; working, tested, mature code is always better than new untested unnecessary changes

Plaid doesn't always return a bank account from Plaid.create--sometimes there's an error. The existing code has no error handling for this scenario. What's broken in that case is the user experience.

@casesolved-co-uk
Copy link
Contributor

I guess their UK offering is different to the US then.
I suggest you post a bug with an error log that your PR fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants