File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 22 " Helper functions to communicate with the WooCommerce REST API's coupons endpoints.
33 These functions need authentication by `consumer_key` and `consumer_secret`.</br>
44 https://woocommerce.github.io/woocommerce-rest-api-docs/#coupons"
5- (:require [wc-api-clj.core :as woo]))
5+ (:require [wc-api-clj.core :as woo]
6+ [wc-api-clj.util :as util]))
67
78; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
89; ; Coupons REST API v3 helper functions ;;
5859 " Delete a coupon by the coupon's ID."
5960 [{:keys [url consumer_key consumer_secret coupon exception insecure]}]
6061 (try (woo/delete-req {:siteurl url
61- :uri (str " /wp-json/wc/v3/coupons/" coupon " ? force= true" )
62+ :uri (str " /wp-json/wc/v3/coupons/" coupon ( util/edn-to-query-str { : force true }) )
6263 :username consumer_key
6364 :password consumer_secret
6465 :exception (not (not exception))
Original file line number Diff line number Diff line change 22 " Helper functions to communicate with the WooCommerce REST API's orders endpoints.
33 These functions need authentication by `consumer_key` and `consumer_secret`.</br>
44 https://woocommerce.github.io/woocommerce-rest-api-docs/#orders"
5- (:require [wc-api-clj.core :as woo]))
5+ (:require [wc-api-clj.core :as woo]
6+ [wc-api-clj.util :as util]))
67
78; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
89; ; Orders REST API v3 helper functions ;;
5859 " Delete an order by the order's ID."
5960 [{:keys [url consumer_key consumer_secret order exception insecure]}]
6061 (try (woo/delete-req {:siteurl url
61- :uri (str " /wp-json/wc/v3/orders/" order " ? force= true" )
62+ :uri (str " /wp-json/wc/v3/orders/" order ( util/edn-to-query-str { : force true }) )
6263 :username consumer_key
6364 :password consumer_secret
6465 :exception (not (not exception))
Original file line number Diff line number Diff line change 22 " Helper functions to communicate with the WooCommerce REST API's products endpoints.
33 These functions need authentication by `consumer_key` and `consumer_secret`.</br>
44 https://woocommerce.github.io/woocommerce-rest-api-docs/#products"
5- (:require [wc-api-clj.core :as woo]))
5+ (:require [wc-api-clj.core :as woo]
6+ [wc-api-clj.util :as util]))
67
78; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
89; ; Products REST API v3 helper functions ;;
5859 " Delete a product by the porduct's ID."
5960 [{:keys [url consumer_key consumer_secret product exception insecure]}]
6061 (try (woo/delete-req {:siteurl url
61- :uri (str " /wp-json/wc/v3/products/" product " ? force= true" )
62+ :uri (str " /wp-json/wc/v3/products/" product ( util/edn-to-query-str { : force true }) )
6263 :username consumer_key
6364 :password consumer_secret
6465 :exception (not (not exception))
You can’t perform that action at this time.
0 commit comments