erpnext
erpnext copied to clipboard
refactor: plaid connection
This makes the plaid bank connector much more performant and less error-prone.
-
plaid_access_token
is updated in the database directly viafrappe.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 theplaid_access_token
, to catch any errors related to the givenbank_name
-
add_institution
is refactored to return just thebank_name
instead of the bank doc, since only thebank_name
is used in the subsequentadd_bank_accounts
function. - Throw a dedicated error if
bank_name
is not returned in the Plaid response.