Safe Haskell | None |
---|
- data Coupon = Coupon {}
- newtype CpnId = CpnId {}
- data CpnDuration
- newtype CpnPercentOff = CpnPercentOff {}
- newtype CpnMaxRedeems = CpnMaxRedeems {}
- newtype CpnRedeemBy = CpnRedeemBy {
- unCpnRedeemBy :: Int
- applyCoupon :: Maybe Coupon -> Plan -> Int
- createCoupon :: MonadIO m => Coupon -> Maybe CpnMaxRedeems -> Maybe CpnRedeemBy -> StripeT m ()
- getCoupon :: MonadIO m => CpnId -> StripeT m Coupon
- getCoupons :: MonadIO m => Maybe Count -> Maybe Offset -> StripeT m [Coupon]
- delCoupon :: MonadIO m => Coupon -> StripeT m Bool
- delCouponById :: MonadIO m => CpnId -> StripeT m Bool
- newtype Count = Count {}
- newtype Offset = Offset {}
- 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
Represents a coupon in the Stripe system.
Represents the identifier for a given Coupon
in the Stripe system.
data CpnDuration Source
Represents the duration of a coupon. If an interval identifier is not
known, UnknownDuration
is used to carry the original identifier supplied
by Stripe.
newtype CpnPercentOff Source
Represents the percent off that is applied by a coupon. This must be between 1 and 100.
newtype CpnMaxRedeems Source
A positive number representing the maximum number of times that a coupon can be redeemed.
newtype CpnRedeemBy Source
UTC timestamp specifying the last time at which the coupon can be redeemed.
createCoupon :: MonadIO m => Coupon -> Maybe CpnMaxRedeems -> Maybe CpnRedeemBy -> StripeT m ()Source
Creates a Coupon
in the Stripe system.
delCoupon :: MonadIO m => Coupon -> StripeT m BoolSource
Deletes a Coupon
if it exists. If it does not, an
InvalidRequestError
will be thrown indicating this.
A maximum number of objects that the Stripe API will return. This value should be between 1 and 100, inclusive.
A positive integer that is an offset into the array of objects returned by the Stripe API.
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
.