Merge branch 'master' of bitbucket.org:brycecovertoperations/integreat
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
(defroutes routes
|
||||
(context "/events" []
|
||||
|
||||
(POST "/yodlee-import" {:keys [query-params headers body] :as x}
|
||||
(let [notification-type (get headers "x-amz-sns-message-type")]
|
||||
(println "Received notification " notification-type)
|
||||
|
||||
40
src/clj/auto_ap/routes/yodlee.clj
Normal file
40
src/clj/auto_ap/routes/yodlee.clj
Normal file
@@ -0,0 +1,40 @@
|
||||
(ns auto-ap.routes.yodlee
|
||||
(:require
|
||||
[auto-ap.graphql :as graphql]
|
||||
[clj-http.client :as http]
|
||||
|
||||
[auto-ap.yodlee.core :as yodlee]
|
||||
[auto-ap.graphql.utils :refer [->graphql assert-admin]]
|
||||
[auto-ap.routes.utils :refer [wrap-secure]]
|
||||
[clj-time.coerce :refer [to-date]]
|
||||
[auto-ap.db.invoices-expense-accounts :as expense-accounts]
|
||||
[ring.middleware.json :refer [wrap-json-response]]
|
||||
[compojure.core :refer [GET POST context defroutes wrap-routes]]
|
||||
[clojure.string :as str]
|
||||
[config.core :refer [env]]
|
||||
))
|
||||
|
||||
(defroutes routes
|
||||
(wrap-routes
|
||||
(context "/yodlee" []
|
||||
(GET "/fastlink" {:keys [query-params identity] :as request}
|
||||
(assert-admin identity)
|
||||
(let [[session token] (yodlee/get-access-token)]
|
||||
|
||||
|
||||
{:status 200
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body (pr-str {:session session
|
||||
:token token
|
||||
:app (:yodlee-app env)
|
||||
|
||||
:url (:yodlee-fastlink env)
|
||||
|
||||
}) }))
|
||||
(GET "/accounts" {:keys [query-params identity] :as request}
|
||||
(assert-admin identity)
|
||||
(let [[session token] (yodlee/get-access-token)]
|
||||
{:status 200
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body (pr-str (yodlee/get-accounts)) })))
|
||||
wrap-secure))
|
||||
Reference in New Issue
Block a user