Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type AccountID = String
- data AccountsResponse = AccountsResponse {}
- data Account = Account {}
- accountID :: Account -> String
- data Balance = Balance {}
- data DeclineReason
- data Address = Address {}
- data Merchant = Merchant {}
- data Transactions = Transactions {
- transactions :: [Transaction]
- data TransactionResponse = TransactionResponse {}
- data Transaction = Transaction {
- transactionAccountBalance :: Integer
- transactionAmount :: Integer
- transactionCreated :: String
- transactionCurrency :: String
- transactionDescription :: String
- transactionID :: String
- transactionDeclineReason :: Maybe DeclineReason
- transactionIsLoad :: Bool
- transactionSettled :: Bool
- transactionCategory :: Maybe String
- transactionMerchant :: Merchant
- data MondoAuth
- mondoAuthReq :: String -> Req -> Req
- data MondoAccount
- type MondoAPI = (MondoAuth :> ("accounts" :> Get `[JSON]` AccountsResponse)) :<|> ((MondoAuth :> ("balance" :> (QueryParam "account_id" AccountID :> Get `[JSON]` Balance))) :<|> ((MondoAuth :> ("transactions" :> (Capture "transaction_id" String :> Get `[JSON]` TransactionResponse))) :<|> (MondoAuth :> ("transactions" :> (QueryParam "account_id" AccountID :> Get `[JSON]` Transactions)))))
- mondoAPI :: Proxy MondoAPI
- mondoURL :: BaseUrl
- type Mondo = ReaderT String (ReaderT Manager (ExceptT ServantError IO))
- withMondo :: String -> Mondo a -> IO (Either ServantError a)
- credential :: Mondo String
- manager :: Mondo Manager
- api :: Manager -> (:<|>) (String -> ExceptT ServantError IO AccountsResponse) ((:<|>) (String -> Maybe [Char] -> ExceptT ServantError IO Balance) ((:<|>) (String -> [Char] -> ExceptT ServantError IO TransactionResponse) (String -> Maybe [Char] -> ExceptT ServantError IO Transactions)))
- getAccounts :: Mondo AccountsResponse
- getBalance :: String -> Mondo Balance
- getTransaction :: String -> Mondo Transaction
- getTransactions :: AccountID -> Mondo Transactions
- class GetNth n a b | n a -> b where
Documentation
data AccountsResponse Source
data DeclineReason Source
Enumerates reasons which cause transactions to be declined.
Address | |
|
data Transactions Source
data Transaction Source
mondoAuthReq :: String -> Req -> Req Source
data MondoAccount Source
type MondoAPI = (MondoAuth :> ("accounts" :> Get `[JSON]` AccountsResponse)) :<|> ((MondoAuth :> ("balance" :> (QueryParam "account_id" AccountID :> Get `[JSON]` Balance))) :<|> ((MondoAuth :> ("transactions" :> (Capture "transaction_id" String :> Get `[JSON]` TransactionResponse))) :<|> (MondoAuth :> ("transactions" :> (QueryParam "account_id" AccountID :> Get `[JSON]` Transactions))))) Source
A type representing the Mondo API.
api :: Manager -> (:<|>) (String -> ExceptT ServantError IO AccountsResponse) ((:<|>) (String -> Maybe [Char] -> ExceptT ServantError IO Balance) ((:<|>) (String -> [Char] -> ExceptT ServantError IO TransactionResponse) (String -> Maybe [Char] -> ExceptT ServantError IO Transactions))) Source
getBalance :: String -> Mondo Balance Source