From 258a7ac0214aeac0a3651a008ffa18947d0c1752 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Sun, 26 Jun 2022 10:59:40 -0700 Subject: [PATCH] fixing two bugs. --- src/clj/auto_ap/square/core.clj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/clj/auto_ap/square/core.clj b/src/clj/auto_ap/square/core.clj index 8292abdb..b34fd12b 100644 --- a/src/clj/auto_ap/square/core.clj +++ b/src/clj/auto_ap/square/core.clj @@ -178,7 +178,8 @@ (remove-nils #:charge {:type-name (:type t) - :external-id (str "square/charge/" (:id t)) + :external-id (when (:payment_id t) + (str "square/charge/" (:payment_id t))) :processor (condp = (some-> (:note t) str/lower-case) "doordash" :ccp-processor/doordash "dd" :ccp-processor/doordash @@ -486,7 +487,7 @@ (map (fn [x] [:db/retractEntity x])))) (defn upsert-all [] - (doseq [client ((get-square-clients)) + (doseq [client (get-square-clients) :when (seq (filter :square-location/client-location (:client/square-locations client)))] (lc/with-context {:client (:client/code client)} (upsert-locations client)