-
-
Save AeroNotix/f218770087e322a1c78c to your computer and use it in GitHub Desktop.
This file contains 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 create-trans [^Merchant merchant ^TransactionType tt] | |
(.createTransaction merchant tt)) | |
(defmacro defcustomertransactions [bindings] | |
(macros/validate-bindings bindings) | |
(let [bindings (partition 2 bindings)] | |
`(do ~@(map (fn [form] | |
`(defn `~(first ~form)) `[merchant#] | |
(create-trans `merchant# `~(second form))) | |
`~bindings)))) | |
(defcustomertransactions | |
[create-payment-profile TransactionType/CREATE_CUSTOMER_PAYMENT_PROFILE | |
create-profile TransactionType/CREATE_CUSTOMER_PROFILE | |
create-shipping-address TransactionType/CREATE_CUSTOMER_SHIPPING_ADDRESS]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment