{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
module Web.Stripe.Balance
(
GetBalance
, getBalance
, GetBalanceTransaction
, getBalanceTransaction
, GetBalanceTransactionHistory
, getBalanceTransactionHistory
, AvailableOn (..)
, Balance (..)
, BalanceAmount (..)
, BalanceTransaction (..)
, Created (..)
, Currency (..)
, EndingBefore (..)
, ExpandParams (..)
, Limit (..)
, Source (..)
, StartingAfter (..)
, StripeList (..)
, TimeRange (..)
, TransactionId (..)
, TransactionType (..)
) where
import Web.Stripe.StripeRequest (Method (GET), StripeHasParam,
StripeRequest (..),
StripeReturn, ToStripeParam(..),
mkStripeRequest)
import Web.Stripe.Util ((</>))
import Web.Stripe.Types (AvailableOn(..), Balance (..),
BalanceAmount(..), BalanceTransaction(..),
Created(..), Currency(..),
EndingBefore(..), ExpandParams(..),
Limit(..), Source(..), StartingAfter(..),
StripeList (..), TimeRange(..),
TransferId(..), TransactionId (..),
TransactionType(..))
import Web.Stripe.Types.Util (getTransactionId)
getBalance :: StripeRequest GetBalance
getBalance = request
where request = mkStripeRequest GET url params
url = "balance"
params = []
data GetBalance
type instance StripeReturn GetBalance = Balance
getBalanceTransaction
:: TransactionId
-> StripeRequest GetBalanceTransaction
getBalanceTransaction
transactionid = request
where request = mkStripeRequest GET url params
url = "balance" </> "history" </> getTransactionId transactionid
params = []
data GetBalanceTransaction
type instance StripeReturn GetBalanceTransaction = BalanceTransaction
instance StripeHasParam GetBalanceTransaction ExpandParams
getBalanceTransactionHistory
:: StripeRequest GetBalanceTransactionHistory
getBalanceTransactionHistory
= request
where request = mkStripeRequest GET url params
url = "balance" </> "history"
params = []
data GetBalanceTransactionHistory
type instance StripeReturn GetBalanceTransactionHistory = (StripeList BalanceTransaction)
instance StripeHasParam GetBalanceTransactionHistory AvailableOn
instance StripeHasParam GetBalanceTransactionHistory (TimeRange AvailableOn)
instance StripeHasParam GetBalanceTransactionHistory Created
instance StripeHasParam GetBalanceTransactionHistory (TimeRange Created)
instance StripeHasParam GetBalanceTransactionHistory Currency
instance StripeHasParam GetBalanceTransactionHistory (EndingBefore TransactionId)
instance StripeHasParam GetBalanceTransactionHistory Limit
instance StripeHasParam GetBalanceTransactionHistory (StartingAfter TransactionId)
instance (ToStripeParam a) => StripeHasParam GetBalanceTransactionHistory (Source a)
instance StripeHasParam GetBalanceTransactionHistory TransferId
instance StripeHasParam GetBalanceTransactionHistory TransactionType