{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
module Web.Stripe.Discount
(
DeleteCustomerDiscount
, deleteCustomerDiscount
, DeleteSubscriptionDiscount
, deleteSubscriptionDiscount
, StripeDeleteResult (..)
, CustomerId (..)
, SubscriptionId (..)
, Discount (..)
) where
import Web.Stripe.StripeRequest (Method (DELETE), StripeReturn,
StripeRequest (..), mkStripeRequest)
import Web.Stripe.Util ((</>))
import Web.Stripe.Types (CustomerId (..), Discount(..),
StripeDeleteResult (..),
SubscriptionId (..))
import Web.Stripe.Types.Util (getCustomerId)
deleteCustomerDiscount
:: CustomerId
-> StripeRequest DeleteCustomerDiscount
deleteCustomerDiscount
customerId = request
where request = mkStripeRequest DELETE url params
url = "customers" </> getCustomerId customerId </> "discount"
params = []
data DeleteCustomerDiscount
type instance StripeReturn DeleteCustomerDiscount = StripeDeleteResult
deleteSubscriptionDiscount
:: CustomerId
-> SubscriptionId
-> StripeRequest DeleteSubscriptionDiscount
deleteSubscriptionDiscount
customerId
(SubscriptionId subId) = request
where request = mkStripeRequest DELETE url params
url = "customers" </> getCustomerId customerId </> "subscriptions" </> subId </> "discount"
params = []
data DeleteSubscriptionDiscount
type instance StripeReturn DeleteSubscriptionDiscount = StripeDeleteResult