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

Web.Stripe.Customer

Synopsis

Documentation

data Customer Source

Represents a customer in the Stripe system.

Instances

Show Customer 
JSON Customer

Attempts to parse JSON into a Customer.

newtype CustomerId Source

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

Constructors

CustomerId 

Fields

unCustomerId :: String
 

Instances

newtype Email Source

Represents a standard email address.

Constructors

Email 

Fields

unEmail :: String
 

Instances

updateCustomer :: MonadIO m => Customer -> Maybe RequestCard -> Maybe CpnId -> Maybe Email -> Maybe Description -> StripeT m CustomerSource

Update an existing Customer in the Stripe system.

updateCustomerById :: MonadIO m => CustomerId -> Maybe RequestCard -> Maybe CpnId -> Maybe Email -> Maybe Description -> StripeT m CustomerSource

Update an existing Customer, identified by CustomerId, in the Stripe system.

getCustomer :: MonadIO m => CustomerId -> StripeT m CustomerSource

Retrieves a specific Customer based on its CustomerId.

getCustomers :: MonadIO m => Maybe Count -> Maybe Offset -> StripeT m [Customer]Source

Retrieves a list of all Customers. The query can optionally be refined to a specific:

  • number of charges, via Count and * page of results, via Offset.

delCustomer :: MonadIO m => Customer -> StripeT m BoolSource

Deletes a Customer if it exists. If it does not, an InvalidRequestError will be thrown indicating this.

delCustomerById :: MonadIO m => CustomerId -> StripeT m BoolSource

Deletes a Customer, identified by its CustomerId, if it exists. If it does not, an InvalidRequestError will be thrown indicating this.

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 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

newtype Description Source

Describes an object in the Stripe system.

Constructors

Description 

Instances

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)

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.