1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 23:45:21 +02:00

Fix Plaid merchant assignments

This commit is contained in:
Zach Gollwitzer 2025-04-16 16:03:39 -04:00
parent 9260c5ef03
commit d60d57f10f

View file

@ -139,18 +139,14 @@ class PlaidAccount < ApplicationRecord
return nil
end
merchant = ProviderMerchant.find_or_initialize_by(
ProviderMerchant.find_or_create_by!(
source: "plaid",
provider_merchant_id: plaid_txn.merchant_entity_id,
).tap do |m|
website_url: plaid_txn.website
) do |m|
m.name = plaid_txn.merchant_name
m.logo_url = plaid_txn.logo_url
m.website_url = plaid_txn.website
end
merchant.save!
merchant
end
def derive_plaid_cash_balance(plaid_balances)