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

Safe HaskellNone

Web.Stripe.Token

Synopsis

Documentation

data Token Source

Represents a token in the Stripe system.

Constructors

Token 

Instances

Show Token 
FromJSON 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 :: Text
 

Instances

createToken :: MonadIO m => RequestCard -> 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.

tokRq :: [Text] -> StripeRequestSource

Convenience function to create a StripeRequest specific to tokens.

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 
FromJSON 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 :: Text
 

Instances

data StripeConfig Source

Configuration for the StripeT monad transformer.

newtype StripeT m a Source

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

runStripeT :: MonadIO m => StripeConfig -> StripeT m a -> m (Either StripeFailure a)Source

Runs the StripeT monad transformer with a given StripeConfig. 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.