Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions venmo_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,17 @@ def paginated_get(path, options = {})
:name => "#{event["refund"]["destination"]["name"]}",
}
)


when "disbursement"
hash.merge!(
{
:date_completed => Date.parse(event["date_created"]),
:description => "#{event["type"].upcase}",
:amount => event["disbursement"]["amount"],
:name => event["disbursement"]["merchant"]["display_name"],
}
)

else
puts "⚠️ Found unknown event found. Fix directly in your CSV file.\n\n #{event} \n\n"
hash.merge!(
Expand All @@ -190,7 +200,8 @@ def paginated_get(path, options = {})
)
end

transactions << hash if hash[:date_completed] >= @last_date_to_include
date_completed = hash[:date_completed].is_a?(Date) ? hash[:date_completed] : Date.parse(hash[:date_completed])
transactions << hash if date_completed >= @last_date_to_include
}

transactions.map { |record|
Expand Down