Clojure library for the Paymill API
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Clojure library for the Paymill API.


clj-paymill is up on Clojars:

[clj-paymill "0.1.4-SNAPSHOT"]


If you haven't got a Paymill account set up but want to experiment, you can peruse the tests, wherein we somewhat filthily scrape the Paymill site to retrieve a test key. This obviously isn't guaranteed to work forever, and leaves some crud on their server, so don't overdo it.


Only very limited functionality is offered at this stage (i.e. just what I need). There are two namespaces, which is a thin wrapper around clj-http to talk to the Paymill REST API and spit JSON back out, and clj-paymill.client which is in turn a thin wrapper around that.

(ns paymill-test
  (:require [ :refer :all]
            [clj-paymill.client :refer :all]))

;; get a private key for testing 
(def key (generate-test-key))

;; create a client
(create-client! key "" "Test Testerson")

;; find them again
(get-client key (:id client))
(list-clients key {:email ""})

;; update them
(update-client! (:id client) "" "New Name")

;; create a payment (token taken from Paymill Bridge)
(create-payment! key token client)

;; create an offer
(create-offer! key "Test offer" 10 "GBP" "month")

;; list offers
(list-offers key)

;; create a subscription
(subscribe! key client payment offer)

;; check its current status
(subscription-details key (:id subscription))

;; cancel it
(cancel-subscription! key (:id subscription) true)

;; talk to other parts of the API
(paymill-request key :post "preauthorizations" {...})
(paymill-request key :get ["preauthorizations" (:id preauthorization)])