adding yodlee vetndors.

This commit is contained in:
Bryce Covert
2019-04-16 06:30:24 -07:00
parent e81543b8af
commit 6b1252390b
10 changed files with 59 additions and 14 deletions

View File

@@ -1,5 +1,6 @@
(ns auto-ap.yodlee.core
(:require [clj-http.client :as client]
[cemerick.url :as u]
[clojure.data.json :as json]
[config.core :refer [env]]))
@@ -26,7 +27,7 @@
(defn login-user
([cob-session] (:yodlee-user-login env) (:yodlee-user-password env))
([cob-session] (login-user cob-session "sbMemda48aa19712a83c3ca4e935dd5e5d46b1a2" "sbMemda48aa19712a83c3ca4e935dd5e5d46b1a2#123"))
([cob-session user password]
(-> (str (:yodlee-base-url env) "/user/login")
(client/post {:headers (merge base-headers {"Authorization" (auth-header cob-session)})
@@ -75,7 +76,7 @@
batch-size 100
get-transaction-batch (fn [skip]
(-> (str (:yodlee-base-url env) "/transactions?top=" batch-size "&skip=" skip)
(doto println)
(client/get {:headers (doto
(merge base-headers {"Authorization" (auth-header cob-session user-session)})
@@ -146,7 +147,6 @@
batch-size 100
get-transaction-batch (fn [skip]
(-> (str (:yodlee-base-url env) "/transactions?top=" batch-size "&skip=" skip "&accountId=" account)
(doto println)
(client/get {:headers (doto
(merge base-headers {"Authorization" (auth-header cob-session user-session)})

View File

@@ -53,7 +53,7 @@
{amount :amount} :amount
{description-original :original
description-simple :simple} :description
{merchant-id :i
{merchant-id :id
merchant-name :name} :merchant
base-type :baseType
type :type
@@ -73,6 +73,10 @@
:id (sha-256 (str id))
:account-id account-id
:date (coerce/to-date (time/parse date "YYYY-MM-dd"))
:yodlee-merchant (when (and merchant-id merchant-name)
(println "INCLUDING MERCHANT")
{:yodlee-merchant/id merchant-id
:yodlee-merchant/name merchant-name})
:amount (double amount)
:description-original description-original
:description-simple description-simple