not really known
Go to file
2024-09-25 11:44:23 +03:00
connexpay typo 2024-09-09 10:23:03 +03:00
connexpay-optparse Cli stuff. 2024-04-09 00:07:13 +00:00
README.org Void via auth or sale guids 2024-08-22 10:32:43 +03:00
stack.yaml Fix token update code. 2024-06-05 14:45:47 +00:00

Connexpay API client for Haskell

What

ConnexPay is a credit card payment processing provider.

How to use this library

Here is a short example:

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

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:

login: <login>
password: <password>
device_guid: <device guid>
host: <hostname>

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