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

Safe HaskellNone

Web.Stripe.Customer

Synopsis

Documentation

data Customer Source

Represents a customer in the Stripe system.

Instances

Show Customer 
FromJSON Customer

Attempts to parse JSON into a Customer.

newtype CustomerId Source

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

Constructors

CustomerId 

Fields

unCustomerId :: Text
 

newtype Email Source

Represents a standard email address.

Constructors

Email 

Fields

unEmail :: Text
 

Instances

createCustomerByTokenId :: MonadIO m => Maybe TokenId -> Maybe CpnId -> Maybe Email -> Maybe Description -> Maybe PlanId -> Maybe Int -> StripeT m CustomerSource

Create a new Customer in the Stripe system using a TokenId.

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.

updateCustomerByTokenId :: MonadIO m => Customer -> Maybe TokenId -> Maybe CpnId -> Maybe Email -> Maybe Description -> StripeT m CustomerSource

Update an existing Customer in the Stripe system.

updateCustomerByIdByTokenId :: MonadIO m => CustomerId -> Maybe TokenId -> 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 

Fields

unDescription :: Text
 

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