git.iko.soy/typeable/connexpay
on raw-logging help sign in
typeable/connexpay/README.org
60 lines 1.8 kB history raw
1#+TITLE: Connexpay API client for Haskell
2#+AUTHOR: Nick <nick@typeable.io>
4* What
6ConnexPay is a credit card payment processing provider.
8* How to use this library
10Here is a short example:
12#+begin_src
13let logf msg = Text.putStrLn ("Connexpay log: " <> msg)
14 cc = CreditCard ...
15 amount = Money @USD 5.00
16 vendor = Just "Best vendor out there"
17httpmgr <- tlsManager
18pay <- initConnexpay logf httpmgr deviceGuid cpHost True login password
20runConnexpay pay $ do
21 sale <- authorisePayment cc amount vendor
22 capturePayment sale.paymentGuid
23#+end_src
25For more information, see Haddock docs.
27NOTE:
28'PaymentError' type isn't used yet, but it will after more testing.
29Connexpay test environment doesn't seem to report errors adequately.
31* The tool
33This repo provides a command line tool to quickly test the API. You can run it with ~stack run~.
34Examples:
36 - ~stack run -- -c ./config.yaml auth CARDNUMBER "NAME" MMYY CVV SUM~
37 - ~stack run -- -c ./config.yaml capture SALEGUID~
38 - ~stack run -- -c ./config.yaml void-auth AUTHONLYGUID~
39 - ~stack run -- -c ./config.yaml void-sale SALEGUID~
40 - ~stack run -- -c ./config.yaml void-sale SALEGUID SUM~
41 - ~stack run -- -c ./config.yaml cancel SALEGUID~
42 - ~stack run -- -c ./config.yaml return SALEGUID~
43 - ~stack run -- -c ./config.yaml return SALEGUID SUM~
45Configuration file must include the values provided to you by Connexpay:
47#+begin_src
48login: <login>
49password: <password>
50device_guid: <device guid>
51host: <hostname>
53use_tls: true # Whether or not to use TLS connection
54proxy_host: 127.0.0.1 # Optional, if you want to proxy your requests for debugging purposes
55proxy_port: 8080
56#+end_src
58* Links
60Credit card sales API: https://docs.connexpay.com/reference/credit-card-sales