stripe-0.1: A Haskell implementation of the Stripe API.

Web.Stripe.Token

Synopsis

Documentation

data Token Source

Represents a token in the Stripe system.

Instances

Show Token 
JSON Token

Attempts to parse JSON into a Token.

newtype TokenId Source

Represents the identifier for a given Token in the Stripe system.

Constructors

TokenId 

Fields

unTokenId :: String
 

Instances

createToken :: MonadIO m => RequestCard -> Maybe Amount -> Maybe Currency -> StripeT m TokenSource

Creates a Token in the Stripe system.

getToken :: MonadIO m => TokenId -> StripeT m TokenSource

Retrieves a specific Token based on its Token.

data UTCTime

This is the simplest representation of UTC. It consists of the day number, and a time offset from midnight. Note that if a day has a leap second added to it, it will have 86401 seconds.

Constructors

UTCTime 

Fields

utctDay :: Day

the day

utctDayTime :: DiffTime

the time from midnight, 0 <= t < 86401s (because of leap-seconds)

newtype Amount Source

Represents an amount in cents in the Stripe system.

Constructors

Amount 

Fields

unAmount :: Int
 

Instances

data Card Source

Represents a credit card in the Stripe system.

Instances

Show Card 
JSON Card

Attempts to parse JSON into a credit Card.

newtype Currency Source

Represents a currency (e.g., usd) in the Stripe system. This is a 3-letter ISO code.

Constructors

Currency 

Fields

unCurrency :: String
 

Instances

data SConfig Source

Configuration for the StripeT monad transformer.

Constructors

SConfig 

Fields

key :: APIKey
 
caFile :: FilePath
 

newtype StripeT m a Source

Defines the monad transformer under which all Stripe REST API resource calls take place.

Constructors

StripeT (StateT SConfig (ErrorT SFailure m) a) 

runStripeT :: MonadIO m => SConfig -> StripeT m a -> m (Either SFailure a)Source

Runs the StripeT monad transformer with a given SConfig. This will handle all of the authorization dance steps necessary to utilize the Stripe API.

Its use is demonstrated in other functions, such as query.