better way of keeping transactions up to date
This commit is contained in:
@@ -13,24 +13,3 @@
|
||||
[clojure.tools.logging :as log]
|
||||
[unilog.context :as lc])
|
||||
(:import (org.joda.time DateTime)))
|
||||
|
||||
(defroutes routes
|
||||
(context "/events" []
|
||||
|
||||
(POST "/yodlee-import" {:keys [query-params headers body] :as x}
|
||||
(lc/with-context {:source "Import yodlee transactions"}
|
||||
(let [notification-type (get headers "x-amz-sns-message-type")]
|
||||
(log/info "Received notification " notification-type)
|
||||
(if (= "SubscriptionConfirmation" notification-type)
|
||||
(do
|
||||
(log/info "Responding to confirmation" )
|
||||
(let [json (json/read-str (slurp body))]
|
||||
(log/info json)
|
||||
(http/get (get json "SubscribeURL"))))
|
||||
(do
|
||||
(log/info "importing from yodlee")
|
||||
(yodlee-import/do-import)))))
|
||||
|
||||
{:status 200
|
||||
:body "{}"
|
||||
:headers {"Content-Type" "application/edn"}})))
|
||||
|
||||
Reference in New Issue
Block a user