File tree Expand file tree Collapse file tree 3 files changed +24
-10
lines changed Expand file tree Collapse file tree 3 files changed +24
-10
lines changed Original file line number Diff line number Diff line change 11(ns wheel.marketplace.tata-cliq.core
22 (:require [wheel.marketplace.tata-cliq.api :as tata-cliq]
3+ [wheel.marketplace.tata-cliq.order :as tata-cliq-order]
4+ [wheel.oms.client :as oms]
35 [wheel.marketplace.channel :as channel]
46 [wheel.middleware.ranging :as ranging]
57 [wheel.oms.message :as oms-message]
2426 (event/processing-failed ex id :ranging channel-id channel-name))))
2527
2628(defmethod channel /allocate-order :tata-cliq [channel-id channel-config]
27- (prn channel-id " ~~>" channel-config))
29+ (try
30+ (->> (tata-cliq/new-orders channel-config channel-id)
31+ (map tata-cliq-order/to-oms-order)
32+ (run! oms/allocate-order))
33+ (catch Throwable e
34+ (prn e))))
Original file line number Diff line number Diff line change 4141 (let [{:keys [address-info order-no order-lines payment-info]} tata-cliq-order
4242 {:keys [shipping billing]} address-info
4343 {:keys [payment-cost payment-id]} payment-info]
44- {:billing (to-oms-address billing)
45- :shipping (to-oms-address shipping)
46- :order-no order-no
47- :payments [{:amount payment-cost
48- :reference-id payment-id}]
49- :order-lines (map (fn [{:keys [article-number price]}]
50- {:id article-number
51- :sale-price price})
52- order-lines)}))
44+ {:billing-address (to-oms-address billing)
45+ :shipping-address (to-oms-address shipping)
46+ :order-no order-no
47+ :payments [{:amount payment-cost
48+ :reference-id payment-id}]
49+ :order-lines (map (fn [{:keys [article-number price]}]
50+ {:id article-number
51+ :sale-price price})
52+ order-lines)}))
5353
5454(comment
5555 (s/check-asserts true )
Original file line number Diff line number Diff line change 1+ (ns wheel.oms.client
2+ (:require [wheel.oms.order :as oms-order]
3+ [clojure.spec.alpha :as s]))
4+
5+ (defn allocate-order [order]
6+ {:pre [(s/assert ::oms-order/order order)]}
7+ (prn (oms-order/to-xml order)))
You can’t perform that action at this time.
0 commit comments