| Copyright | (c) David Johnson, 2014 |
|---|---|
| Maintainer | djohnson.m@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Web.Stripe.Token
Description
https://stripe.com/docs/api#tokens
import Web.Stripe
import Web.Stripe.Token
main :: IO ()
main = do
let config = SecretKey "secret_key"
credit = CardNumber "4242424242424242"
em = ExpMonth 12
ey = ExpYear 2015
cvc = CVC "123"
result <- stripe config $ createCardToken cn em ey cvc
case result of
Right token -> print token
Left stripeError -> print stripeError
- createCardToken :: CardNumber -> ExpMonth -> ExpYear -> CVC -> Stripe (Token Card)
- createBankAccountToken :: Country -> RoutingNumber -> AccountNumber -> Stripe (Token BankAccount)
- getCardToken :: TokenId -> Stripe (Token Card)
- getBankAccountToken :: TokenId -> Stripe (Token BankAccount)
- newtype CardNumber = CardNumber Text
- newtype ExpMonth = ExpMonth Int
- newtype ExpYear = ExpYear Int
- newtype CVC = CVC Text
- data Token a = Token {
- tokenId :: TokenId
- tokenLiveMode :: Bool
- tokenCreated :: UTCTime
- tokenUsed :: Bool
- tokenObject :: Text
- tokenType :: TokenType
- tokenData :: a
- newtype TokenId = TokenId Text
- data TokenType
- newtype Country = Country Text
- newtype RoutingNumber = RoutingNumber Text
- newtype AccountNumber = AccountNumber Text
- data Account = Account {
- accountId :: AccountId
- accountEmail :: Email
- accountStatementDescriptor :: Maybe Description
- accountDisplayName :: Maybe Text
- accountTimeZone :: Text
- accountDetailsSubmitted :: Bool
- accountChargeEnabled :: Bool
- accountTransferEnabled :: Bool
- accountCurrenciesSupported :: [Currency]
- accountDefaultCurrency :: Currency
- accountCountry :: Text
- accountObject :: Text
- accountBusinessName :: Maybe Text
- accountBusinessURL :: Maybe Text
- accountBusinessLogo :: Maybe Text
- accountSupportPhone :: Maybe Text
API
Arguments
| :: Country | Country of the |
| -> RoutingNumber | Routing Number |
| -> AccountNumber | Account Number |
| -> Stripe (Token BankAccount) |
Create a Token for a specific BankAccount
Arguments
| :: TokenId | The |
| -> Stripe (Token BankAccount) |
Types
Expiration Month for a Card
Expiration Year for a Card
Token Object
Constructors
| Token | |
Fields
| |
Type of Token
Constructors
| TokenCard | |
| TokenBankAccount |
newtype AccountNumber Source
Account Number of a Bank Account
Constructors
| AccountNumber Text |
Instances
Account Object
Constructors