Copyright | (c) David Johnson, 2014 |
---|---|
Maintainer | djohnson.m@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
import Web.Stripe import Web.Stripe.Account main :: IO () main = do let config = SecretKey "secret_key" result <- stripe config getAccountDetails case result of Right details -> print details Left stripeError -> print stripeError
- stripe :: FromJSON a => StripeConfig -> Stripe a -> IO (Either StripeError a)
- type Stripe a = EitherT StripeError (ReaderT (StripeConfig, Connection) IO) a
- data StripeConfig = StripeConfig {}
- data StripeErrorHTTPCode
- data StripeErrorType
- data StripeErrorCode
- data StripeError = StripeError {}
Execute a Stripe
action
stripe :: FromJSON a => StripeConfig -> Stripe a -> IO (Either StripeError a) Source
Create a request to Stripe
's API
Stripe
Monad
type Stripe a = EitherT StripeError (ReaderT (StripeConfig, Connection) IO) a Source
The Stripe
Monad
Stripe
Secret Key
Types
data StripeErrorHTTPCode Source
Error Codes for HTTP Responses
BadRequest | 400 |
UnAuthorized | 401 |
RequestFailed | 402 |
NotFound | 404 |
StripeServerError | (>=500) |
UnknownHTTPCode | All other codes |
data StripeErrorType Source
Stripe Error Types
data StripeErrorCode Source
Stripe Error Codes