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:
parent
9260c5ef03
commit
d60d57f10f
1 changed files with 3 additions and 7 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue