| Copyright | (c) David Johnson 2014 |
|---|---|
| Maintainer | djohnson.m@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Web.Stripe.Balance
Description
https://stripe.com/docs/api#balance
{-# LANGUAGE OverloadedStrings #-}
import Web.Stripe
import Web.Stripe.Balance (getBalance)
main :: IO ()
main = do
let config = StripeConfig (StripeKey "secret_key")
result <- stripe config getBalance
case result of
Right balance -> print balance
Left stripeError -> print stripeError
Synopsis
- data GetBalance
- getBalance :: StripeRequest GetBalance
- data GetBalanceTransaction
- getBalanceTransaction :: TransactionId -> StripeRequest GetBalanceTransaction
- data GetBalanceTransactionHistory
- getBalanceTransactionHistory :: StripeRequest GetBalanceTransactionHistory
- newtype AvailableOn = AvailableOn UTCTime
- data Balance = Balance {}
- data BalanceAmount = BalanceAmount {}
- data BalanceTransaction = BalanceTransaction {
- balanceTransactionId :: TransactionId
- balanceTransactionObject :: Text
- balanceTransactionAmount :: Int
- balanceTransactionCurrency :: Currency
- balanceTransactionNet :: Int
- balanceTransactionType :: TransactionType
- balanceTransactionCreated :: UTCTime
- balanceTransactionAvailableOn :: UTCTime
- balanceTransactionStatus :: Text
- balanceTransactionFee :: Int
- balanceTransactionFeeDetails :: [FeeDetails]
- balanceTransactionFeeSource :: Expandable ChargeId
- balanceTransactionFeeDescription :: Maybe Description
- newtype Created = Created UTCTime
- data Currency
- = AED
- | AFN
- | ALL
- | AMD
- | ANG
- | AOA
- | ARS
- | AUD
- | AWG
- | AZN
- | BAM
- | BBD
- | BDT
- | BGN
- | BIF
- | BMD
- | BND
- | BOB
- | BRL
- | BSD
- | BWP
- | BZD
- | CAD
- | CDF
- | CHF
- | CLP
- | CNY
- | COP
- | CRC
- | CVE
- | CZK
- | DJF
- | DKK
- | DOP
- | DZD
- | EEK
- | EGP
- | ETB
- | EUR
- | FJD
- | FKP
- | GBP
- | GEL
- | GIP
- | GMD
- | GNF
- | GTQ
- | GYD
- | HKD
- | HNL
- | HRK
- | HTG
- | HUF
- | IDR
- | ILS
- | INR
- | ISK
- | JMD
- | JPY
- | KES
- | KGS
- | KHR
- | KMF
- | KRW
- | KYD
- | KZT
- | LAK
- | LBP
- | LKR
- | LRD
- | LSL
- | LTL
- | LVL
- | MAD
- | MDL
- | MGA
- | MKD
- | MNT
- | MOP
- | MRO
- | MUR
- | MVR
- | MWK
- | MXN
- | MYR
- | MZN
- | NAD
- | NGN
- | NIO
- | NOK
- | NPR
- | NZD
- | PAB
- | PEN
- | PGK
- | PHP
- | PKR
- | PLN
- | PYG
- | QAR
- | RON
- | RSD
- | RUB
- | RWF
- | SAR
- | SBD
- | SCR
- | SEK
- | SGD
- | SHP
- | SLL
- | SOS
- | SRD
- | STD
- | SVC
- | SZL
- | THB
- | TJS
- | TOP
- | TRY
- | TTD
- | TWD
- | TZS
- | UAH
- | UGX
- | USD
- | UYU
- | UZS
- | VND
- | VUV
- | WST
- | XAF
- | XCD
- | XOF
- | XPF
- | YER
- | ZAR
- | ZMW
- | UnknownCurrency
- newtype EndingBefore a = EndingBefore a
- newtype ExpandParams = ExpandParams {
- getExpandParams :: [Text]
- newtype Limit = Limit Int
- newtype Source a = Source {
- getSource :: a
- newtype StartingAfter a = StartingAfter a
- data StripeList a = StripeList {}
- data TimeRange a = TimeRange {}
- newtype TransactionId = TransactionId Text
- data TransactionType
API
data GetBalance Source #
Instances
| type StripeReturn GetBalance Source # | |
Defined in Web.Stripe.Balance | |
getBalance :: StripeRequest GetBalance Source #
Retrieve the current Balance for your Stripe account
data GetBalanceTransaction Source #
Instances
| StripeHasParam GetBalanceTransaction ExpandParams Source # | |
Defined in Web.Stripe.Balance | |
| type StripeReturn GetBalanceTransaction Source # | |
Defined in Web.Stripe.Balance | |
getBalanceTransaction Source #
Arguments
| :: TransactionId | The |
| -> StripeRequest GetBalanceTransaction |
Retrieve a BalanceTransaction by TransactionId
data GetBalanceTransactionHistory Source #
Instances
getBalanceTransactionHistory :: StripeRequest GetBalanceTransactionHistory Source #
Retrieve the history of BalanceTransactions
Types
newtype AvailableOn Source #
Constructors
| AvailableOn UTCTime |
Instances
Balance Object
Constructors
| Balance | |
Fields
| |
Instances
| Eq Balance Source # | |
| Data Balance Source # | |
Defined in Web.Stripe.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Balance -> c Balance # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Balance # toConstr :: Balance -> Constr # dataTypeOf :: Balance -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Balance) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Balance) # gmapT :: (forall b. Data b => b -> b) -> Balance -> Balance # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Balance -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Balance -> r # gmapQ :: (forall d. Data d => d -> u) -> Balance -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Balance -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Balance -> m Balance # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Balance -> m Balance # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Balance -> m Balance # | |
| Ord Balance Source # | |
| Read Balance Source # | |
| Show Balance Source # | |
| FromJSON Balance Source # | JSON Instance for |
data BalanceAmount Source #
BalanceAmount Object
Constructors
| BalanceAmount | |
Fields | |
Instances
data BalanceTransaction Source #
BalanceTransaction Object
Constructors
Instances
Instances
Stripe supports 138 currencies
Constructors
| AED | United Arab Emirates Dirham |
| AFN | Afghan Afghani |
| ALL | Albanian Lek |
| AMD | Armenian Dram |
| ANG | Netherlands Antillean Gulden |
| AOA | Angolan Kwanza |
| ARS | Argentine Peso |
| AUD | Australian Dollar |
| AWG | Aruban Florin |
| AZN | Azerbaijani Manat |
| BAM | Bosnia & Herzegovina Convertible Mark |
| BBD | Barbadian Dollar |
| BDT | Bangladeshi Taka |
| BGN | Bulgarian Lev |
| BIF | Burundian Franc |
| BMD | Bermudian Dollar |
| BND | Brunei Dollar |
| BOB | Bolivian Boliviano |
| BRL | Brazilian Real |
| BSD | Bahamian Dollar |
| BWP | Botswana Pula |
| BZD | Belize Dollar |
| CAD | Canadian Dollar |
| CDF | Congolese Franc |
| CHF | Swiss Franc |
| CLP | Chilean Peso |
| CNY | Chinese Renminbi Yuan |
| COP | Colombian Peso |
| CRC | Costa Rican Colón |
| CVE | Cape Verdean Escudo |
| CZK | Czech Koruna |
| DJF | Djiboutian Franc |
| DKK | Danish Krone |
| DOP | Dominican Peso |
| DZD | Algerian Dinar |
| EEK | Estonian Kroon |
| EGP | Egyptian Pound |
| ETB | Ethiopian Birr |
| EUR | Euro |
| FJD | Fijian Dollar |
| FKP | Falkland Islands Pound |
| GBP | British Pound |
| GEL | Georgian Lari |
| GIP | Gibraltar Pound |
| GMD | Gambian Dalasi |
| GNF | Guinean Franc |
| GTQ | Guatemalan Quetzal |
| GYD | Guyanese Dollar |
| HKD | Hong Kong Dollar |
| HNL | Honduran Lempira |
| HRK | Croatian Kuna |
| HTG | Haitian Gourde |
| HUF | Hungarian Forint |
| IDR | Indonesian Rupiah |
| ILS | Israeli New Sheqel |
| INR | Indian Rupee |
| ISK | Icelandic Króna |
| JMD | Jamaican Dollar |
| JPY | Japanese Yen |
| KES | Kenyan Shilling |
| KGS | Kyrgyzstani Som |
| KHR | Cambodian Riel |
| KMF | Comorian Franc |
| KRW | South Korean Won |
| KYD | Cayman Islands Dollar |
| KZT | Kazakhstani Tenge |
| LAK | Lao Kip |
| LBP | Lebanese Pound |
| LKR | Sri Lankan Rupee |
| LRD | Liberian Dollar |
| LSL | Lesotho Loti |
| LTL | Lithuanian Litas |
| LVL | Latvian Lats |
| MAD | Moroccan Dirham |
| MDL | Moldovan Leu |
| MGA | Malagasy Ariary |
| MKD | Macedonian Denar |
| MNT | Mongolian Tögrög |
| MOP | Macanese Pataca |
| MRO | Mauritanian Ouguiya |
| MUR | Mauritian Rupee |
| MVR | Maldivian Rufiyaa |
| MWK | Malawian Kwacha |
| MXN | Mexican Peso |
| MYR | Malaysian Ringgit |
| MZN | Mozambican Metical |
| NAD | Namibian Dollar |
| NGN | Nigerian Naira |
| NIO | Nicaraguan Córdoba |
| NOK | Norwegian Krone |
| NPR | Nepalese Rupee |
| NZD | New Zealand Dollar |
| PAB | Panamanian Balboa |
| PEN | Peruvian Nuevo Sol |
| PGK | Papua New Guinean Kina |
| PHP | Philippine Peso |
| PKR | Pakistani Rupee |
| PLN | Polish Złoty |
| PYG | Paraguayan Guaraní |
| QAR | Qatari Riyal |
| RON | Romanian Leu |
| RSD | Serbian Dinar |
| RUB | Russian Ruble |
| RWF | Rwandan Franc |
| SAR | Saudi Riyal |
| SBD | Solomon Islands Dollar |
| SCR | Seychellois Rupee |
| SEK | Swedish Krona |
| SGD | Singapore Dollar |
| SHP | Saint Helenian Pound |
| SLL | Sierra Leonean Leone |
| SOS | Somali Shilling |
| SRD | Surinamese Dollar |
| STD | São Tomé and Príncipe Dobra |
| SVC | Salvadoran Colón |
| SZL | Swazi Lilangeni |
| THB | Thai Baht |
| TJS | Tajikistani Somoni |
| TOP | Tongan Paʻanga |
| TRY | Turkish Lira |
| TTD | Trinidad and Tobago Dollar |
| TWD | New Taiwan Dollar |
| TZS | Tanzanian Shilling |
| UAH | Ukrainian Hryvnia |
| UGX | Ugandan Shilling |
| USD | United States Dollar |
| UYU | Uruguayan Peso |
| UZS | Uzbekistani Som |
| VND | Vietnamese Đồng |
| VUV | Vanuatu Vatu |
| WST | Samoan Tala |
| XAF | Central African Cfa Franc |
| XCD | East Caribbean Dollar |
| XOF | West African Cfa Franc |
| XPF | Cfp Franc |
| YER | Yemeni Rial |
| ZAR | South African Rand |
| ZMW | Zambian Kwacha |
| UnknownCurrency | Unknown Currency |
Instances
| Eq Currency Source # | |
| Data Currency Source # | |
Defined in Web.Stripe.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Currency -> c Currency # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Currency # toConstr :: Currency -> Constr # dataTypeOf :: Currency -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Currency) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Currency) # gmapT :: (forall b. Data b => b -> b) -> Currency -> Currency # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Currency -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Currency -> r # gmapQ :: (forall d. Data d => d -> u) -> Currency -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Currency -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Currency -> m Currency # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Currency -> m Currency # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Currency -> m Currency # | |
| Ord Currency Source # | |
Defined in Web.Stripe.Types | |
| Read Currency Source # | |
| Show Currency Source # | |
| FromJSON Currency Source # |
|
| ToStripeParam Currency Source # | |
Defined in Web.Stripe.StripeRequest Methods toStripeParam :: Currency -> [(ByteString, ByteString)] -> [(ByteString, ByteString)] Source # | |
| StripeHasParam CreateCoupon Currency Source # | |
Defined in Web.Stripe.Coupon | |
| StripeHasParam GetBalanceTransactionHistory Currency Source # | |
Defined in Web.Stripe.Balance | |
newtype EndingBefore a Source #
Pagination Option for StripeList
Constructors
| EndingBefore a |
Instances
newtype ExpandParams Source #
Type of Expansion Parameters for use on Stripe objects
Constructors
| ExpandParams | |
Fields
| |
Instances
Pagination Option for StripeList
Instances
Instances
| ToStripeParam a => StripeHasParam GetBalanceTransactionHistory (Source a) Source # | |
Defined in Web.Stripe.Balance | |
| Eq a => Eq (Source a) Source # | |
| Data a => Data (Source a) Source # | |
Defined in Web.Stripe.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Source a -> c (Source a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Source a) # toConstr :: Source a -> Constr # dataTypeOf :: Source a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Source a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Source a)) # gmapT :: (forall b. Data b => b -> b) -> Source a -> Source a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Source a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Source a -> r # gmapQ :: (forall d. Data d => d -> u) -> Source a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Source a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Source a -> m (Source a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Source a -> m (Source a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Source a -> m (Source a) # | |
| Ord a => Ord (Source a) Source # | |
Defined in Web.Stripe.Types | |
| Read a => Read (Source a) Source # | |
| Show a => Show (Source a) Source # | |
| ToStripeParam a => ToStripeParam (Source a) Source # | |
Defined in Web.Stripe.StripeRequest Methods toStripeParam :: Source a -> [(ByteString, ByteString)] -> [(ByteString, ByteString)] Source # | |
newtype StartingAfter a Source #
Pagination Option for StripeList
Constructors
| StartingAfter a |
Instances
data StripeList a Source #
Generic handling of Stripe JSON arrays
Constructors
| StripeList | |
Instances
| Eq a => Eq (StripeList a) Source # | |
Defined in Web.Stripe.Types | |
| Data a => Data (StripeList a) Source # | |
Defined in Web.Stripe.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> StripeList a -> c (StripeList a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (StripeList a) # toConstr :: StripeList a -> Constr # dataTypeOf :: StripeList a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (StripeList a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (StripeList a)) # gmapT :: (forall b. Data b => b -> b) -> StripeList a -> StripeList a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> StripeList a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> StripeList a -> r # gmapQ :: (forall d. Data d => d -> u) -> StripeList a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> StripeList a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> StripeList a -> m (StripeList a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> StripeList a -> m (StripeList a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> StripeList a -> m (StripeList a) # | |
| Ord a => Ord (StripeList a) Source # | |
Defined in Web.Stripe.Types Methods compare :: StripeList a -> StripeList a -> Ordering # (<) :: StripeList a -> StripeList a -> Bool # (<=) :: StripeList a -> StripeList a -> Bool # (>) :: StripeList a -> StripeList a -> Bool # (>=) :: StripeList a -> StripeList a -> Bool # max :: StripeList a -> StripeList a -> StripeList a # min :: StripeList a -> StripeList a -> StripeList a # | |
| Read a => Read (StripeList a) Source # | |
Defined in Web.Stripe.Types Methods readsPrec :: Int -> ReadS (StripeList a) # readList :: ReadS [StripeList a] # readPrec :: ReadPrec (StripeList a) # readListPrec :: ReadPrec [StripeList a] # | |
| Show a => Show (StripeList a) Source # | |
Defined in Web.Stripe.Types Methods showsPrec :: Int -> StripeList a -> ShowS # show :: StripeList a -> String # showList :: [StripeList a] -> ShowS # | |
| FromJSON a => FromJSON (StripeList a) Source # | JSON Instance for |
Defined in Web.Stripe.Types Methods parseJSON :: Value -> Parser (StripeList a) # parseJSONList :: Value -> Parser [StripeList a] # | |
specify a TimeRange
FIXME: this is a little awkward to use. How can we make it moar better?
Instances
| StripeHasParam GetBalanceTransactionHistory (TimeRange Created) Source # | |
Defined in Web.Stripe.Balance | |
| StripeHasParam GetBalanceTransactionHistory (TimeRange AvailableOn) Source # | |
Defined in Web.Stripe.Balance | |
| Eq a => Eq (TimeRange a) Source # | |
| Data a => Data (TimeRange a) Source # | |
Defined in Web.Stripe.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TimeRange a -> c (TimeRange a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (TimeRange a) # toConstr :: TimeRange a -> Constr # dataTypeOf :: TimeRange a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (TimeRange a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (TimeRange a)) # gmapT :: (forall b. Data b => b -> b) -> TimeRange a -> TimeRange a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TimeRange a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TimeRange a -> r # gmapQ :: (forall d. Data d => d -> u) -> TimeRange a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TimeRange a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TimeRange a -> m (TimeRange a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeRange a -> m (TimeRange a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeRange a -> m (TimeRange a) # | |
| Ord a => Ord (TimeRange a) Source # | |
Defined in Web.Stripe.Types | |
| Read a => Read (TimeRange a) Source # | |
| Show a => Show (TimeRange a) Source # | |
| ToStripeParam a => ToStripeParam (TimeRange a) Source # | |
Defined in Web.Stripe.StripeRequest Methods toStripeParam :: TimeRange a -> [(ByteString, ByteString)] -> [(ByteString, ByteString)] Source # | |
newtype TransactionId Source #
TransactionId of a Transaction
Constructors
| TransactionId Text |
Instances
data TransactionType Source #
transaction type for BalanceTransaction
Constructors
| ChargeTxn | |
| RefundTxn | |
| AdjustmentTxn | |
| ApplicationFeeTxn | |
| ApplicationFeeRefundTxn | |
| TransferTxn | |
| TransferCancelTxn | |
| TransferFailureTxn |