{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
module Web.Stripe.Dispute
(
UpdateDispute
, updateDispute
, CloseDispute
, closeDispute
, ChargeId (..)
, Dispute (..)
, DisputeReason (..)
, DisputeStatus (..)
, Evidence (..)
, MetaData (..)
) where
import Web.Stripe.StripeRequest (Method (POST),
StripeHasParam, StripeRequest (..),
StripeReturn,
mkStripeRequest)
import Web.Stripe.Util ((</>))
import Web.Stripe.Types (ChargeId (..), Dispute (..),
DisputeReason (..),
DisputeStatus (..),
Evidence (..), MetaData(..))
import Web.Stripe.Types.Util (getChargeId)
updateDispute
:: ChargeId
-> StripeRequest UpdateDispute
updateDispute
chargeId = request
where request = mkStripeRequest POST url params
url = "charges" </> getChargeId chargeId </> "dispute"
params = []
data UpdateDispute
type instance StripeReturn UpdateDispute = Dispute
instance StripeHasParam UpdateDispute Evidence
instance StripeHasParam UpdateDispute MetaData
closeDispute
:: ChargeId
-> StripeRequest CloseDispute
closeDispute
chargeId = request
where request = mkStripeRequest POST url params
url = "charges" </> getChargeId chargeId </> "dispute" </> "close"
params = []
data CloseDispute
type instance StripeReturn CloseDispute = Dispute