Safe Haskell | None |
---|
- data Subscription = Subscription {}
- newtype SubscriptionId = SubscriptionId {}
- data SubStatus
- newtype SubProrate = SubProrate {
- unSubProrate :: Bool
- newtype SubTrialEnd = SubTrialEnd {
- unSubTrialEnd :: Int
- newtype SubAtPeriodEnd = SubAtPeriodEnd {}
- data SubscriptionList = SubscriptionList {
- subListCount :: Int
- subListData :: [Subscription]
- createSub :: MonadIO m => CustomerId -> PlanId -> Maybe CpnId -> Maybe SubTrialEnd -> StripeT m Subscription
- getSubscription :: MonadIO m => CustomerId -> SubscriptionId -> StripeT m Subscription
- getSubscriptions :: MonadIO m => CustomerId -> StripeT m SubscriptionList
- updateSubRCard :: MonadIO m => RequestCard -> CustomerId -> PlanId -> Maybe CpnId -> Maybe SubProrate -> Maybe SubTrialEnd -> StripeT m Subscription
- updateSubToken :: MonadIO m => TokenId -> CustomerId -> PlanId -> Maybe CpnId -> Maybe SubProrate -> Maybe SubTrialEnd -> StripeT m Subscription
- updateSubscription :: MonadIO m => CustomerId -> PlanId -> Maybe CpnId -> Maybe SubProrate -> Maybe SubTrialEnd -> StripeT m Subscription
- updateSub :: MonadIO m => [(ByteString, ByteString)] -> CustomerId -> PlanId -> Maybe CpnId -> Maybe SubProrate -> Maybe SubTrialEnd -> StripeT m Subscription
- cancelSub :: MonadIO m => CustomerId -> Maybe SubAtPeriodEnd -> StripeT m Subscription
- data UTCTime = UTCTime {
- utctDay :: Day
- utctDayTime :: DiffTime
- data StripeConfig = StripeConfig {}
- newtype StripeT m a = StripeT (StateT StripeConfig (ErrorT StripeFailure m) a)
- runStripeT :: MonadIO m => StripeConfig -> StripeT m a -> m (Either StripeFailure a)
Documentation
data Subscription Source
Represents a subscription in the Stripe API.
Subscription | |
|
Show Subscription | |
FromJSON Subscription | Attempts to parse JSON into a |
newtype SubscriptionId Source
Describes the various stages that a
newtype SubProrate Source
A boolean flag that determines whether or not to prorate switching plans during a billing cycle.
newtype SubTrialEnd Source
UTC integer timestamp representing the end of the trial period that the customer receives before being charged for the first time.
newtype SubAtPeriodEnd Source
A boolean flag that determines whether or not the cancellation of the
Subscription
should be delayed until the end of the current period.
data SubscriptionList Source
createSub :: MonadIO m => CustomerId -> PlanId -> Maybe CpnId -> Maybe SubTrialEnd -> StripeT m SubscriptionSource
Create a new Subscription
. Limitations: does not yet support passing
a card, quantity, or application fee
getSubscription :: MonadIO m => CustomerId -> SubscriptionId -> StripeT m SubscriptionSource
getSubscriptions :: MonadIO m => CustomerId -> StripeT m SubscriptionListSource
updateSubRCard :: MonadIO m => RequestCard -> CustomerId -> PlanId -> Maybe CpnId -> Maybe SubProrate -> Maybe SubTrialEnd -> StripeT m SubscriptionSource
Update the subscription associated with a Customer
, identified by
CustomerId
, in the Stripe system.
If SubTrialEnd
is provided, this will override the default trial period
of the plan to which the customer is subscribed.
updateSubToken :: MonadIO m => TokenId -> CustomerId -> PlanId -> Maybe CpnId -> Maybe SubProrate -> Maybe SubTrialEnd -> StripeT m SubscriptionSource
Behaves precisely like updateSubRCard
, but uses a Token
, identified by
TokenId
, rather than a RequestCard
.
updateSubscription :: MonadIO m => CustomerId -> PlanId -> Maybe CpnId -> Maybe SubProrate -> Maybe SubTrialEnd -> StripeT m SubscriptionSource
Update a Subscription
updateSub :: MonadIO m => [(ByteString, ByteString)] -> CustomerId -> PlanId -> Maybe CpnId -> Maybe SubProrate -> Maybe SubTrialEnd -> StripeT m SubscriptionSource
Internal convenience function to update a Subscription
.
Try using updateSubscription
, updateSubToken
, or updateSubRCard
cancelSub :: MonadIO m => CustomerId -> Maybe SubAtPeriodEnd -> StripeT m SubscriptionSource
Cancels the Subscription
associated with a Customer
, identified by
CustomerId
, in the Stripe system.
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.
UTCTime | |
|
data StripeConfig Source
Configuration for the StripeT
monad transformer.
Show StripeConfig | |
Monad m => MonadState StripeConfig (StripeT m) |
Defines the monad transformer under which all Stripe REST API resource calls take place.
StripeT (StateT StripeConfig (ErrorT StripeFailure m) a) |
Monad m => MonadError StripeFailure (StripeT m) | |
Monad m => MonadState StripeConfig (StripeT m) | |
Monad m => Monad (StripeT m) | |
Functor m => Functor (StripeT m) | |
Monad m => MonadPlus (StripeT m) | |
MonadIO m => MonadIO (StripeT m) |
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
.