Add the ability to unautopay

This commit is contained in:
2021-07-09 08:40:38 -07:00
parent 8f9d1de32e
commit 12d8aa8ad3
4 changed files with 50 additions and 6 deletions

View File

@@ -192,8 +192,8 @@
:returns (+ (- (-> order :return_amounts :total_money amount->money)
(-> order :return_amounts :tax_money amount->money)
(-> order :return_amounts :tip_money amount->money)
(-> order :return_amounts :service_charge_money amount->money)
(-> order :return_amounts :discount_money amount->money)))
(-> order :return_amounts :service_charge_money amount->money))
(-> order :return_amounts :discount_money amount->money))
:charges (->> (:tenders order)
(map (fn [t]
(remove-nils
@@ -242,13 +242,13 @@
(defn settlements [l]
(log/info "Searching for" l)
(let [settlements (->> (client/get (str "https://connect.squareup.com/v1/" l "/settlements")
(let [settlements (->> (client/get (str "https://connect.squareup.com/v1/" l "/settlements?limit=10")
{:headers {"Authorization" "Bearer EAAAEO2xSqesDutZz71hz3eulKmrlKTiEqG3uZ4j25x5GYlOluQ2cj2JxNUXqXD7"
"Content-Type" "application/json"}
:as :json})
:body
(map :id))]
(loop [[s & xs] (take 5 settlements)
(loop [[s & xs] (take 10 settlements)
result []]
(log/info "Looking up settlement " s " for location " l)
(let [n (:body (retry #(client/get (str "https://connect.squareup.com/v1/" l "/settlements/" s)