stripe-haskell-0.1.0.5: Stripe API for Haskell

Copyright(c) David Johnson, 2014
Maintainerdjohnson.m@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Web.Stripe.Token

Contents

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

Synopsis

API

createCardToken Source

Arguments

:: CardNumber

Card Number

-> ExpMonth

Card Expiration Month

-> ExpYear

Card Expiration Year

-> CVC

Card CVC

-> Stripe (Token Card) 

Create a Token by specifiying Credit Card information

createBankAccountToken Source

Arguments

:: Country

Country of the BankAccount Token to retrieve

-> RoutingNumber

Routing Number

-> AccountNumber

Account Number

-> Stripe (Token BankAccount) 

Create a Token for a specific BankAccount

getCardToken Source

Arguments

:: TokenId

The TokenId of the Card Token to retrieve

-> Stripe (Token Card) 

Retrieve a Token by TokenId

getBankAccountToken Source

Arguments

:: TokenId

The TokenId of the BankAccount Token to retrieve

-> Stripe (Token BankAccount) 

Retrieve a Token by TokenId

Types

newtype CardNumber Source

Number associated with a Card

Constructors

CardNumber Text 

newtype ExpMonth Source

Expiration Month for a Card

Constructors

ExpMonth Int 

Instances

newtype ExpYear Source

Expiration Year for a Card

Constructors

ExpYear Int 

Instances

newtype CVC Source

CVC for a Card

Constructors

CVC Text 

Instances

data Token a Source

Token Object

Instances

Eq a => Eq (Token a) 
Show a => Show (Token a) 
FromJSON a => FromJSON (Token a)

JSON Instance for Token

newtype TokenId Source

Constructors

TokenId Text 

Instances

data TokenType Source

Type of Token

Instances

newtype Country Source

Country

Constructors

Country Text 

Instances

newtype RoutingNumber Source

Routing Number for Bank Account

Constructors

RoutingNumber Text 

newtype AccountNumber Source

Account Number of a Bank Account

Constructors

AccountNumber Text