https://github.com/typeable/connexpay
https://github.com/typeable/connexpay
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/typeable/connexpay
- Owner: typeable
- Created: 2023-05-24T15:13:49.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-04-25T17:31:49.000Z (9 months ago)
- Last Synced: 2025-04-25T18:29:26.158Z (9 months ago)
- Language: Haskell
- Size: 55.7 KB
- Stars: 0
- Watchers: 10
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+TITLE: Connexpay API client for Haskell
#+AUTHOR: Nick
* What
ConnexPay is a credit card payment processing provider.
* How to use this library
Here is a short example:
#+begin_src
let logf msg = Text.putStrLn ("Connexpay log: " <> msg)
cc = CreditCard ...
amount = Money @USD 5.00
vendor = Just "Best vendor out there"
httpmgr <- tlsManager
pay <- initConnexpay logf httpmgr deviceGuid cpHost True login password
runConnexpay pay $ do
sale <- authorisePayment cc amount vendor
capturePayment sale.paymentGuid
#+end_src
For more information, see Haddock docs.
NOTE:
'PaymentError' type isn't used yet, but it will after more testing.
Connexpay test environment doesn't seem to report errors adequately.
* The tool
This repo provides a command line tool to quickly test the API. You can run it with ~stack run~.
Examples:
- ~stack run -- -c ./config.yaml auth CARDNUMBER "NAME" MMYY CVV SUM~
- ~stack run -- -c ./config.yaml capture SALEGUID~
- ~stack run -- -c ./config.yaml void-auth AUTHONLYGUID~
- ~stack run -- -c ./config.yaml void-sale SALEGUID~
- ~stack run -- -c ./config.yaml void-sale SALEGUID SUM~
- ~stack run -- -c ./config.yaml cancel SALEGUID~
- ~stack run -- -c ./config.yaml return SALEGUID~
- ~stack run -- -c ./config.yaml return SALEGUID SUM~
Configuration file must include the values provided to you by Connexpay:
#+begin_src
login:
password:
device_guid:
host:
use_tls: true # Whether or not to use TLS connection
proxy_host: 127.0.0.1 # Optional, if you want to proxy your requests for debugging purposes
proxy_port: 8080
#+end_src
* Links
Credit card sales API: https://docs.connexpay.com/reference/credit-card-sales