| Copyright | (c) David Johnson, 2014 |
|---|---|
| Maintainer | djohnson.m@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Web.Stripe
Description
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
Error type for Request
Types
data StripeErrorHTTPCode Source
Error Codes for HTTP Responses
Constructors
| BadRequest | 400 |
| UnAuthorized | 401 |
| RequestFailed | 402 |
| NotFound | 404 |
| StripeServerError | (>=500) |
| UnknownHTTPCode | All other codes |
Instances
data StripeErrorCode Source
Stripe Error Codes
Constructors
| IncorrectNumber | |
| InvalidNumber | |
| InvalidExpiryMonth | |
| InvalidExpiryYear | |
| InvalidCVC | |
| ExpiredCard | |
| IncorrectCVC | |
| IncorrectZIP | |
| CardDeclined | |
| Missing | |
| ProcessingError | |
| RateLimit | |
| UnknownError |
Instances