Last active
June 25, 2020 09:53
-
-
Save joncol/5976485fa7b2454dd164838004908d6c to your computer and use it in GitHub Desktop.
pr-suggestion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn get-callback-success [request id] | |
(jdbc/with-db-transaction [db (-> request :opts :db)] | |
(let [config (-> request :opts :config) | |
boundaries (-> request :opts :boundaries) | |
merchant (:merchant boundaries) | |
mantis (:mantis boundaries) | |
deposit (db/get-deposit db {:id id}) | |
identification (delay (db/get-identification db {:id id})) | |
withdrawal (delay (update-withdrawal! (:opts request) id))] | |
(cond | |
deposit (get-deposit-success db boundaries deposit) | |
@identification (get-identification-success db mantis merchant @identification) | |
@withdrawal (get-withdrawal-success merchant @withdrawal) | |
:else (resp/not-found {:error "No such ID!"}))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment