Add instance Exception.
commit762da31b0fe1db105a6b7f09a8aa471874b569e2
authorNick <nick@typeable.io>
dateMon 6 May 2024, 14:08 (2 years ago)
parentff0dd02
connexpay/src/Tool.hs+2−1
@@ -75,7 +75,8 @@ main = do cmdLine <- execParser (info cmdParser mempty)
7575 Right cpi -> print =<< runConnexpay cpi (doThing cmdLine.operation)
7676
7777doThing :: Command -> ConnexpayM ()
78−doThing (AuthSale cc amt) = liftIO . print =<< authorisePayment cc usd Nothing Nothing
78+doThing (AuthSale cc amt) = liftIO . print =<< authorisePayment cc usd (Just pnr) Nothing
7979 where usd = Money amt
80+ pnr = "PNRPNR"
8081doThing (VoidSale guid) = liftIO . print =<< voidPayment guid Nothing
8182doThing (CaptureSale guid) = liftIO . print =<< capturePayment guid
connexpay/src/Web/Connexpay/Data.hs+3
@@ -8,6 +8,7 @@ module Web.Connexpay.Data ( TransactionStatus(..)
88 , ErrorMessage(..)
99 ) where
1010
11+import Control.Exception
1112import Data.Aeson
1213import Data.Aeson.Types
1314import Data.Maybe (fromMaybe)
@@ -84,3 +85,5 @@ data ConnectionError = ParseError String
8485data ConnexpayError = ConnectionError ConnectionError
8586 | PaymentFailure PaymentFailure
8687 deriving (Show)
88+
89+instance Exception ConnexpayError