Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@AeroNotix
Created January 20, 2014 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AeroNotix/f218770087e322a1c78c to your computer and use it in GitHub Desktop.
Save AeroNotix/f218770087e322a1c78c to your computer and use it in GitHub Desktop.
(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