stripe-core-2.3.0: Stripe API for Haskell - Pure Core

Copyright(c) David Johnson 2014
Maintainerdjohnson.m@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Web.Stripe.Discount

Contents

Description

https://stripe.com/docs/api#discounts

{-# LANGUAGE OverloadedStrings #-}
import Web.Stripe
import Web.Stripe.Discount
import Web.Stripe.Customer

main :: IO ()
main = do
  let config = StripeConfig (StripeKey "secret_key")
  result <- stripe config $ deleteCustomerDiscount (CustomerId "customer_id")
  case result of
    Right deleteResult -> print deleteResult
    Left  stripeError  -> print stripeError

Synopsis

API

deleteCustomerDiscount #

Arguments

:: CustomerId

The Customer upon which to remove the Discount

-> StripeRequest DeleteCustomerDiscount 

Delete Customer Discount by CustomerId

deleteSubscriptionDiscount #

Arguments

:: CustomerId

The Customer to remove the Discount from

-> SubscriptionId

The Subscription to remove the Discount from

-> StripeRequest DeleteSubscriptionDiscount 

Delete Subscription Discount by CustomerId and SubscriptionId

Types

data StripeDeleteResult #

JSON returned from a Stripe deletion request

Constructors

StripeDeleteResult 

Instances

Eq StripeDeleteResult # 
Data StripeDeleteResult # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> StripeDeleteResult -> c StripeDeleteResult #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c StripeDeleteResult #

toConstr :: StripeDeleteResult -> Constr #

dataTypeOf :: StripeDeleteResult -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c StripeDeleteResult) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c StripeDeleteResult) #

gmapT :: (forall b. Data b => b -> b) -> StripeDeleteResult -> StripeDeleteResult #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> StripeDeleteResult -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> StripeDeleteResult -> r #

gmapQ :: (forall d. Data d => d -> u) -> StripeDeleteResult -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> StripeDeleteResult -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> StripeDeleteResult -> m StripeDeleteResult #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> StripeDeleteResult -> m StripeDeleteResult #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> StripeDeleteResult -> m StripeDeleteResult #

Ord StripeDeleteResult # 
Read StripeDeleteResult # 
Show StripeDeleteResult # 
FromJSON StripeDeleteResult #

JSON Instance for StripeDeleteResult

newtype CustomerId #

Constructors

CustomerId Text 

Instances

Eq CustomerId # 
Data CustomerId # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CustomerId -> c CustomerId #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CustomerId #

toConstr :: CustomerId -> Constr #

dataTypeOf :: CustomerId -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c CustomerId) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CustomerId) #

gmapT :: (forall b. Data b => b -> b) -> CustomerId -> CustomerId #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CustomerId -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CustomerId -> r #

gmapQ :: (forall d. Data d => d -> u) -> CustomerId -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CustomerId -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CustomerId -> m CustomerId #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CustomerId -> m CustomerId #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CustomerId -> m CustomerId #

Ord CustomerId # 
Read CustomerId # 
Show CustomerId # 
FromJSON CustomerId #

JSON Instance for CustomerId

ToStripeParam CustomerId # 
StripeHasParam CreateCardToken CustomerId # 
StripeHasParam GetInvoiceItems CustomerId # 
StripeHasParam GetInvoiceLineItems CustomerId # 
StripeHasParam GetCharges CustomerId # 
StripeHasParam CreateCharge CustomerId # 
StripeHasParam GetCustomers (EndingBefore CustomerId) # 
StripeHasParam GetCustomers (StartingAfter CustomerId) # 
type ExpandsTo CustomerId # 

newtype SubscriptionId #

Constructors

SubscriptionId 

Instances

Eq SubscriptionId # 
Data SubscriptionId # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SubscriptionId -> c SubscriptionId #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SubscriptionId #

toConstr :: SubscriptionId -> Constr #

dataTypeOf :: SubscriptionId -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c SubscriptionId) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SubscriptionId) #

gmapT :: (forall b. Data b => b -> b) -> SubscriptionId -> SubscriptionId #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SubscriptionId -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SubscriptionId -> r #

gmapQ :: (forall d. Data d => d -> u) -> SubscriptionId -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SubscriptionId -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SubscriptionId -> m SubscriptionId #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SubscriptionId -> m SubscriptionId #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SubscriptionId -> m SubscriptionId #

Ord SubscriptionId # 
Read SubscriptionId # 
Show SubscriptionId # 
FromJSON SubscriptionId #

JSON Instance for SubscriptionId

ToStripeParam SubscriptionId # 
StripeHasParam CreateInvoiceItem SubscriptionId # 
StripeHasParam GetUpcomingInvoice SubscriptionId # 
StripeHasParam GetInvoiceLineItems SubscriptionId # 
StripeHasParam CreateInvoice SubscriptionId # 
StripeHasParam GetSubscriptionsByCustomerId (EndingBefore SubscriptionId) # 
StripeHasParam GetSubscriptionsByCustomerId (StartingAfter SubscriptionId) # 
StripeHasParam GetSubscriptions (EndingBefore SubscriptionId) # 
StripeHasParam GetSubscriptions (StartingAfter SubscriptionId) # 

data Discount #

Instances

Eq Discount # 
Data Discount # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Discount -> c Discount #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Discount #

toConstr :: Discount -> Constr #

dataTypeOf :: Discount -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Discount) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Discount) #

gmapT :: (forall b. Data b => b -> b) -> Discount -> Discount #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Discount -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Discount -> r #

gmapQ :: (forall d. Data d => d -> u) -> Discount -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Discount -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Discount -> m Discount #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Discount -> m Discount #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Discount -> m Discount #

Ord Discount # 
Read Discount # 
Show Discount # 
FromJSON Discount #

JSON Instance for Discount