Liking cljdoc? Tell your friends :D


A client for Comgate Payments API.

CircleCI Dependencies Status License


[clj-comgate "0.2.0"]


All functions are designed to return errors instead of throwing exceptions.

All API calls return a tuple within following structure: [keyword response http-response] wherekeyword can be:

  • :ok when a response is a success and parsed
  • :error when a response is parsed but it's an error response
  • :error-unmarshalling when a response is not a well formated

A response is a parsed body of an original HTTP response.

To be able to run examples this line is needed:

(require '[clj-comgate.core :as comgate])


Creates a new payment within opts.

(comgate/create-payment {:merchant "asdf", :secret "qwerty", :price 10000, ...})
;; [:ok
;;  {:code 0, :message "OK", :redirect "
;;  {:request-time 386, ...

To see all possible options see

Example of an error response:

(comgate/create-payment {:merchant "asdf", :secret "qwerty", :price 10000, ...})
;; [:error
;;  {:code 1400, :message "Access from unauthorized location []!"
;;  {:request-time 386, ...


Returns a status of requested payment by opts.

(comgate/get-status {:merchant "asdf", :secret "qwerty", :transId "AAAA-BBBB-CCCC"})
;; [:ok
;;  {:code 0, :label "Test label", :message "OK", ...
;;  {:request-time 386, ...


In case you want to handle the push payment result you can use payment-result-response->map to parse a request body:

(:body request) ;; a Ring request "merchant=merchant_com&test=false&price=10000...
(comgate/payment-result-response->map (:body request)) ;; {:merchant "merchant_com", ...

When accepting the push request Comgate expects OK response, thus you can use comgate/payment-result-success-response for it (it's a Ring's response).

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close