| Copyright | (c) David Johnson 2014 |
|---|---|
| Maintainer | djohnson.m@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Web.Stripe.Dispute
Description
https://stripe.com/docs/api#diputes
{-# LANGUAGE OverloadedStrings #-}
import Web.Stripe
import Web.Stripe.Charge
import Web.Stripe.Dispute
main :: IO ()
main = do
let config = StripeConfig (StripeKey "secret_key")
result <- stripe config $ getCharge (ChargeId "charge_id")
case result of
(Left stripeError) -> print stripeError
(Right (Charge { chargeDispute = dispute })) ->
case dispute of
(Just dispute) -> print dispute
Nothing -> print "no dispute on this charge"
Synopsis
- data UpdateDispute
- updateDispute :: ChargeId -> StripeRequest UpdateDispute
- data CloseDispute
- closeDispute :: ChargeId -> StripeRequest CloseDispute
- newtype ChargeId = ChargeId Text
- data Dispute = Dispute {
- disputeChargeId :: Expandable ChargeId
- disputeAmount :: Int
- disputeCreated :: UTCTime
- disputeStatus :: DisputeStatus
- disputeLiveMode :: Bool
- disputeCurrency :: Currency
- disputeObject :: Text
- disputeReason :: DisputeReason
- disputeIsChargeRefundable :: Bool
- disputeBalanceTransactions :: [BalanceTransaction]
- disputeEvidenceDueBy :: UTCTime
- disputeEvidence :: Maybe Evidence
- disputeMetaData :: MetaData
- data DisputeReason
- data DisputeStatus
- newtype Evidence = Evidence Text
- newtype MetaData = MetaData [(Text, Text)]
API
data UpdateDispute Source #
Instances
| StripeHasParam UpdateDispute MetaData Source # | |
Defined in Web.Stripe.Dispute | |
| StripeHasParam UpdateDispute Evidence Source # | |
Defined in Web.Stripe.Dispute | |
| type StripeReturn UpdateDispute Source # | |
Defined in Web.Stripe.Dispute | |
Arguments
| :: ChargeId | The ID of the Charge being disputed |
| -> StripeRequest UpdateDispute |
Dispute to be updated
data CloseDispute Source #
Instances
| type StripeReturn CloseDispute Source # | |
Defined in Web.Stripe.Dispute | |
Arguments
| :: ChargeId | The ID of the Charge being disputed |
| -> StripeRequest CloseDispute |
Dispute to be closed
Types
Instances
Dispute Object
Constructors
Instances
| Eq Dispute Source # | |
| Data Dispute Source # | |
Defined in Web.Stripe.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dispute -> c Dispute # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Dispute # toConstr :: Dispute -> Constr # dataTypeOf :: Dispute -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Dispute) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Dispute) # gmapT :: (forall b. Data b => b -> b) -> Dispute -> Dispute # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dispute -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dispute -> r # gmapQ :: (forall d. Data d => d -> u) -> Dispute -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Dispute -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dispute -> m Dispute # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dispute -> m Dispute # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dispute -> m Dispute # | |
| Ord Dispute Source # | |
| Read Dispute Source # | |
| Show Dispute Source # | |
| FromJSON Dispute Source # | JSON Instance for |
data DisputeReason Source #
Reason of a Dispute
Constructors
| Duplicate | |
| Fraudulent | |
| SubscriptionCanceled | |
| ProductUnacceptable | |
| ProductNotReceived | |
| Unrecognized | |
| CreditNotProcessed | |
| General |
Instances
data DisputeStatus Source #
Status of a Dispute
Constructors
| WarningNeedsResponse | |
| WarningUnderReview | |
| NeedsResponse | |
| UnderReview | |
| ChargeRefunded | |
| Won | |
| Lost |
Instances
Instances
| Eq Evidence Source # | |
| Data Evidence Source # | |
Defined in Web.Stripe.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Evidence -> c Evidence # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Evidence # toConstr :: Evidence -> Constr # dataTypeOf :: Evidence -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Evidence) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Evidence) # gmapT :: (forall b. Data b => b -> b) -> Evidence -> Evidence # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Evidence -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Evidence -> r # gmapQ :: (forall d. Data d => d -> u) -> Evidence -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Evidence -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Evidence -> m Evidence # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Evidence -> m Evidence # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Evidence -> m Evidence # | |
| Ord Evidence Source # | |
Defined in Web.Stripe.Types | |
| Read Evidence Source # | |
| Show Evidence Source # | |
| ToStripeParam Evidence Source # | |
Defined in Web.Stripe.StripeRequest Methods toStripeParam :: Evidence -> [(ByteString, ByteString)] -> [(ByteString, ByteString)] Source # | |
| StripeHasParam UpdateDispute Evidence Source # | |
Defined in Web.Stripe.Dispute | |
Type of MetaData for use on Stripe objects