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

Safe HaskellNone

Web.Stripe.Utils

Synopsis

Documentation

newtype CustomerId Source

Represents a 'Customer'\'s ID in the Stripe system.

Constructors

CustomerId 

Fields

unCustomerId :: Text
 

newtype Amount Source

Represents an amount in cents in the Stripe system.

Constructors

Amount 

Fields

unAmount :: Int
 

Instances

newtype Count Source

A maximum number of objects that the Stripe API will return. This value should be between 1 and 100, inclusive.

Constructors

Count 

Fields

unCount :: Int
 

Instances

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

newtype Description Source

Describes an object in the Stripe system.

Constructors

Description 

Fields

unDescription :: Text
 

newtype Offset Source

A positive integer that is an offset into the array of objects returned by the Stripe API.

Constructors

Offset 

Fields

unOffset :: Int
 

Instances

optionalArgs :: [(a, Maybe b)] -> [(a, b)]Source

Takes a list of key-value arguments, where the value is optional, and returns a list of key-value pairs with only the supplied values.

Essentially, this filters out all Nothings and unwraps the Justs.

>>> optionalArgs [("k1", Just "supplied"), ("k2", Nothing)]
[("k1","supplied")]

fromSeconds :: Integer -> UTCTimeSource

Convert a time in seconds (from Stripe's servers) to UTCTime. See Data.Time.Format for more on working with UTCTime.

toSeconds :: UTCTime -> IntegerSource

Convert a UTCTime back to an Integer suitable for use with Stripe's API.