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

Safe HaskellNone
LanguageHaskell98

Web.Stripe.Plan

Synopsis

Documentation

data Plan Source

Represents a plan in the Stripe system.

Instances

Show Plan 
FromJSON Plan

Attempts to parse JSON into a Plan.

data PlanInterval Source

Represents the billing cycle for a plan. If an interval identifier is not known, UnknownPlan is used to carry the original identifier supplied by Stripe.

Constructors

Monthly 
Yearly 
UnknownPlan Text 

newtype PlanId Source

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

Constructors

PlanId 

Fields

unPlanId :: Text
 

Instances

newtype PlanTrialDays Source

Represents the length of the trial period. That is, the number of days before the customer is billed.

Constructors

PlanTrialDays 

Fields

unPlanTrialDays :: Int
 

createPlan :: MonadIO m => Plan -> StripeT m () Source

Creates a Plan in the Stripe system.

getPlan :: MonadIO m => PlanId -> StripeT m Plan Source

Retrieves a specific Plan based on its PlanId.

getPlans :: MonadIO m => Maybe Count -> Maybe Offset -> StripeT m [Plan] Source

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

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

delPlan :: MonadIO m => Plan -> StripeT m Bool Source

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

delPlanById :: MonadIO m => PlanId -> StripeT m Bool Source

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

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

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.