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)
- stripeRaw :: FromJSON a => StripeConfig -> StripeRequest -> IO (Either StripeError a)
- type Stripe = EitherT StripeError (ReaderT (StripeConfig, Connection) IO)
- data StripeConfig = StripeConfig {}
- data StripeRequest = StripeRequest {
- method :: Method
- endpoint :: Text
- queryParams :: Params
- 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
Execute a custom Stripe
action (build your own, useful if
stripeRaw :: FromJSON a => StripeConfig -> StripeRequest -> IO (Either StripeError a) Source
Create a custom request to Stripe
's API, Build your own!
Useful if you're using an old api) !
Stripe
Monad
type Stripe = EitherT StripeError (ReaderT (StripeConfig, Connection) IO) Source
The Stripe
Monad
Stripe
Secret Key
Stripe
Request creator
data StripeRequest Source
Stripe Request holding Method
, URL and Params
for a Request
StripeRequest | |
|
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