stripe-core-2.4.1: 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 Source #

Arguments

:: CustomerId

The Customer upon which to remove the Discount

-> StripeRequest DeleteCustomerDiscount 

Delete Customer Discount by CustomerId

deleteSubscriptionDiscount Source #

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

JSON returned from a Stripe deletion request

Constructors

StripeDeleteResult 
Instances
Eq StripeDeleteResult Source # 
Instance details

Defined in Web.Stripe.Types

Data StripeDeleteResult Source # 
Instance details

Defined in Web.Stripe.Types

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 Source # 
Instance details

Defined in Web.Stripe.Types

Read StripeDeleteResult Source # 
Instance details

Defined in Web.Stripe.Types

Show StripeDeleteResult Source # 
Instance details

Defined in Web.Stripe.Types

FromJSON StripeDeleteResult Source #

JSON Instance for StripeDeleteResult

Instance details

Defined in Web.Stripe.Types

newtype CustomerId Source #

Constructors

CustomerId Text 
Instances
Eq CustomerId Source # 
Instance details

Defined in Web.Stripe.Types

Data CustomerId Source # 
Instance details

Defined in Web.Stripe.Types

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 Source # 
Instance details

Defined in Web.Stripe.Types

Read CustomerId Source # 
Instance details

Defined in Web.Stripe.Types

Show CustomerId Source # 
Instance details

Defined in Web.Stripe.Types

FromJSON CustomerId Source #

JSON Instance for CustomerId

Instance details

Defined in Web.Stripe.Types

ToStripeParam CustomerId Source # 
Instance details

Defined in Web.Stripe.StripeRequest

StripeHasParam CreateCardToken CustomerId Source # 
Instance details

Defined in Web.Stripe.Token

StripeHasParam GetInvoiceItems CustomerId Source # 
Instance details

Defined in Web.Stripe.InvoiceItem

StripeHasParam GetInvoiceLineItems CustomerId Source # 
Instance details

Defined in Web.Stripe.Invoice

StripeHasParam GetCharges CustomerId Source # 
Instance details

Defined in Web.Stripe.Charge

StripeHasParam CreateCharge CustomerId Source # 
Instance details

Defined in Web.Stripe.Charge

StripeHasParam GetCustomers (EndingBefore CustomerId) Source # 
Instance details

Defined in Web.Stripe.Customer

StripeHasParam GetCustomers (StartingAfter CustomerId) Source # 
Instance details

Defined in Web.Stripe.Customer

type ExpandsTo CustomerId Source # 
Instance details

Defined in Web.Stripe.Types

newtype SubscriptionId Source #

Constructors

SubscriptionId 
Instances
Eq SubscriptionId Source # 
Instance details

Defined in Web.Stripe.Types

Data SubscriptionId Source # 
Instance details

Defined in Web.Stripe.Types

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 Source # 
Instance details

Defined in Web.Stripe.Types

Read SubscriptionId Source # 
Instance details

Defined in Web.Stripe.Types

Show SubscriptionId Source # 
Instance details

Defined in Web.Stripe.Types

FromJSON SubscriptionId Source #

JSON Instance for SubscriptionId

Instance details

Defined in Web.Stripe.Types

ToStripeParam SubscriptionId Source # 
Instance details

Defined in Web.Stripe.StripeRequest

StripeHasParam CreateInvoiceItem SubscriptionId Source # 
Instance details

Defined in Web.Stripe.InvoiceItem

StripeHasParam GetUpcomingInvoice SubscriptionId Source # 
Instance details

Defined in Web.Stripe.Invoice

StripeHasParam GetInvoiceLineItems SubscriptionId Source # 
Instance details

Defined in Web.Stripe.Invoice

StripeHasParam CreateInvoice SubscriptionId Source # 
Instance details

Defined in Web.Stripe.Invoice

StripeHasParam GetSubscriptionsByCustomerId (EndingBefore SubscriptionId) Source # 
Instance details

Defined in Web.Stripe.Subscription

StripeHasParam GetSubscriptionsByCustomerId (StartingAfter SubscriptionId) Source # 
Instance details

Defined in Web.Stripe.Subscription

StripeHasParam GetSubscriptions (EndingBefore SubscriptionId) Source # 
Instance details

Defined in Web.Stripe.Subscription

StripeHasParam GetSubscriptions (StartingAfter SubscriptionId) Source # 
Instance details

Defined in Web.Stripe.Subscription

data Discount Source #

Instances
Eq Discount Source # 
Instance details

Defined in Web.Stripe.Types

Data Discount Source # 
Instance details

Defined in Web.Stripe.Types

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 Source # 
Instance details

Defined in Web.Stripe.Types

Read Discount Source # 
Instance details

Defined in Web.Stripe.Types

Show Discount Source # 
Instance details

Defined in Web.Stripe.Types

FromJSON Discount Source #

JSON Instance for Discount

Instance details

Defined in Web.Stripe.Types