| Copyright | (c) David Johnson, 2014 |
|---|---|
| Maintainer | [email protected] |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Web.Stripe.Client.HttpStreams
Contents
Description
- stripe :: FromJSON (StripeReturn a) => StripeConfig -> StripeRequest a -> IO (Either StripeError (StripeReturn a))
- stripeConn :: FromJSON (StripeReturn a) => Connection -> StripeConfig -> StripeRequest a -> IO (Either StripeError (StripeReturn a))
- withConnection :: (Connection -> IO (Either StripeError a)) -> IO (Either StripeError a)
- data StripeRequest a :: * -> * = StripeRequest {}
- data StripeError :: * = StripeError {}
- data StripeConfig :: * = StripeConfig {}
- callAPI :: Connection -> (Value -> Result b) -> StripeConfig -> StripeRequest a -> IO (Either StripeError b)
Documentation
stripe :: FromJSON (StripeReturn a) => StripeConfig -> StripeRequest a -> IO (Either StripeError (StripeReturn a)) Source
Create a request to Stripe's API
stripeConn :: FromJSON (StripeReturn a) => Connection -> StripeConfig -> StripeRequest a -> IO (Either StripeError (StripeReturn a)) Source
Create a request to Stripe's API using a connection opened
with withConnection
withConnection :: (Connection -> IO (Either StripeError a)) -> IO (Either StripeError a) Source
Open a connection to the stripe API server
data StripeRequest a :: * -> *
Stripe Request holding Method, URL and Params for a Request. Also
includes the function needed to decode the response.
Constructors
| StripeRequest | |
low-level
Arguments
| :: Connection | an open connection to the server ( |
| -> (Value -> Result b) | function to convert JSON result to Haskell Value |
| -> StripeConfig | StripeConfig |
| -> StripeRequest a | StripeRequest |
| -> IO (Either StripeError b) |
Create a request to Stripe's API over an existing connection
see also: withConnection
FIXME: all connection errors should be
turned into a StripeError. But that is not yet implemented.
NOTES: this a pretty low-level function. You probably want stripe
or stripeConn. If you call this function directly, you are
responsible for ensuring the JSON conversion function supplied is
correct for StripeRequest. In the rest of the library this
property is enforced automatically by the type-system. But adding
that constraint here made implementing the Stripe testing monad
difficult.