stripe-haskell 0.1.4.3 → 2.0.0
raw patch · 57 files changed
+57/−8518 lines, 57 filesdep +stripe-coredep +stripe-http-streamsdep −HsOpenSSLdep −aesondep −bytestringdep ~basesetup-changedPVP ok
version bump matches the API change (PVP)
Dependencies added: stripe-core, stripe-http-streams
Dependencies removed: HsOpenSSL, aeson, bytestring, either, hspec, http-streams, io-streams, mtl, random, stripe-haskell, text, time, transformers, unordered-containers
Dependency ranges changed: base
API changes (from Hackage documentation)
- Web.Stripe: APIError :: StripeErrorType
- Web.Stripe: BadRequest :: StripeErrorHTTPCode
- Web.Stripe: CardDeclined :: StripeErrorCode
- Web.Stripe: CardError :: StripeErrorType
- Web.Stripe: ConnectionFailure :: StripeErrorType
- Web.Stripe: ExpiredCard :: StripeErrorCode
- Web.Stripe: IncorrectCVC :: StripeErrorCode
- Web.Stripe: IncorrectNumber :: StripeErrorCode
- Web.Stripe: IncorrectZIP :: StripeErrorCode
- Web.Stripe: InvalidCVC :: StripeErrorCode
- Web.Stripe: InvalidExpiryMonth :: StripeErrorCode
- Web.Stripe: InvalidExpiryYear :: StripeErrorCode
- Web.Stripe: InvalidNumber :: StripeErrorCode
- Web.Stripe: InvalidRequest :: StripeErrorType
- Web.Stripe: Missing :: StripeErrorCode
- Web.Stripe: NotFound :: StripeErrorHTTPCode
- Web.Stripe: ParseFailure :: StripeErrorType
- Web.Stripe: ProcessingError :: StripeErrorCode
- Web.Stripe: RateLimit :: StripeErrorCode
- Web.Stripe: RequestFailed :: StripeErrorHTTPCode
- Web.Stripe: StripeConfig :: ByteString -> StripeConfig
- Web.Stripe: StripeError :: StripeErrorType -> Text -> Maybe StripeErrorCode -> Maybe Text -> Maybe StripeErrorHTTPCode -> StripeError
- Web.Stripe: StripeRequest :: Method -> Text -> Params -> StripeRequest
- Web.Stripe: StripeServerError :: StripeErrorHTTPCode
- Web.Stripe: UnAuthorized :: StripeErrorHTTPCode
- Web.Stripe: UnknownError :: StripeErrorCode
- Web.Stripe: UnknownErrorType :: StripeErrorType
- Web.Stripe: UnknownHTTPCode :: StripeErrorHTTPCode
- Web.Stripe: data StripeConfig
- Web.Stripe: data StripeError
- Web.Stripe: data StripeErrorCode
- Web.Stripe: data StripeErrorHTTPCode
- Web.Stripe: data StripeErrorType
- Web.Stripe: data StripeRequest
- Web.Stripe: endpoint :: StripeRequest -> Text
- Web.Stripe: errorCode :: StripeError -> Maybe StripeErrorCode
- Web.Stripe: errorHTTP :: StripeError -> Maybe StripeErrorHTTPCode
- Web.Stripe: errorMsg :: StripeError -> Text
- Web.Stripe: errorParam :: StripeError -> Maybe Text
- Web.Stripe: errorType :: StripeError -> StripeErrorType
- Web.Stripe: method :: StripeRequest -> Method
- Web.Stripe: queryParams :: StripeRequest -> Params
- Web.Stripe: secretKey :: StripeConfig -> ByteString
- Web.Stripe: stripeRaw :: FromJSON a => StripeConfig -> StripeRequest -> IO (Either StripeError a)
- Web.Stripe: type Stripe = EitherT StripeError (ReaderT (StripeConfig, Connection) IO)
- Web.Stripe.Account: Account :: AccountId -> Email -> Maybe Description -> Maybe Text -> Text -> Bool -> Bool -> Bool -> [Currency] -> Currency -> Text -> Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Account
- Web.Stripe.Account: AccountId :: Text -> AccountId
- Web.Stripe.Account: ExpandedAccount :: Account -> AccountId
- Web.Stripe.Account: accountBusinessLogo :: Account -> Maybe Text
- Web.Stripe.Account: accountBusinessName :: Account -> Maybe Text
- Web.Stripe.Account: accountBusinessURL :: Account -> Maybe Text
- Web.Stripe.Account: accountChargeEnabled :: Account -> Bool
- Web.Stripe.Account: accountCountry :: Account -> Text
- Web.Stripe.Account: accountCurrenciesSupported :: Account -> [Currency]
- Web.Stripe.Account: accountDefaultCurrency :: Account -> Currency
- Web.Stripe.Account: accountDetailsSubmitted :: Account -> Bool
- Web.Stripe.Account: accountDisplayName :: Account -> Maybe Text
- Web.Stripe.Account: accountEmail :: Account -> Email
- Web.Stripe.Account: accountId :: Account -> AccountId
- Web.Stripe.Account: accountObject :: Account -> Text
- Web.Stripe.Account: accountStatementDescriptor :: Account -> Maybe Description
- Web.Stripe.Account: accountSupportPhone :: Account -> Maybe Text
- Web.Stripe.Account: accountTimeZone :: Account -> Text
- Web.Stripe.Account: accountTransferEnabled :: Account -> Bool
- Web.Stripe.Account: data Account
- Web.Stripe.Account: data AccountId
- Web.Stripe.Account: getAccountDetails :: Stripe Account
- Web.Stripe.ApplicationFee: ApplicationFee :: Text -> Text -> UTCTime -> Bool -> Int -> Currency -> Bool -> Int -> StripeList Refund -> TransactionId -> AccountId -> ApplicationId -> ChargeId -> MetaData -> ApplicationFee
- Web.Stripe.ApplicationFee: ApplicationId :: Text -> ApplicationId
- Web.Stripe.ApplicationFee: ConnectApp :: Maybe Text -> Text -> Text -> ConnectApp
- Web.Stripe.ApplicationFee: FeeId :: Text -> FeeId
- Web.Stripe.ApplicationFee: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.ApplicationFee: applicationFeeAccountId :: ApplicationFee -> AccountId
- Web.Stripe.ApplicationFee: applicationFeeAmount :: ApplicationFee -> Int
- Web.Stripe.ApplicationFee: applicationFeeAmountRefunded :: ApplicationFee -> Int
- Web.Stripe.ApplicationFee: applicationFeeApplicationId :: ApplicationFee -> ApplicationId
- Web.Stripe.ApplicationFee: applicationFeeBalanceTransaction :: ApplicationFee -> TransactionId
- Web.Stripe.ApplicationFee: applicationFeeChargeId :: ApplicationFee -> ChargeId
- Web.Stripe.ApplicationFee: applicationFeeCreated :: ApplicationFee -> UTCTime
- Web.Stripe.ApplicationFee: applicationFeeCurrency :: ApplicationFee -> Currency
- Web.Stripe.ApplicationFee: applicationFeeId :: ApplicationFee -> Text
- Web.Stripe.ApplicationFee: applicationFeeLiveMode :: ApplicationFee -> Bool
- Web.Stripe.ApplicationFee: applicationFeeMetaData :: ApplicationFee -> MetaData
- Web.Stripe.ApplicationFee: applicationFeeObjecet :: ApplicationFee -> Text
- Web.Stripe.ApplicationFee: applicationFeeRefunded :: ApplicationFee -> Bool
- Web.Stripe.ApplicationFee: applicationFeeRefunds :: ApplicationFee -> StripeList Refund
- Web.Stripe.ApplicationFee: connectAppId :: ConnectApp -> Maybe Text
- Web.Stripe.ApplicationFee: connectAppName :: ConnectApp -> Text
- Web.Stripe.ApplicationFee: connectAppObject :: ConnectApp -> Text
- Web.Stripe.ApplicationFee: data ApplicationFee
- Web.Stripe.ApplicationFee: data ConnectApp
- Web.Stripe.ApplicationFee: data StripeList a
- Web.Stripe.ApplicationFee: getApplicationFee :: FeeId -> Stripe ApplicationFee
- Web.Stripe.ApplicationFee: getApplicationFeeExpanded :: FeeId -> ExpandParams -> Stripe ApplicationFee
- Web.Stripe.ApplicationFee: getApplicationFees :: Maybe Limit -> StartingAfter FeeId -> EndingBefore FeeId -> Stripe (StripeList ApplicationFee)
- Web.Stripe.ApplicationFee: getApplicationFeesExpanded :: Maybe Limit -> StartingAfter FeeId -> EndingBefore FeeId -> ExpandParams -> Stripe (StripeList ApplicationFee)
- Web.Stripe.ApplicationFee: hasMore :: StripeList a -> Bool
- Web.Stripe.ApplicationFee: list :: StripeList a -> [a]
- Web.Stripe.ApplicationFee: newtype ApplicationId
- Web.Stripe.ApplicationFee: newtype FeeId
- Web.Stripe.ApplicationFee: object :: StripeList a -> Text
- Web.Stripe.ApplicationFee: stripeUrl :: StripeList a -> Text
- Web.Stripe.ApplicationFee: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.ApplicationFee: type EndingBefore a = Maybe a
- Web.Stripe.ApplicationFee: type ExpandParams = [Text]
- Web.Stripe.ApplicationFee: type Limit = Maybe Int
- Web.Stripe.ApplicationFee: type StartingAfter a = Maybe a
- Web.Stripe.ApplicationFeeRefund: ApplicationFee :: Text -> Text -> UTCTime -> Bool -> Int -> Currency -> Bool -> Int -> StripeList Refund -> TransactionId -> AccountId -> ApplicationId -> ChargeId -> MetaData -> ApplicationFee
- Web.Stripe.ApplicationFeeRefund: ApplicationFeeRefund :: RefundId -> Int -> Currency -> UTCTime -> Text -> Maybe TransactionId -> FeeId -> MetaData -> ApplicationFeeRefund
- Web.Stripe.ApplicationFeeRefund: FeeId :: Text -> FeeId
- Web.Stripe.ApplicationFeeRefund: RefundId :: Text -> RefundId
- Web.Stripe.ApplicationFeeRefund: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.ApplicationFeeRefund: applicationFeeAccountId :: ApplicationFee -> AccountId
- Web.Stripe.ApplicationFeeRefund: applicationFeeAmount :: ApplicationFee -> Int
- Web.Stripe.ApplicationFeeRefund: applicationFeeAmountRefunded :: ApplicationFee -> Int
- Web.Stripe.ApplicationFeeRefund: applicationFeeApplicationId :: ApplicationFee -> ApplicationId
- Web.Stripe.ApplicationFeeRefund: applicationFeeBalanceTransaction :: ApplicationFee -> TransactionId
- Web.Stripe.ApplicationFeeRefund: applicationFeeChargeId :: ApplicationFee -> ChargeId
- Web.Stripe.ApplicationFeeRefund: applicationFeeCreated :: ApplicationFee -> UTCTime
- Web.Stripe.ApplicationFeeRefund: applicationFeeCurrency :: ApplicationFee -> Currency
- Web.Stripe.ApplicationFeeRefund: applicationFeeId :: ApplicationFee -> Text
- Web.Stripe.ApplicationFeeRefund: applicationFeeLiveMode :: ApplicationFee -> Bool
- Web.Stripe.ApplicationFeeRefund: applicationFeeMetaData :: ApplicationFee -> MetaData
- Web.Stripe.ApplicationFeeRefund: applicationFeeObjecet :: ApplicationFee -> Text
- Web.Stripe.ApplicationFeeRefund: applicationFeeRefundAmount :: ApplicationFeeRefund -> Int
- Web.Stripe.ApplicationFeeRefund: applicationFeeRefundBalanceTransaction :: ApplicationFeeRefund -> Maybe TransactionId
- Web.Stripe.ApplicationFeeRefund: applicationFeeRefundCreated :: ApplicationFeeRefund -> UTCTime
- Web.Stripe.ApplicationFeeRefund: applicationFeeRefundCurrency :: ApplicationFeeRefund -> Currency
- Web.Stripe.ApplicationFeeRefund: applicationFeeRefundFee :: ApplicationFeeRefund -> FeeId
- Web.Stripe.ApplicationFeeRefund: applicationFeeRefundId :: ApplicationFeeRefund -> RefundId
- Web.Stripe.ApplicationFeeRefund: applicationFeeRefundMetaData :: ApplicationFeeRefund -> MetaData
- Web.Stripe.ApplicationFeeRefund: applicationFeeRefundObject :: ApplicationFeeRefund -> Text
- Web.Stripe.ApplicationFeeRefund: applicationFeeRefunded :: ApplicationFee -> Bool
- Web.Stripe.ApplicationFeeRefund: applicationFeeRefunds :: ApplicationFee -> StripeList Refund
- Web.Stripe.ApplicationFeeRefund: createApplicationFeeRefund :: FeeId -> Maybe Amount -> MetaData -> Stripe ApplicationFeeRefund
- Web.Stripe.ApplicationFeeRefund: data ApplicationFee
- Web.Stripe.ApplicationFeeRefund: data ApplicationFeeRefund
- Web.Stripe.ApplicationFeeRefund: data StripeList a
- Web.Stripe.ApplicationFeeRefund: getApplicationFeeRefund :: FeeId -> RefundId -> Stripe ApplicationFeeRefund
- Web.Stripe.ApplicationFeeRefund: getApplicationFeeRefundExpandable :: FeeId -> RefundId -> ExpandParams -> Stripe ApplicationFeeRefund
- Web.Stripe.ApplicationFeeRefund: getApplicationFeeRefunds :: FeeId -> Limit -> StartingAfter FeeId -> EndingBefore FeeId -> Stripe (StripeList ApplicationFeeRefund)
- Web.Stripe.ApplicationFeeRefund: getApplicationFeeRefundsExpandable :: FeeId -> Limit -> StartingAfter FeeId -> EndingBefore FeeId -> ExpandParams -> Stripe (StripeList ApplicationFeeRefund)
- Web.Stripe.ApplicationFeeRefund: hasMore :: StripeList a -> Bool
- Web.Stripe.ApplicationFeeRefund: list :: StripeList a -> [a]
- Web.Stripe.ApplicationFeeRefund: newtype FeeId
- Web.Stripe.ApplicationFeeRefund: newtype RefundId
- Web.Stripe.ApplicationFeeRefund: object :: StripeList a -> Text
- Web.Stripe.ApplicationFeeRefund: stripeUrl :: StripeList a -> Text
- Web.Stripe.ApplicationFeeRefund: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.ApplicationFeeRefund: type Amount = Int
- Web.Stripe.ApplicationFeeRefund: type EndingBefore a = Maybe a
- Web.Stripe.ApplicationFeeRefund: type ExpandParams = [Text]
- Web.Stripe.ApplicationFeeRefund: type Limit = Maybe Int
- Web.Stripe.ApplicationFeeRefund: type MetaData = [(Text, Text)]
- Web.Stripe.ApplicationFeeRefund: type StartingAfter a = Maybe a
- Web.Stripe.ApplicationFeeRefund: updateApplicationFeeRefund :: FeeId -> RefundId -> MetaData -> Stripe (StripeList ApplicationFeeRefund)
- Web.Stripe.Balance: Balance :: [BalanceAmount] -> [BalanceAmount] -> Bool -> Text -> Balance
- Web.Stripe.Balance: ExpandedTransaction :: BalanceTransaction -> TransactionId
- Web.Stripe.Balance: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.Balance: TransactionId :: Text -> TransactionId
- Web.Stripe.Balance: balanceAvailable :: Balance -> [BalanceAmount]
- Web.Stripe.Balance: balanceLiveMode :: Balance -> Bool
- Web.Stripe.Balance: balanceObject :: Balance -> Text
- Web.Stripe.Balance: balancePending :: Balance -> [BalanceAmount]
- Web.Stripe.Balance: data Balance
- Web.Stripe.Balance: data BalanceAmount
- Web.Stripe.Balance: data BalanceTransaction
- Web.Stripe.Balance: data StripeList a
- Web.Stripe.Balance: data TransactionId
- Web.Stripe.Balance: getBalance :: Stripe Balance
- Web.Stripe.Balance: getBalanceTransaction :: TransactionId -> Stripe BalanceTransaction
- Web.Stripe.Balance: getBalanceTransactionExpandable :: TransactionId -> ExpandParams -> Stripe BalanceTransaction
- Web.Stripe.Balance: getBalanceTransactionHistory :: Limit -> StartingAfter TransactionId -> EndingBefore TransactionId -> Stripe (StripeList BalanceTransaction)
- Web.Stripe.Balance: hasMore :: StripeList a -> Bool
- Web.Stripe.Balance: list :: StripeList a -> [a]
- Web.Stripe.Balance: object :: StripeList a -> Text
- Web.Stripe.Balance: stripeUrl :: StripeList a -> Text
- Web.Stripe.Balance: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.Balance: type EndingBefore a = Maybe a
- Web.Stripe.Balance: type Limit = Maybe Int
- Web.Stripe.Balance: type StartingAfter a = Maybe a
- Web.Stripe.Bitcoin: BitcoinReceiver :: BitcoinReceiverId -> Text -> UTCTime -> Bool -> Bool -> Integer -> Integer -> Integer -> Integer -> Text -> Currency -> Bool -> Text -> Bool -> Maybe Text -> Text -> MetaData -> Maybe Text -> Maybe Transactions -> Maybe PaymentId -> Maybe CustomerId -> BitcoinReceiver
- Web.Stripe.Bitcoin: BitcoinReceiverId :: Text -> BitcoinReceiverId
- Web.Stripe.Bitcoin: BitcoinTransaction :: BitcoinTransactionId -> Text -> UTCTime -> Integer -> Integer -> Currency -> BitcoinReceiverId -> BitcoinTransaction
- Web.Stripe.Bitcoin: BitcoinTransactionId :: Text -> BitcoinTransactionId
- Web.Stripe.Bitcoin: Email :: Text -> Email
- Web.Stripe.Bitcoin: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.Bitcoin: btcActive :: BitcoinReceiver -> Bool
- Web.Stripe.Bitcoin: btcAmount :: BitcoinReceiver -> Integer
- Web.Stripe.Bitcoin: btcAmountReceived :: BitcoinReceiver -> Integer
- Web.Stripe.Bitcoin: btcBitcoinAmount :: BitcoinReceiver -> Integer
- Web.Stripe.Bitcoin: btcBitcoinAmountReceived :: BitcoinReceiver -> Integer
- Web.Stripe.Bitcoin: btcBitcoinUri :: BitcoinReceiver -> Text
- Web.Stripe.Bitcoin: btcCreated :: BitcoinReceiver -> UTCTime
- Web.Stripe.Bitcoin: btcCurrency :: BitcoinReceiver -> Currency
- Web.Stripe.Bitcoin: btcCustomer :: BitcoinReceiver -> Maybe CustomerId
- Web.Stripe.Bitcoin: btcDescription :: BitcoinReceiver -> Maybe Text
- Web.Stripe.Bitcoin: btcEmail :: BitcoinReceiver -> Text
- Web.Stripe.Bitcoin: btcFilled :: BitcoinReceiver -> Bool
- Web.Stripe.Bitcoin: btcId :: BitcoinReceiver -> BitcoinReceiverId
- Web.Stripe.Bitcoin: btcInboundAddress :: BitcoinReceiver -> Text
- Web.Stripe.Bitcoin: btcLiveMode :: BitcoinReceiver -> Bool
- Web.Stripe.Bitcoin: btcMetadata :: BitcoinReceiver -> MetaData
- Web.Stripe.Bitcoin: btcObject :: BitcoinReceiver -> Text
- Web.Stripe.Bitcoin: btcPayment :: BitcoinReceiver -> Maybe PaymentId
- Web.Stripe.Bitcoin: btcRefundAddress :: BitcoinReceiver -> Maybe Text
- Web.Stripe.Bitcoin: btcTransactionAmount :: BitcoinTransaction -> Integer
- Web.Stripe.Bitcoin: btcTransactionBitcoinAmount :: BitcoinTransaction -> Integer
- Web.Stripe.Bitcoin: btcTransactionCreated :: BitcoinTransaction -> UTCTime
- Web.Stripe.Bitcoin: btcTransactionCurrency :: BitcoinTransaction -> Currency
- Web.Stripe.Bitcoin: btcTransactionId :: BitcoinTransaction -> BitcoinTransactionId
- Web.Stripe.Bitcoin: btcTransactionObject :: BitcoinTransaction -> Text
- Web.Stripe.Bitcoin: btcTransactionReceiver :: BitcoinTransaction -> BitcoinReceiverId
- Web.Stripe.Bitcoin: btcTransactions :: BitcoinReceiver -> Maybe Transactions
- Web.Stripe.Bitcoin: btcUncapturedFunds :: BitcoinReceiver -> Bool
- Web.Stripe.Bitcoin: createReceiver :: Integer -> Email -> Stripe BitcoinReceiver
- Web.Stripe.Bitcoin: data BitcoinReceiver
- Web.Stripe.Bitcoin: data BitcoinTransaction
- Web.Stripe.Bitcoin: data StripeList a
- Web.Stripe.Bitcoin: getReceiver :: BitcoinReceiverId -> Stripe BitcoinReceiver
- Web.Stripe.Bitcoin: hasMore :: StripeList a -> Bool
- Web.Stripe.Bitcoin: list :: StripeList a -> [a]
- Web.Stripe.Bitcoin: listReceivers :: Maybe Limit -> StartingAfter BitcoinReceiverId -> EndingBefore BitcoinReceiverId -> Stripe (StripeList BitcoinReceiver)
- Web.Stripe.Bitcoin: newtype BitcoinReceiverId
- Web.Stripe.Bitcoin: newtype BitcoinTransactionId
- Web.Stripe.Bitcoin: newtype Email
- Web.Stripe.Bitcoin: object :: StripeList a -> Text
- Web.Stripe.Bitcoin: stripeUrl :: StripeList a -> Text
- Web.Stripe.Bitcoin: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.Card: AMEX :: Brand
- Web.Stripe.Card: AddressCity :: Text -> AddressCity
- Web.Stripe.Card: AddressCountry :: Text -> AddressCountry
- Web.Stripe.Card: AddressLine1 :: Text -> AddressLine1
- Web.Stripe.Card: AddressLine2 :: Text -> AddressLine2
- Web.Stripe.Card: AddressState :: Text -> AddressState
- Web.Stripe.Card: AddressZip :: Text -> AddressZip
- Web.Stripe.Card: CVC :: Text -> CVC
- Web.Stripe.Card: Card :: CardId -> Text -> Text -> Brand -> Text -> ExpMonth -> ExpYear -> Text -> Text -> Maybe Name -> Maybe AddressLine1 -> Maybe AddressLine2 -> Maybe AddressCity -> Maybe AddressState -> Maybe AddressZip -> Maybe AddressCountry -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe CustomerId -> Card
- Web.Stripe.Card: CardId :: Text -> CardId
- Web.Stripe.Card: CardNumber :: Text -> CardNumber
- Web.Stripe.Card: DinersClub :: Brand
- Web.Stripe.Card: Discover :: Brand
- Web.Stripe.Card: ExpMonth :: Int -> ExpMonth
- Web.Stripe.Card: ExpYear :: Int -> ExpYear
- Web.Stripe.Card: ExpandedCard :: Card -> CardId
- Web.Stripe.Card: ExpandedRecipient :: Recipient -> RecipientId
- Web.Stripe.Card: ExpandedRecipientCard :: RecipientCard -> RecipientCardId
- Web.Stripe.Card: JCB :: Brand
- Web.Stripe.Card: MasterCard :: Brand
- Web.Stripe.Card: RecipientCard :: RecipientCardId -> Text -> Brand -> Text -> ExpMonth -> ExpYear -> Text -> Country -> Maybe Name -> Maybe AddressLine1 -> Maybe AddressLine2 -> Maybe AddressCity -> Maybe AddressState -> Maybe AddressZip -> Maybe AddressCountry -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe RecipientId -> RecipientCard
- Web.Stripe.Card: RecipientCardId :: Text -> RecipientCardId
- Web.Stripe.Card: RecipientId :: Text -> RecipientId
- Web.Stripe.Card: Unknown :: Brand
- Web.Stripe.Card: Visa :: Brand
- Web.Stripe.Card: cardAddressCity :: Card -> Maybe AddressCity
- Web.Stripe.Card: cardAddressCountry :: Card -> Maybe AddressCountry
- Web.Stripe.Card: cardAddressLine1 :: Card -> Maybe AddressLine1
- Web.Stripe.Card: cardAddressLine1Check :: Card -> Maybe Text
- Web.Stripe.Card: cardAddressLine2 :: Card -> Maybe AddressLine2
- Web.Stripe.Card: cardAddressState :: Card -> Maybe AddressState
- Web.Stripe.Card: cardAddressZip :: Card -> Maybe AddressZip
- Web.Stripe.Card: cardAddressZipCheck :: Card -> Maybe Text
- Web.Stripe.Card: cardBrand :: Card -> Brand
- Web.Stripe.Card: cardCVCCheck :: Card -> Maybe Text
- Web.Stripe.Card: cardCountry :: Card -> Text
- Web.Stripe.Card: cardCustomerId :: Card -> Maybe CustomerId
- Web.Stripe.Card: cardExpMonth :: Card -> ExpMonth
- Web.Stripe.Card: cardExpYear :: Card -> ExpYear
- Web.Stripe.Card: cardFingerprint :: Card -> Text
- Web.Stripe.Card: cardFunding :: Card -> Text
- Web.Stripe.Card: cardId :: Card -> CardId
- Web.Stripe.Card: cardLastFour :: Card -> Text
- Web.Stripe.Card: cardName :: Card -> Maybe Name
- Web.Stripe.Card: cardObject :: Card -> Text
- Web.Stripe.Card: createCustomerCard :: CustomerId -> CardNumber -> ExpMonth -> ExpYear -> CVC -> Stripe Card
- Web.Stripe.Card: createCustomerCardByToken :: CustomerId -> TokenId -> Stripe Card
- Web.Stripe.Card: createRecipientCard :: RecipientId -> CardNumber -> ExpMonth -> ExpYear -> CVC -> Stripe RecipientCard
- Web.Stripe.Card: createRecipientCardByToken :: RecipientId -> TokenId -> Stripe RecipientCard
- Web.Stripe.Card: data Brand
- Web.Stripe.Card: data Card
- Web.Stripe.Card: data CardId
- Web.Stripe.Card: data RecipientCard
- Web.Stripe.Card: data RecipientCardId
- Web.Stripe.Card: data RecipientId
- Web.Stripe.Card: deleteCustomerCard :: CustomerId -> CardId -> Stripe StripeDeleteResult
- Web.Stripe.Card: deleteRecipientCard :: RecipientId -> RecipientCardId -> Stripe StripeDeleteResult
- Web.Stripe.Card: getCustomerCard :: CustomerId -> CardId -> Stripe Card
- Web.Stripe.Card: getCustomerCardExpandable :: CustomerId -> CardId -> ExpandParams -> Stripe Card
- Web.Stripe.Card: getCustomerCards :: CustomerId -> Maybe Limit -> StartingAfter CardId -> EndingBefore CardId -> Stripe (StripeList Card)
- Web.Stripe.Card: getCustomerCardsExpandable :: CustomerId -> Maybe Limit -> StartingAfter CardId -> EndingBefore CardId -> ExpandParams -> Stripe (StripeList Card)
- Web.Stripe.Card: getRecipientCard :: RecipientId -> RecipientCardId -> Stripe RecipientCard
- Web.Stripe.Card: getRecipientCardExpandable :: RecipientId -> RecipientCardId -> ExpandParams -> Stripe RecipientCard
- Web.Stripe.Card: getRecipientCards :: RecipientId -> Maybe Limit -> StartingAfter RecipientCardId -> EndingBefore RecipientCardId -> Stripe (StripeList RecipientCard)
- Web.Stripe.Card: getRecipientCardsExpandable :: RecipientId -> Maybe Limit -> StartingAfter RecipientCardId -> EndingBefore RecipientCardId -> ExpandParams -> Stripe (StripeList RecipientCard)
- Web.Stripe.Card: newtype AddressCity
- Web.Stripe.Card: newtype AddressCountry
- Web.Stripe.Card: newtype AddressLine1
- Web.Stripe.Card: newtype AddressLine2
- Web.Stripe.Card: newtype AddressState
- Web.Stripe.Card: newtype AddressZip
- Web.Stripe.Card: newtype CVC
- Web.Stripe.Card: newtype CardNumber
- Web.Stripe.Card: newtype ExpMonth
- Web.Stripe.Card: newtype ExpYear
- Web.Stripe.Card: recipientCardAddressCity :: RecipientCard -> Maybe AddressCity
- Web.Stripe.Card: recipientCardAddressCountry :: RecipientCard -> Maybe AddressCountry
- Web.Stripe.Card: recipientCardAddressLine1 :: RecipientCard -> Maybe AddressLine1
- Web.Stripe.Card: recipientCardAddressLine1Check :: RecipientCard -> Maybe Text
- Web.Stripe.Card: recipientCardAddressLine2 :: RecipientCard -> Maybe AddressLine2
- Web.Stripe.Card: recipientCardAddressState :: RecipientCard -> Maybe AddressState
- Web.Stripe.Card: recipientCardAddressZip :: RecipientCard -> Maybe AddressZip
- Web.Stripe.Card: recipientCardAddressZipCheck :: RecipientCard -> Maybe Text
- Web.Stripe.Card: recipientCardBrand :: RecipientCard -> Brand
- Web.Stripe.Card: recipientCardCVCCheck :: RecipientCard -> Maybe Text
- Web.Stripe.Card: recipientCardCountry :: RecipientCard -> Country
- Web.Stripe.Card: recipientCardExpMonth :: RecipientCard -> ExpMonth
- Web.Stripe.Card: recipientCardExpYear :: RecipientCard -> ExpYear
- Web.Stripe.Card: recipientCardFingerprint :: RecipientCard -> Text
- Web.Stripe.Card: recipientCardFunding :: RecipientCard -> Text
- Web.Stripe.Card: recipientCardId :: RecipientCard -> RecipientCardId
- Web.Stripe.Card: recipientCardLastFour :: RecipientCard -> Text
- Web.Stripe.Card: recipientCardName :: RecipientCard -> Maybe Name
- Web.Stripe.Card: recipientCardRecipientId :: RecipientCard -> Maybe RecipientId
- Web.Stripe.Card: type Name = Text
- Web.Stripe.Card: updateCustomerCard :: CustomerId -> CardId -> Maybe Name -> Maybe AddressCity -> Maybe AddressCountry -> Maybe AddressLine1 -> Maybe AddressLine2 -> Maybe AddressState -> Maybe AddressZip -> Stripe Card
- Web.Stripe.Card: updateRecipientCard :: RecipientId -> RecipientCardId -> Maybe Name -> Maybe AddressCity -> Maybe AddressCountry -> Maybe AddressLine1 -> Maybe AddressLine2 -> Maybe AddressState -> Maybe AddressZip -> Stripe RecipientCard
- Web.Stripe.Charge: AED :: Currency
- Web.Stripe.Charge: AFN :: Currency
- Web.Stripe.Charge: ALL :: Currency
- Web.Stripe.Charge: AMD :: Currency
- Web.Stripe.Charge: ANG :: Currency
- Web.Stripe.Charge: AOA :: Currency
- Web.Stripe.Charge: ARS :: Currency
- Web.Stripe.Charge: AUD :: Currency
- Web.Stripe.Charge: AWG :: Currency
- Web.Stripe.Charge: AZN :: Currency
- Web.Stripe.Charge: BAM :: Currency
- Web.Stripe.Charge: BBD :: Currency
- Web.Stripe.Charge: BDT :: Currency
- Web.Stripe.Charge: BGN :: Currency
- Web.Stripe.Charge: BIF :: Currency
- Web.Stripe.Charge: BMD :: Currency
- Web.Stripe.Charge: BND :: Currency
- Web.Stripe.Charge: BOB :: Currency
- Web.Stripe.Charge: BRL :: Currency
- Web.Stripe.Charge: BSD :: Currency
- Web.Stripe.Charge: BWP :: Currency
- Web.Stripe.Charge: BZD :: Currency
- Web.Stripe.Charge: CAD :: Currency
- Web.Stripe.Charge: CDF :: Currency
- Web.Stripe.Charge: CHF :: Currency
- Web.Stripe.Charge: CLP :: Currency
- Web.Stripe.Charge: CNY :: Currency
- Web.Stripe.Charge: COP :: Currency
- Web.Stripe.Charge: CRC :: Currency
- Web.Stripe.Charge: CVC :: Text -> CVC
- Web.Stripe.Charge: CVE :: Currency
- Web.Stripe.Charge: CZK :: Currency
- Web.Stripe.Charge: CardNumber :: Text -> CardNumber
- Web.Stripe.Charge: Charge :: ChargeId -> Text -> UTCTime -> Bool -> Bool -> Int -> Currency -> Bool -> Card -> Bool -> StripeList Refund -> Maybe TransactionId -> Maybe Text -> Maybe Text -> Int -> Maybe CustomerId -> Maybe InvoiceId -> Maybe Description -> Maybe Dispute -> MetaData -> Maybe Description -> Maybe Text -> Maybe Text -> Charge
- Web.Stripe.Charge: ChargeId :: Text -> ChargeId
- Web.Stripe.Charge: Customer :: Text -> UTCTime -> CustomerId -> Bool -> Maybe Description -> Maybe Email -> Bool -> StripeList Subscription -> Maybe Discount -> Int -> StripeList Card -> Maybe Currency -> Maybe CardId -> MetaData -> Customer
- Web.Stripe.Charge: CustomerId :: Text -> CustomerId
- Web.Stripe.Charge: DJF :: Currency
- Web.Stripe.Charge: DKK :: Currency
- Web.Stripe.Charge: DOP :: Currency
- Web.Stripe.Charge: DZD :: Currency
- Web.Stripe.Charge: DeletedCustomer :: Maybe Bool -> CustomerId -> Customer
- Web.Stripe.Charge: EEK :: Currency
- Web.Stripe.Charge: EGP :: Currency
- Web.Stripe.Charge: ETB :: Currency
- Web.Stripe.Charge: EUR :: Currency
- Web.Stripe.Charge: Email :: Text -> Email
- Web.Stripe.Charge: ExpMonth :: Int -> ExpMonth
- Web.Stripe.Charge: ExpYear :: Int -> ExpYear
- Web.Stripe.Charge: ExpandedCharge :: Charge -> ChargeId
- Web.Stripe.Charge: ExpandedCustomer :: Customer -> CustomerId
- Web.Stripe.Charge: FJD :: Currency
- Web.Stripe.Charge: FKP :: Currency
- Web.Stripe.Charge: GBP :: Currency
- Web.Stripe.Charge: GEL :: Currency
- Web.Stripe.Charge: GIP :: Currency
- Web.Stripe.Charge: GMD :: Currency
- Web.Stripe.Charge: GNF :: Currency
- Web.Stripe.Charge: GTQ :: Currency
- Web.Stripe.Charge: GYD :: Currency
- Web.Stripe.Charge: HKD :: Currency
- Web.Stripe.Charge: HNL :: Currency
- Web.Stripe.Charge: HRK :: Currency
- Web.Stripe.Charge: HTG :: Currency
- Web.Stripe.Charge: HUF :: Currency
- Web.Stripe.Charge: IDR :: Currency
- Web.Stripe.Charge: ILS :: Currency
- Web.Stripe.Charge: INR :: Currency
- Web.Stripe.Charge: ISK :: Currency
- Web.Stripe.Charge: JMD :: Currency
- Web.Stripe.Charge: JPY :: Currency
- Web.Stripe.Charge: KES :: Currency
- Web.Stripe.Charge: KGS :: Currency
- Web.Stripe.Charge: KHR :: Currency
- Web.Stripe.Charge: KMF :: Currency
- Web.Stripe.Charge: KRW :: Currency
- Web.Stripe.Charge: KYD :: Currency
- Web.Stripe.Charge: KZT :: Currency
- Web.Stripe.Charge: LAK :: Currency
- Web.Stripe.Charge: LBP :: Currency
- Web.Stripe.Charge: LKR :: Currency
- Web.Stripe.Charge: LRD :: Currency
- Web.Stripe.Charge: LSL :: Currency
- Web.Stripe.Charge: LTL :: Currency
- Web.Stripe.Charge: LVL :: Currency
- Web.Stripe.Charge: MAD :: Currency
- Web.Stripe.Charge: MDL :: Currency
- Web.Stripe.Charge: MGA :: Currency
- Web.Stripe.Charge: MKD :: Currency
- Web.Stripe.Charge: MNT :: Currency
- Web.Stripe.Charge: MOP :: Currency
- Web.Stripe.Charge: MRO :: Currency
- Web.Stripe.Charge: MUR :: Currency
- Web.Stripe.Charge: MVR :: Currency
- Web.Stripe.Charge: MWK :: Currency
- Web.Stripe.Charge: MXN :: Currency
- Web.Stripe.Charge: MYR :: Currency
- Web.Stripe.Charge: MZN :: Currency
- Web.Stripe.Charge: NAD :: Currency
- Web.Stripe.Charge: NGN :: Currency
- Web.Stripe.Charge: NIO :: Currency
- Web.Stripe.Charge: NOK :: Currency
- Web.Stripe.Charge: NPR :: Currency
- Web.Stripe.Charge: NZD :: Currency
- Web.Stripe.Charge: PAB :: Currency
- Web.Stripe.Charge: PEN :: Currency
- Web.Stripe.Charge: PGK :: Currency
- Web.Stripe.Charge: PHP :: Currency
- Web.Stripe.Charge: PKR :: Currency
- Web.Stripe.Charge: PLN :: Currency
- Web.Stripe.Charge: PYG :: Currency
- Web.Stripe.Charge: QAR :: Currency
- Web.Stripe.Charge: RON :: Currency
- Web.Stripe.Charge: RSD :: Currency
- Web.Stripe.Charge: RUB :: Currency
- Web.Stripe.Charge: RWF :: Currency
- Web.Stripe.Charge: SAR :: Currency
- Web.Stripe.Charge: SBD :: Currency
- Web.Stripe.Charge: SCR :: Currency
- Web.Stripe.Charge: SEK :: Currency
- Web.Stripe.Charge: SGD :: Currency
- Web.Stripe.Charge: SHP :: Currency
- Web.Stripe.Charge: SLL :: Currency
- Web.Stripe.Charge: SOS :: Currency
- Web.Stripe.Charge: SRD :: Currency
- Web.Stripe.Charge: STD :: Currency
- Web.Stripe.Charge: SVC :: Currency
- Web.Stripe.Charge: SZL :: Currency
- Web.Stripe.Charge: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.Charge: THB :: Currency
- Web.Stripe.Charge: TJS :: Currency
- Web.Stripe.Charge: TOP :: Currency
- Web.Stripe.Charge: TRY :: Currency
- Web.Stripe.Charge: TTD :: Currency
- Web.Stripe.Charge: TWD :: Currency
- Web.Stripe.Charge: TZS :: Currency
- Web.Stripe.Charge: TokenId :: Text -> TokenId
- Web.Stripe.Charge: UAH :: Currency
- Web.Stripe.Charge: UGX :: Currency
- Web.Stripe.Charge: USD :: Currency
- Web.Stripe.Charge: UYU :: Currency
- Web.Stripe.Charge: UZS :: Currency
- Web.Stripe.Charge: UnknownCurrency :: Currency
- Web.Stripe.Charge: VND :: Currency
- Web.Stripe.Charge: VUV :: Currency
- Web.Stripe.Charge: WST :: Currency
- Web.Stripe.Charge: XAF :: Currency
- Web.Stripe.Charge: XCD :: Currency
- Web.Stripe.Charge: XOF :: Currency
- Web.Stripe.Charge: XPF :: Currency
- Web.Stripe.Charge: YER :: Currency
- Web.Stripe.Charge: ZAR :: Currency
- Web.Stripe.Charge: ZMW :: Currency
- Web.Stripe.Charge: captureCharge :: ChargeId -> Maybe Amount -> Maybe Email -> Stripe Charge
- Web.Stripe.Charge: chargeAmount :: Charge -> Int
- Web.Stripe.Charge: chargeAmountRefunded :: Charge -> Int
- Web.Stripe.Charge: chargeBalanceTransaction :: Charge -> Maybe TransactionId
- Web.Stripe.Charge: chargeBase :: Amount -> Currency -> Maybe Description -> Maybe CustomerId -> Maybe TokenId -> Maybe StatementDescription -> Maybe Email -> Capture -> Maybe CardNumber -> Maybe ExpMonth -> Maybe ExpYear -> Maybe CVC -> MetaData -> Stripe Charge
- Web.Stripe.Charge: chargeCaptured :: Charge -> Bool
- Web.Stripe.Charge: chargeCard :: CardNumber -> ExpMonth -> ExpYear -> CVC -> Currency -> Amount -> Maybe Description -> Stripe Charge
- Web.Stripe.Charge: chargeCardByToken :: TokenId -> Currency -> Amount -> Maybe Description -> Stripe Charge
- Web.Stripe.Charge: chargeCreated :: Charge -> UTCTime
- Web.Stripe.Charge: chargeCreditCard :: Charge -> Card
- Web.Stripe.Charge: chargeCurrency :: Charge -> Currency
- Web.Stripe.Charge: chargeCustomer :: CustomerId -> Currency -> Amount -> Maybe Description -> Stripe Charge
- Web.Stripe.Charge: chargeCustomerByCardId :: CustomerId -> CardId -> Currency -> Amount -> Maybe Description -> Stripe Charge
- Web.Stripe.Charge: chargeCustomerId :: Charge -> Maybe CustomerId
- Web.Stripe.Charge: chargeDescription :: Charge -> Maybe Description
- Web.Stripe.Charge: chargeDispute :: Charge -> Maybe Dispute
- Web.Stripe.Charge: chargeFailureCode :: Charge -> Maybe Text
- Web.Stripe.Charge: chargeFailureMessage :: Charge -> Maybe Text
- Web.Stripe.Charge: chargeId :: Charge -> ChargeId
- Web.Stripe.Charge: chargeInvoice :: Charge -> Maybe InvoiceId
- Web.Stripe.Charge: chargeLiveMode :: Charge -> Bool
- Web.Stripe.Charge: chargeMetaData :: Charge -> MetaData
- Web.Stripe.Charge: chargeObject :: Charge -> Text
- Web.Stripe.Charge: chargePaid :: Charge -> Bool
- Web.Stripe.Charge: chargeReceiptEmail :: Charge -> Maybe Text
- Web.Stripe.Charge: chargeReceiptNumber :: Charge -> Maybe Text
- Web.Stripe.Charge: chargeRefunded :: Charge -> Bool
- Web.Stripe.Charge: chargeRefunds :: Charge -> StripeList Refund
- Web.Stripe.Charge: chargeStatementDescription :: Charge -> Maybe Description
- Web.Stripe.Charge: customerAccountBalance :: Customer -> Int
- Web.Stripe.Charge: customerCards :: Customer -> StripeList Card
- Web.Stripe.Charge: customerCreated :: Customer -> UTCTime
- Web.Stripe.Charge: customerCurrency :: Customer -> Maybe Currency
- Web.Stripe.Charge: customerDefaultCard :: Customer -> Maybe CardId
- Web.Stripe.Charge: customerDelinquent :: Customer -> Bool
- Web.Stripe.Charge: customerDescription :: Customer -> Maybe Description
- Web.Stripe.Charge: customerDiscount :: Customer -> Maybe Discount
- Web.Stripe.Charge: customerEmail :: Customer -> Maybe Email
- Web.Stripe.Charge: customerId :: Customer -> CustomerId
- Web.Stripe.Charge: customerLiveMode :: Customer -> Bool
- Web.Stripe.Charge: customerMetaData :: Customer -> MetaData
- Web.Stripe.Charge: customerObject :: Customer -> Text
- Web.Stripe.Charge: customerSubscriptions :: Customer -> StripeList Subscription
- Web.Stripe.Charge: data Charge
- Web.Stripe.Charge: data ChargeId
- Web.Stripe.Charge: data Currency
- Web.Stripe.Charge: data Customer
- Web.Stripe.Charge: data CustomerId
- Web.Stripe.Charge: data StatementDescription
- Web.Stripe.Charge: data StripeList a
- Web.Stripe.Charge: deletedCustomer :: Customer -> Maybe Bool
- Web.Stripe.Charge: deletedCustomerId :: Customer -> CustomerId
- Web.Stripe.Charge: getCharge :: ChargeId -> Stripe Charge
- Web.Stripe.Charge: getChargeExpandable :: ChargeId -> ExpandParams -> Stripe Charge
- Web.Stripe.Charge: getCharges :: Limit -> StartingAfter ChargeId -> EndingBefore ChargeId -> Stripe (StripeList Charge)
- Web.Stripe.Charge: getChargesExpandable :: Limit -> StartingAfter ChargeId -> EndingBefore ChargeId -> ExpandParams -> Stripe (StripeList Charge)
- Web.Stripe.Charge: getCustomerCharges :: CustomerId -> Limit -> StartingAfter ChargeId -> EndingBefore ChargeId -> Stripe (StripeList Charge)
- Web.Stripe.Charge: getCustomerChargesExpandable :: CustomerId -> Limit -> StartingAfter ChargeId -> EndingBefore ChargeId -> ExpandParams -> Stripe (StripeList Charge)
- Web.Stripe.Charge: hasMore :: StripeList a -> Bool
- Web.Stripe.Charge: list :: StripeList a -> [a]
- Web.Stripe.Charge: newtype CVC
- Web.Stripe.Charge: newtype CardNumber
- Web.Stripe.Charge: newtype Email
- Web.Stripe.Charge: newtype ExpMonth
- Web.Stripe.Charge: newtype ExpYear
- Web.Stripe.Charge: newtype TokenId
- Web.Stripe.Charge: object :: StripeList a -> Text
- Web.Stripe.Charge: stripeUrl :: StripeList a -> Text
- Web.Stripe.Charge: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.Charge: type Amount = Int
- Web.Stripe.Charge: type Capture = Bool
- Web.Stripe.Charge: type Description = Text
- Web.Stripe.Charge: updateCharge :: ChargeId -> Description -> MetaData -> Stripe Charge
- Web.Stripe.Coupon: AED :: Currency
- Web.Stripe.Coupon: AFN :: Currency
- Web.Stripe.Coupon: ALL :: Currency
- Web.Stripe.Coupon: AMD :: Currency
- Web.Stripe.Coupon: ANG :: Currency
- Web.Stripe.Coupon: AOA :: Currency
- Web.Stripe.Coupon: ARS :: Currency
- Web.Stripe.Coupon: AUD :: Currency
- Web.Stripe.Coupon: AWG :: Currency
- Web.Stripe.Coupon: AZN :: Currency
- Web.Stripe.Coupon: AmountOff :: Int -> AmountOff
- Web.Stripe.Coupon: BAM :: Currency
- Web.Stripe.Coupon: BBD :: Currency
- Web.Stripe.Coupon: BDT :: Currency
- Web.Stripe.Coupon: BGN :: Currency
- Web.Stripe.Coupon: BIF :: Currency
- Web.Stripe.Coupon: BMD :: Currency
- Web.Stripe.Coupon: BND :: Currency
- Web.Stripe.Coupon: BOB :: Currency
- Web.Stripe.Coupon: BRL :: Currency
- Web.Stripe.Coupon: BSD :: Currency
- Web.Stripe.Coupon: BWP :: Currency
- Web.Stripe.Coupon: BZD :: Currency
- Web.Stripe.Coupon: CAD :: Currency
- Web.Stripe.Coupon: CDF :: Currency
- Web.Stripe.Coupon: CHF :: Currency
- Web.Stripe.Coupon: CLP :: Currency
- Web.Stripe.Coupon: CNY :: Currency
- Web.Stripe.Coupon: COP :: Currency
- Web.Stripe.Coupon: CRC :: Currency
- Web.Stripe.Coupon: CVE :: Currency
- Web.Stripe.Coupon: CZK :: Currency
- Web.Stripe.Coupon: Coupon :: CouponId -> UTCTime -> Maybe Int -> Maybe Int -> Maybe Currency -> Bool -> Duration -> Maybe UTCTime -> Maybe Int -> Maybe Int -> Maybe Int -> Bool -> MetaData -> Coupon
- Web.Stripe.Coupon: CouponId :: Text -> CouponId
- Web.Stripe.Coupon: DJF :: Currency
- Web.Stripe.Coupon: DKK :: Currency
- Web.Stripe.Coupon: DOP :: Currency
- Web.Stripe.Coupon: DZD :: Currency
- Web.Stripe.Coupon: DurationInMonths :: Int -> DurationInMonths
- Web.Stripe.Coupon: EEK :: Currency
- Web.Stripe.Coupon: EGP :: Currency
- Web.Stripe.Coupon: ETB :: Currency
- Web.Stripe.Coupon: EUR :: Currency
- Web.Stripe.Coupon: FJD :: Currency
- Web.Stripe.Coupon: FKP :: Currency
- Web.Stripe.Coupon: Forever :: Duration
- Web.Stripe.Coupon: GBP :: Currency
- Web.Stripe.Coupon: GEL :: Currency
- Web.Stripe.Coupon: GIP :: Currency
- Web.Stripe.Coupon: GMD :: Currency
- Web.Stripe.Coupon: GNF :: Currency
- Web.Stripe.Coupon: GTQ :: Currency
- Web.Stripe.Coupon: GYD :: Currency
- Web.Stripe.Coupon: HKD :: Currency
- Web.Stripe.Coupon: HNL :: Currency
- Web.Stripe.Coupon: HRK :: Currency
- Web.Stripe.Coupon: HTG :: Currency
- Web.Stripe.Coupon: HUF :: Currency
- Web.Stripe.Coupon: IDR :: Currency
- Web.Stripe.Coupon: ILS :: Currency
- Web.Stripe.Coupon: INR :: Currency
- Web.Stripe.Coupon: ISK :: Currency
- Web.Stripe.Coupon: JMD :: Currency
- Web.Stripe.Coupon: JPY :: Currency
- Web.Stripe.Coupon: KES :: Currency
- Web.Stripe.Coupon: KGS :: Currency
- Web.Stripe.Coupon: KHR :: Currency
- Web.Stripe.Coupon: KMF :: Currency
- Web.Stripe.Coupon: KRW :: Currency
- Web.Stripe.Coupon: KYD :: Currency
- Web.Stripe.Coupon: KZT :: Currency
- Web.Stripe.Coupon: LAK :: Currency
- Web.Stripe.Coupon: LBP :: Currency
- Web.Stripe.Coupon: LKR :: Currency
- Web.Stripe.Coupon: LRD :: Currency
- Web.Stripe.Coupon: LSL :: Currency
- Web.Stripe.Coupon: LTL :: Currency
- Web.Stripe.Coupon: LVL :: Currency
- Web.Stripe.Coupon: MAD :: Currency
- Web.Stripe.Coupon: MDL :: Currency
- Web.Stripe.Coupon: MGA :: Currency
- Web.Stripe.Coupon: MKD :: Currency
- Web.Stripe.Coupon: MNT :: Currency
- Web.Stripe.Coupon: MOP :: Currency
- Web.Stripe.Coupon: MRO :: Currency
- Web.Stripe.Coupon: MUR :: Currency
- Web.Stripe.Coupon: MVR :: Currency
- Web.Stripe.Coupon: MWK :: Currency
- Web.Stripe.Coupon: MXN :: Currency
- Web.Stripe.Coupon: MYR :: Currency
- Web.Stripe.Coupon: MZN :: Currency
- Web.Stripe.Coupon: MaxRedemptions :: Int -> MaxRedemptions
- Web.Stripe.Coupon: NAD :: Currency
- Web.Stripe.Coupon: NGN :: Currency
- Web.Stripe.Coupon: NIO :: Currency
- Web.Stripe.Coupon: NOK :: Currency
- Web.Stripe.Coupon: NPR :: Currency
- Web.Stripe.Coupon: NZD :: Currency
- Web.Stripe.Coupon: Once :: Duration
- Web.Stripe.Coupon: PAB :: Currency
- Web.Stripe.Coupon: PEN :: Currency
- Web.Stripe.Coupon: PGK :: Currency
- Web.Stripe.Coupon: PHP :: Currency
- Web.Stripe.Coupon: PKR :: Currency
- Web.Stripe.Coupon: PLN :: Currency
- Web.Stripe.Coupon: PYG :: Currency
- Web.Stripe.Coupon: PercentOff :: Int -> PercentOff
- Web.Stripe.Coupon: QAR :: Currency
- Web.Stripe.Coupon: RON :: Currency
- Web.Stripe.Coupon: RSD :: Currency
- Web.Stripe.Coupon: RUB :: Currency
- Web.Stripe.Coupon: RWF :: Currency
- Web.Stripe.Coupon: RedeemBy :: UTCTime -> RedeemBy
- Web.Stripe.Coupon: Repeating :: Duration
- Web.Stripe.Coupon: SAR :: Currency
- Web.Stripe.Coupon: SBD :: Currency
- Web.Stripe.Coupon: SCR :: Currency
- Web.Stripe.Coupon: SEK :: Currency
- Web.Stripe.Coupon: SGD :: Currency
- Web.Stripe.Coupon: SHP :: Currency
- Web.Stripe.Coupon: SLL :: Currency
- Web.Stripe.Coupon: SOS :: Currency
- Web.Stripe.Coupon: SRD :: Currency
- Web.Stripe.Coupon: STD :: Currency
- Web.Stripe.Coupon: SVC :: Currency
- Web.Stripe.Coupon: SZL :: Currency
- Web.Stripe.Coupon: StripeDeleteResult :: Bool -> Maybe Text -> StripeDeleteResult
- Web.Stripe.Coupon: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.Coupon: THB :: Currency
- Web.Stripe.Coupon: TJS :: Currency
- Web.Stripe.Coupon: TOP :: Currency
- Web.Stripe.Coupon: TRY :: Currency
- Web.Stripe.Coupon: TTD :: Currency
- Web.Stripe.Coupon: TWD :: Currency
- Web.Stripe.Coupon: TZS :: Currency
- Web.Stripe.Coupon: UAH :: Currency
- Web.Stripe.Coupon: UGX :: Currency
- Web.Stripe.Coupon: USD :: Currency
- Web.Stripe.Coupon: UYU :: Currency
- Web.Stripe.Coupon: UZS :: Currency
- Web.Stripe.Coupon: UnknownCurrency :: Currency
- Web.Stripe.Coupon: VND :: Currency
- Web.Stripe.Coupon: VUV :: Currency
- Web.Stripe.Coupon: WST :: Currency
- Web.Stripe.Coupon: XAF :: Currency
- Web.Stripe.Coupon: XCD :: Currency
- Web.Stripe.Coupon: XOF :: Currency
- Web.Stripe.Coupon: XPF :: Currency
- Web.Stripe.Coupon: YER :: Currency
- Web.Stripe.Coupon: ZAR :: Currency
- Web.Stripe.Coupon: ZMW :: Currency
- Web.Stripe.Coupon: couponAmountOff :: Coupon -> Maybe Int
- Web.Stripe.Coupon: couponCreated :: Coupon -> UTCTime
- Web.Stripe.Coupon: couponCurrency :: Coupon -> Maybe Currency
- Web.Stripe.Coupon: couponDuration :: Coupon -> Duration
- Web.Stripe.Coupon: couponDurationInMonths :: Coupon -> Maybe Int
- Web.Stripe.Coupon: couponId :: Coupon -> CouponId
- Web.Stripe.Coupon: couponLiveMode :: Coupon -> Bool
- Web.Stripe.Coupon: couponMaxRedemptions :: Coupon -> Maybe Int
- Web.Stripe.Coupon: couponMetaData :: Coupon -> MetaData
- Web.Stripe.Coupon: couponPercentOff :: Coupon -> Maybe Int
- Web.Stripe.Coupon: couponRedeemBy :: Coupon -> Maybe UTCTime
- Web.Stripe.Coupon: couponTimesRedeemed :: Coupon -> Maybe Int
- Web.Stripe.Coupon: couponValid :: Coupon -> Bool
- Web.Stripe.Coupon: createCoupon :: Maybe CouponId -> Duration -> Maybe AmountOff -> Maybe Currency -> Maybe DurationInMonths -> Maybe MaxRedemptions -> Maybe PercentOff -> Maybe RedeemBy -> MetaData -> Stripe Coupon
- Web.Stripe.Coupon: data Coupon
- Web.Stripe.Coupon: data Currency
- Web.Stripe.Coupon: data Duration
- Web.Stripe.Coupon: data StripeDeleteResult
- Web.Stripe.Coupon: data StripeList a
- Web.Stripe.Coupon: deleteCoupon :: CouponId -> Stripe StripeDeleteResult
- Web.Stripe.Coupon: deleted :: StripeDeleteResult -> Bool
- Web.Stripe.Coupon: deletedId :: StripeDeleteResult -> Maybe Text
- Web.Stripe.Coupon: getCoupon :: CouponId -> Stripe Coupon
- Web.Stripe.Coupon: getCoupons :: Maybe Limit -> StartingAfter CouponId -> EndingBefore CouponId -> Stripe (StripeList Coupon)
- Web.Stripe.Coupon: hasMore :: StripeList a -> Bool
- Web.Stripe.Coupon: list :: StripeList a -> [a]
- Web.Stripe.Coupon: newtype AmountOff
- Web.Stripe.Coupon: newtype CouponId
- Web.Stripe.Coupon: newtype DurationInMonths
- Web.Stripe.Coupon: newtype MaxRedemptions
- Web.Stripe.Coupon: newtype PercentOff
- Web.Stripe.Coupon: newtype RedeemBy
- Web.Stripe.Coupon: object :: StripeList a -> Text
- Web.Stripe.Coupon: stripeUrl :: StripeList a -> Text
- Web.Stripe.Coupon: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.Coupon: updateCoupon :: CouponId -> MetaData -> Stripe Coupon
- Web.Stripe.Customer: CVC :: Text -> CVC
- Web.Stripe.Customer: CardId :: Text -> CardId
- Web.Stripe.Customer: CardNumber :: Text -> CardNumber
- Web.Stripe.Customer: CouponId :: Text -> CouponId
- Web.Stripe.Customer: Customer :: Text -> UTCTime -> CustomerId -> Bool -> Maybe Description -> Maybe Email -> Bool -> StripeList Subscription -> Maybe Discount -> Int -> StripeList Card -> Maybe Currency -> Maybe CardId -> MetaData -> Customer
- Web.Stripe.Customer: CustomerId :: Text -> CustomerId
- Web.Stripe.Customer: DeletedCustomer :: Maybe Bool -> CustomerId -> Customer
- Web.Stripe.Customer: Email :: Text -> Email
- Web.Stripe.Customer: ExpMonth :: Int -> ExpMonth
- Web.Stripe.Customer: ExpYear :: Int -> ExpYear
- Web.Stripe.Customer: ExpandedCard :: Card -> CardId
- Web.Stripe.Customer: ExpandedCustomer :: Customer -> CustomerId
- Web.Stripe.Customer: PlanId :: Text -> PlanId
- Web.Stripe.Customer: Quantity :: Int -> Quantity
- Web.Stripe.Customer: StripeDeleteResult :: Bool -> Maybe Text -> StripeDeleteResult
- Web.Stripe.Customer: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.Customer: TokenId :: Text -> TokenId
- Web.Stripe.Customer: TrialPeriod :: UTCTime -> TrialPeriod
- Web.Stripe.Customer: createCustomerBase :: Maybe AccountBalance -> Maybe TokenId -> Maybe CardNumber -> Maybe ExpMonth -> Maybe ExpYear -> Maybe CVC -> Maybe CouponId -> Maybe Description -> Maybe Email -> Maybe PlanId -> Maybe Quantity -> Maybe TrialPeriod -> MetaData -> Stripe Customer
- Web.Stripe.Customer: createCustomerByCard :: CardNumber -> ExpMonth -> ExpYear -> CVC -> Stripe Customer
- Web.Stripe.Customer: createCustomerByEmail :: Email -> Stripe Customer
- Web.Stripe.Customer: createCustomerByToken :: TokenId -> Stripe Customer
- Web.Stripe.Customer: createEmptyCustomer :: Stripe Customer
- Web.Stripe.Customer: customerAccountBalance :: Customer -> Int
- Web.Stripe.Customer: customerCards :: Customer -> StripeList Card
- Web.Stripe.Customer: customerCreated :: Customer -> UTCTime
- Web.Stripe.Customer: customerCurrency :: Customer -> Maybe Currency
- Web.Stripe.Customer: customerDefaultCard :: Customer -> Maybe CardId
- Web.Stripe.Customer: customerDelinquent :: Customer -> Bool
- Web.Stripe.Customer: customerDescription :: Customer -> Maybe Description
- Web.Stripe.Customer: customerDiscount :: Customer -> Maybe Discount
- Web.Stripe.Customer: customerEmail :: Customer -> Maybe Email
- Web.Stripe.Customer: customerId :: Customer -> CustomerId
- Web.Stripe.Customer: customerLiveMode :: Customer -> Bool
- Web.Stripe.Customer: customerMetaData :: Customer -> MetaData
- Web.Stripe.Customer: customerObject :: Customer -> Text
- Web.Stripe.Customer: customerSubscriptions :: Customer -> StripeList Subscription
- Web.Stripe.Customer: data CardId
- Web.Stripe.Customer: data Customer
- Web.Stripe.Customer: data CustomerId
- Web.Stripe.Customer: data StripeDeleteResult
- Web.Stripe.Customer: data StripeList a
- Web.Stripe.Customer: deleteCustomer :: CustomerId -> Stripe StripeDeleteResult
- Web.Stripe.Customer: deleted :: StripeDeleteResult -> Bool
- Web.Stripe.Customer: deletedCustomer :: Customer -> Maybe Bool
- Web.Stripe.Customer: deletedCustomerId :: Customer -> CustomerId
- Web.Stripe.Customer: deletedId :: StripeDeleteResult -> Maybe Text
- Web.Stripe.Customer: getCustomer :: CustomerId -> Stripe Customer
- Web.Stripe.Customer: getCustomerExpandable :: CustomerId -> ExpandParams -> Stripe Customer
- Web.Stripe.Customer: getCustomers :: Limit -> StartingAfter CustomerId -> EndingBefore CustomerId -> Stripe (StripeList Customer)
- Web.Stripe.Customer: getCustomersExpandable :: Limit -> StartingAfter CustomerId -> EndingBefore CustomerId -> ExpandParams -> Stripe (StripeList Customer)
- Web.Stripe.Customer: hasMore :: StripeList a -> Bool
- Web.Stripe.Customer: list :: StripeList a -> [a]
- Web.Stripe.Customer: newtype CVC
- Web.Stripe.Customer: newtype CardNumber
- Web.Stripe.Customer: newtype CouponId
- Web.Stripe.Customer: newtype Email
- Web.Stripe.Customer: newtype ExpMonth
- Web.Stripe.Customer: newtype ExpYear
- Web.Stripe.Customer: newtype PlanId
- Web.Stripe.Customer: newtype Quantity
- Web.Stripe.Customer: newtype TokenId
- Web.Stripe.Customer: newtype TrialPeriod
- Web.Stripe.Customer: object :: StripeList a -> Text
- Web.Stripe.Customer: stripeUrl :: StripeList a -> Text
- Web.Stripe.Customer: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.Customer: type AccountBalance = Int
- Web.Stripe.Customer: type Description = Text
- Web.Stripe.Customer: type Limit = Maybe Int
- Web.Stripe.Customer: updateCustomerAccountBalance :: CustomerId -> AccountBalance -> Stripe Customer
- Web.Stripe.Customer: updateCustomerBase :: CustomerId -> Maybe AccountBalance -> Maybe TokenId -> Maybe CardNumber -> Maybe ExpMonth -> Maybe ExpYear -> Maybe CVC -> Maybe CouponId -> Maybe CardId -> Maybe Description -> Maybe Email -> MetaData -> Stripe Customer
- Web.Stripe.Customer: updateCustomerDefaultCard :: CustomerId -> CardId -> Stripe Customer
- Web.Stripe.Discount: CustomerId :: Text -> CustomerId
- Web.Stripe.Discount: Discount :: Coupon -> UTCTime -> Maybe UTCTime -> CustomerId -> Text -> Maybe SubscriptionId -> Discount
- Web.Stripe.Discount: ExpandedCustomer :: Customer -> CustomerId
- Web.Stripe.Discount: StripeDeleteResult :: Bool -> Maybe Text -> StripeDeleteResult
- Web.Stripe.Discount: SubscriptionId :: Text -> SubscriptionId
- Web.Stripe.Discount: data CustomerId
- Web.Stripe.Discount: data Discount
- Web.Stripe.Discount: data StripeDeleteResult
- Web.Stripe.Discount: deleteCustomerDiscount :: CustomerId -> Stripe StripeDeleteResult
- Web.Stripe.Discount: deleteSubscriptionDiscount :: CustomerId -> SubscriptionId -> Stripe StripeDeleteResult
- Web.Stripe.Discount: deleted :: StripeDeleteResult -> Bool
- Web.Stripe.Discount: deletedId :: StripeDeleteResult -> Maybe Text
- Web.Stripe.Discount: discountCoupon :: Discount -> Coupon
- Web.Stripe.Discount: discountCustomer :: Discount -> CustomerId
- Web.Stripe.Discount: discountEnd :: Discount -> Maybe UTCTime
- Web.Stripe.Discount: discountObject :: Discount -> Text
- Web.Stripe.Discount: discountStart :: Discount -> UTCTime
- Web.Stripe.Discount: discountSubscription :: Discount -> Maybe SubscriptionId
- Web.Stripe.Discount: newtype SubscriptionId
- Web.Stripe.Dispute: ChargeId :: Text -> ChargeId
- Web.Stripe.Dispute: ChargeRefunded :: DisputeStatus
- Web.Stripe.Dispute: CreditNotProcessed :: DisputeReason
- Web.Stripe.Dispute: Dispute :: ChargeId -> Int -> UTCTime -> DisputeStatus -> Bool -> Currency -> Text -> DisputeReason -> Bool -> [BalanceTransaction] -> UTCTime -> Maybe Evidence -> MetaData -> Dispute
- Web.Stripe.Dispute: Duplicate :: DisputeReason
- Web.Stripe.Dispute: Evidence :: Text -> Evidence
- Web.Stripe.Dispute: ExpandedCharge :: Charge -> ChargeId
- Web.Stripe.Dispute: Fraudulent :: DisputeReason
- Web.Stripe.Dispute: General :: DisputeReason
- Web.Stripe.Dispute: Lost :: DisputeStatus
- Web.Stripe.Dispute: NeedsResponse :: DisputeStatus
- Web.Stripe.Dispute: ProductNotReceived :: DisputeReason
- Web.Stripe.Dispute: ProductUnacceptable :: DisputeReason
- Web.Stripe.Dispute: SubscriptionCanceled :: DisputeReason
- Web.Stripe.Dispute: UnderReview :: DisputeStatus
- Web.Stripe.Dispute: Unrecognized :: DisputeReason
- Web.Stripe.Dispute: WarningNeedsResponse :: DisputeStatus
- Web.Stripe.Dispute: WarningUnderReview :: DisputeStatus
- Web.Stripe.Dispute: Won :: DisputeStatus
- Web.Stripe.Dispute: closeDispute :: ChargeId -> Stripe Dispute
- Web.Stripe.Dispute: data ChargeId
- Web.Stripe.Dispute: data Dispute
- Web.Stripe.Dispute: data DisputeReason
- Web.Stripe.Dispute: data DisputeStatus
- Web.Stripe.Dispute: disputeAmount :: Dispute -> Int
- Web.Stripe.Dispute: disputeBalanceTransactions :: Dispute -> [BalanceTransaction]
- Web.Stripe.Dispute: disputeChargeId :: Dispute -> ChargeId
- Web.Stripe.Dispute: disputeCreated :: Dispute -> UTCTime
- Web.Stripe.Dispute: disputeCurrency :: Dispute -> Currency
- Web.Stripe.Dispute: disputeEvidence :: Dispute -> Maybe Evidence
- Web.Stripe.Dispute: disputeEvidenceDueBy :: Dispute -> UTCTime
- Web.Stripe.Dispute: disputeIsChargeRefundable :: Dispute -> Bool
- Web.Stripe.Dispute: disputeLiveMode :: Dispute -> Bool
- Web.Stripe.Dispute: disputeMetaData :: Dispute -> MetaData
- Web.Stripe.Dispute: disputeObject :: Dispute -> Text
- Web.Stripe.Dispute: disputeReason :: Dispute -> DisputeReason
- Web.Stripe.Dispute: disputeStatus :: Dispute -> DisputeStatus
- Web.Stripe.Dispute: newtype Evidence
- Web.Stripe.Dispute: updateDispute :: ChargeId -> Maybe Evidence -> MetaData -> Stripe Dispute
- Web.Stripe.Event: AccountApplicationDeauthorizedEvent :: EventType
- Web.Stripe.Event: AccountApplicationEvent :: ConnectApp -> EventData
- Web.Stripe.Event: AccountEvent :: Account -> EventData
- Web.Stripe.Event: AccountUpdatedEvent :: EventType
- Web.Stripe.Event: ApplicationFeeCreatedEvent :: EventType
- Web.Stripe.Event: ApplicationFeeEvent :: ApplicationFee -> EventData
- Web.Stripe.Event: ApplicationFeeRefundedEvent :: EventType
- Web.Stripe.Event: BalanceAvailableEvent :: EventType
- Web.Stripe.Event: BalanceEvent :: Balance -> EventData
- Web.Stripe.Event: CardEvent :: Card -> EventData
- Web.Stripe.Event: ChargeCapturedEvent :: EventType
- Web.Stripe.Event: ChargeDisputeClosedEvent :: EventType
- Web.Stripe.Event: ChargeDisputeCreatedEvent :: EventType
- Web.Stripe.Event: ChargeDisputeFundsReinstatedEvent :: EventType
- Web.Stripe.Event: ChargeDisputeFundsWithdrawnEvent :: EventType
- Web.Stripe.Event: ChargeDisputeUpdatedEvent :: EventType
- Web.Stripe.Event: ChargeEvent :: Charge -> EventData
- Web.Stripe.Event: ChargeFailedEvent :: EventType
- Web.Stripe.Event: ChargeRefundedEvent :: EventType
- Web.Stripe.Event: ChargeSucceededEvent :: EventType
- Web.Stripe.Event: ChargeUpdatedEvent :: EventType
- Web.Stripe.Event: CouponCreatedEvent :: EventType
- Web.Stripe.Event: CouponDeletedEvent :: EventType
- Web.Stripe.Event: CouponEvent :: Coupon -> EventData
- Web.Stripe.Event: CouponUpdatedEvent :: EventType
- Web.Stripe.Event: CustomerCardCreatedEvent :: EventType
- Web.Stripe.Event: CustomerCardDeletedEvent :: EventType
- Web.Stripe.Event: CustomerCardUpdatedEvent :: EventType
- Web.Stripe.Event: CustomerCreatedEvent :: EventType
- Web.Stripe.Event: CustomerDeletedEvent :: EventType
- Web.Stripe.Event: CustomerDiscountCreatedEvent :: EventType
- Web.Stripe.Event: CustomerDiscountDeletedEvent :: EventType
- Web.Stripe.Event: CustomerDiscountUpdatedEvent :: EventType
- Web.Stripe.Event: CustomerEvent :: Customer -> EventData
- Web.Stripe.Event: CustomerSubscriptionCreatedEvent :: EventType
- Web.Stripe.Event: CustomerSubscriptionDeletedEvent :: EventType
- Web.Stripe.Event: CustomerSubscriptionTrialWillEndEvent :: EventType
- Web.Stripe.Event: CustomerSubscriptionUpdatedEvent :: EventType
- Web.Stripe.Event: CustomerUpdatedEvent :: EventType
- Web.Stripe.Event: DiscountEvent :: Discount -> EventData
- Web.Stripe.Event: DisputeEvent :: Dispute -> EventData
- Web.Stripe.Event: Event :: Maybe EventId -> UTCTime -> Bool -> EventType -> EventData -> Text -> Int -> Maybe Text -> Event
- Web.Stripe.Event: EventId :: Text -> EventId
- Web.Stripe.Event: InvoiceCreatedEvent :: EventType
- Web.Stripe.Event: InvoiceEvent :: Invoice -> EventData
- Web.Stripe.Event: InvoiceItemCreatedEvent :: EventType
- Web.Stripe.Event: InvoiceItemDeletedEvent :: EventType
- Web.Stripe.Event: InvoiceItemEvent :: InvoiceItem -> EventData
- Web.Stripe.Event: InvoiceItemUpdatedEvent :: EventType
- Web.Stripe.Event: InvoicePaymentFailedEvent :: EventType
- Web.Stripe.Event: InvoicePaymentSucceededEvent :: EventType
- Web.Stripe.Event: InvoiceUpdatedEvent :: EventType
- Web.Stripe.Event: Ping :: EventData
- Web.Stripe.Event: PingEvent :: EventType
- Web.Stripe.Event: PlanCreatedEvent :: EventType
- Web.Stripe.Event: PlanDeletedEvent :: EventType
- Web.Stripe.Event: PlanEvent :: Plan -> EventData
- Web.Stripe.Event: PlanUpdatedEvent :: EventType
- Web.Stripe.Event: RecipientCreatedEvent :: EventType
- Web.Stripe.Event: RecipientDeletedEvent :: EventType
- Web.Stripe.Event: RecipientEvent :: Recipient -> EventData
- Web.Stripe.Event: RecipientUpdatedEvent :: EventType
- Web.Stripe.Event: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.Event: SubscriptionEvent :: Subscription -> EventData
- Web.Stripe.Event: TransferCanceledEvent :: EventType
- Web.Stripe.Event: TransferCreatedEvent :: EventType
- Web.Stripe.Event: TransferEvent :: Transfer -> EventData
- Web.Stripe.Event: TransferFailedEvent :: EventType
- Web.Stripe.Event: TransferPaidEvent :: EventType
- Web.Stripe.Event: TransferUpdatedEvent :: EventType
- Web.Stripe.Event: UnknownEvent :: EventType
- Web.Stripe.Event: UnknownEventData :: EventData
- Web.Stripe.Event: data Event
- Web.Stripe.Event: data EventData
- Web.Stripe.Event: data EventType
- Web.Stripe.Event: data StripeList a
- Web.Stripe.Event: eventCreated :: Event -> UTCTime
- Web.Stripe.Event: eventData :: Event -> EventData
- Web.Stripe.Event: eventId :: Event -> Maybe EventId
- Web.Stripe.Event: eventLiveMode :: Event -> Bool
- Web.Stripe.Event: eventObject :: Event -> Text
- Web.Stripe.Event: eventPendingWebHooks :: Event -> Int
- Web.Stripe.Event: eventRequest :: Event -> Maybe Text
- Web.Stripe.Event: eventType :: Event -> EventType
- Web.Stripe.Event: getEvent :: EventId -> Stripe Event
- Web.Stripe.Event: getEvents :: Maybe Limit -> StartingAfter EventId -> EndingBefore EventId -> Stripe (StripeList Event)
- Web.Stripe.Event: hasMore :: StripeList a -> Bool
- Web.Stripe.Event: list :: StripeList a -> [a]
- Web.Stripe.Event: newtype EventId
- Web.Stripe.Event: object :: StripeList a -> Text
- Web.Stripe.Event: stripeUrl :: StripeList a -> Text
- Web.Stripe.Event: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.Event: type Limit = Maybe Int
- Web.Stripe.Invoice: Discount :: Coupon -> UTCTime -> Maybe UTCTime -> CustomerId -> Text -> Maybe SubscriptionId -> Discount
- Web.Stripe.Invoice: ExpandedInvoice :: Invoice -> InvoiceId
- Web.Stripe.Invoice: Invoice :: UTCTime -> Maybe InvoiceId -> UTCTime -> UTCTime -> StripeList InvoiceLineItem -> Int -> Int -> CustomerId -> Text -> Bool -> Bool -> Bool -> Bool -> Bool -> Int -> Int -> Currency -> Int -> Maybe Int -> Maybe UTCTime -> Maybe UTCTime -> Maybe ChargeId -> Maybe Discount -> Maybe FeeId -> Maybe SubscriptionId -> Maybe Description -> Maybe Description -> MetaData -> Invoice
- Web.Stripe.Invoice: InvoiceId :: Text -> InvoiceId
- Web.Stripe.Invoice: InvoiceItemType :: InvoiceLineItemType
- Web.Stripe.Invoice: InvoiceLineItem :: InvoiceLineItemId -> Text -> InvoiceLineItemType -> Bool -> Int -> Currency -> Bool -> Period -> Maybe Quantity -> Maybe Plan -> Maybe Description -> MetaData -> InvoiceLineItem
- Web.Stripe.Invoice: InvoiceLineItemId :: Text -> InvoiceLineItemId
- Web.Stripe.Invoice: Period :: UTCTime -> UTCTime -> Period
- Web.Stripe.Invoice: SubscriptionItemType :: InvoiceLineItemType
- Web.Stripe.Invoice: createInvoice :: CustomerId -> MetaData -> Stripe Invoice
- Web.Stripe.Invoice: data Discount
- Web.Stripe.Invoice: data Invoice
- Web.Stripe.Invoice: data InvoiceId
- Web.Stripe.Invoice: data InvoiceLineItem
- Web.Stripe.Invoice: data InvoiceLineItemType
- Web.Stripe.Invoice: data Period
- Web.Stripe.Invoice: discountCoupon :: Discount -> Coupon
- Web.Stripe.Invoice: discountCustomer :: Discount -> CustomerId
- Web.Stripe.Invoice: discountEnd :: Discount -> Maybe UTCTime
- Web.Stripe.Invoice: discountObject :: Discount -> Text
- Web.Stripe.Invoice: discountStart :: Discount -> UTCTime
- Web.Stripe.Invoice: discountSubscription :: Discount -> Maybe SubscriptionId
- Web.Stripe.Invoice: end :: Period -> UTCTime
- Web.Stripe.Invoice: getInvoice :: InvoiceId -> Stripe Invoice
- Web.Stripe.Invoice: getInvoiceExpandable :: InvoiceId -> ExpandParams -> Stripe Invoice
- Web.Stripe.Invoice: getInvoiceLineItems :: InvoiceId -> Limit -> StartingAfter InvoiceLineItemId -> EndingBefore InvoiceLineItemId -> Stripe (StripeList InvoiceLineItem)
- Web.Stripe.Invoice: getInvoices :: Maybe Limit -> StartingAfter InvoiceItemId -> EndingBefore InvoiceItemId -> Stripe (StripeList Invoice)
- Web.Stripe.Invoice: getInvoicesExpandable :: Maybe Limit -> StartingAfter InvoiceItemId -> EndingBefore InvoiceItemId -> ExpandParams -> Stripe (StripeList Invoice)
- Web.Stripe.Invoice: getUpcomingInvoice :: CustomerId -> Stripe Invoice
- Web.Stripe.Invoice: getUpcomingInvoices :: CustomerId -> Stripe (StripeList Invoice)
- Web.Stripe.Invoice: invoiceAmountDue :: Invoice -> Int
- Web.Stripe.Invoice: invoiceApplicateFee :: Invoice -> Maybe FeeId
- Web.Stripe.Invoice: invoiceAttemptCount :: Invoice -> Int
- Web.Stripe.Invoice: invoiceAttempted :: Invoice -> Bool
- Web.Stripe.Invoice: invoiceCharge :: Invoice -> Maybe ChargeId
- Web.Stripe.Invoice: invoiceClosed :: Invoice -> Bool
- Web.Stripe.Invoice: invoiceCurrency :: Invoice -> Currency
- Web.Stripe.Invoice: invoiceCustomer :: Invoice -> CustomerId
- Web.Stripe.Invoice: invoiceDate :: Invoice -> UTCTime
- Web.Stripe.Invoice: invoiceDescription :: Invoice -> Maybe Description
- Web.Stripe.Invoice: invoiceDiscount :: Invoice -> Maybe Discount
- Web.Stripe.Invoice: invoiceEndingBalance :: Invoice -> Maybe Int
- Web.Stripe.Invoice: invoiceForgiven :: Invoice -> Bool
- Web.Stripe.Invoice: invoiceId :: Invoice -> Maybe InvoiceId
- Web.Stripe.Invoice: invoiceLineItemAmount :: InvoiceLineItem -> Int
- Web.Stripe.Invoice: invoiceLineItemCurrency :: InvoiceLineItem -> Currency
- Web.Stripe.Invoice: invoiceLineItemDescription :: InvoiceLineItem -> Maybe Description
- Web.Stripe.Invoice: invoiceLineItemId :: InvoiceLineItem -> InvoiceLineItemId
- Web.Stripe.Invoice: invoiceLineItemLiveMode :: InvoiceLineItem -> Bool
- Web.Stripe.Invoice: invoiceLineItemMetaData :: InvoiceLineItem -> MetaData
- Web.Stripe.Invoice: invoiceLineItemObject :: InvoiceLineItem -> Text
- Web.Stripe.Invoice: invoiceLineItemPeriod :: InvoiceLineItem -> Period
- Web.Stripe.Invoice: invoiceLineItemPlan :: InvoiceLineItem -> Maybe Plan
- Web.Stripe.Invoice: invoiceLineItemProration :: InvoiceLineItem -> Bool
- Web.Stripe.Invoice: invoiceLineItemQuantity :: InvoiceLineItem -> Maybe Quantity
- Web.Stripe.Invoice: invoiceLineItemType :: InvoiceLineItem -> InvoiceLineItemType
- Web.Stripe.Invoice: invoiceLineItems :: Invoice -> StripeList InvoiceLineItem
- Web.Stripe.Invoice: invoiceLiveMode :: Invoice -> Bool
- Web.Stripe.Invoice: invoiceMetaData :: Invoice -> MetaData
- Web.Stripe.Invoice: invoiceNextPaymentAttempt :: Invoice -> Maybe UTCTime
- Web.Stripe.Invoice: invoiceObject :: Invoice -> Text
- Web.Stripe.Invoice: invoicePaid :: Invoice -> Bool
- Web.Stripe.Invoice: invoicePeriodEnd :: Invoice -> UTCTime
- Web.Stripe.Invoice: invoicePeriodStart :: Invoice -> UTCTime
- Web.Stripe.Invoice: invoiceStartingBalance :: Invoice -> Int
- Web.Stripe.Invoice: invoiceStatementDescription :: Invoice -> Maybe Description
- Web.Stripe.Invoice: invoiceSubTotal :: Invoice -> Int
- Web.Stripe.Invoice: invoiceSubscription :: Invoice -> Maybe SubscriptionId
- Web.Stripe.Invoice: invoiceTotal :: Invoice -> Int
- Web.Stripe.Invoice: invoiceWebHooksDeliveredAt :: Invoice -> Maybe UTCTime
- Web.Stripe.Invoice: newtype InvoiceLineItemId
- Web.Stripe.Invoice: payInvoice :: InvoiceId -> Stripe Invoice
- Web.Stripe.Invoice: start :: Period -> UTCTime
- Web.Stripe.Invoice: updateInvoice :: InvoiceId -> MetaData -> Stripe Invoice
- Web.Stripe.InvoiceItem: AED :: Currency
- Web.Stripe.InvoiceItem: AFN :: Currency
- Web.Stripe.InvoiceItem: ALL :: Currency
- Web.Stripe.InvoiceItem: AMD :: Currency
- Web.Stripe.InvoiceItem: ANG :: Currency
- Web.Stripe.InvoiceItem: AOA :: Currency
- Web.Stripe.InvoiceItem: ARS :: Currency
- Web.Stripe.InvoiceItem: AUD :: Currency
- Web.Stripe.InvoiceItem: AWG :: Currency
- Web.Stripe.InvoiceItem: AZN :: Currency
- Web.Stripe.InvoiceItem: BAM :: Currency
- Web.Stripe.InvoiceItem: BBD :: Currency
- Web.Stripe.InvoiceItem: BDT :: Currency
- Web.Stripe.InvoiceItem: BGN :: Currency
- Web.Stripe.InvoiceItem: BIF :: Currency
- Web.Stripe.InvoiceItem: BMD :: Currency
- Web.Stripe.InvoiceItem: BND :: Currency
- Web.Stripe.InvoiceItem: BOB :: Currency
- Web.Stripe.InvoiceItem: BRL :: Currency
- Web.Stripe.InvoiceItem: BSD :: Currency
- Web.Stripe.InvoiceItem: BWP :: Currency
- Web.Stripe.InvoiceItem: BZD :: Currency
- Web.Stripe.InvoiceItem: CAD :: Currency
- Web.Stripe.InvoiceItem: CDF :: Currency
- Web.Stripe.InvoiceItem: CHF :: Currency
- Web.Stripe.InvoiceItem: CLP :: Currency
- Web.Stripe.InvoiceItem: CNY :: Currency
- Web.Stripe.InvoiceItem: COP :: Currency
- Web.Stripe.InvoiceItem: CRC :: Currency
- Web.Stripe.InvoiceItem: CVE :: Currency
- Web.Stripe.InvoiceItem: CZK :: Currency
- Web.Stripe.InvoiceItem: CustomerId :: Text -> CustomerId
- Web.Stripe.InvoiceItem: DJF :: Currency
- Web.Stripe.InvoiceItem: DKK :: Currency
- Web.Stripe.InvoiceItem: DOP :: Currency
- Web.Stripe.InvoiceItem: DZD :: Currency
- Web.Stripe.InvoiceItem: EEK :: Currency
- Web.Stripe.InvoiceItem: EGP :: Currency
- Web.Stripe.InvoiceItem: ETB :: Currency
- Web.Stripe.InvoiceItem: EUR :: Currency
- Web.Stripe.InvoiceItem: ExpandedCustomer :: Customer -> CustomerId
- Web.Stripe.InvoiceItem: ExpandedInvoice :: Invoice -> InvoiceId
- Web.Stripe.InvoiceItem: ExpandedInvoiceItem :: InvoiceItem -> InvoiceItemId
- Web.Stripe.InvoiceItem: FJD :: Currency
- Web.Stripe.InvoiceItem: FKP :: Currency
- Web.Stripe.InvoiceItem: GBP :: Currency
- Web.Stripe.InvoiceItem: GEL :: Currency
- Web.Stripe.InvoiceItem: GIP :: Currency
- Web.Stripe.InvoiceItem: GMD :: Currency
- Web.Stripe.InvoiceItem: GNF :: Currency
- Web.Stripe.InvoiceItem: GTQ :: Currency
- Web.Stripe.InvoiceItem: GYD :: Currency
- Web.Stripe.InvoiceItem: HKD :: Currency
- Web.Stripe.InvoiceItem: HNL :: Currency
- Web.Stripe.InvoiceItem: HRK :: Currency
- Web.Stripe.InvoiceItem: HTG :: Currency
- Web.Stripe.InvoiceItem: HUF :: Currency
- Web.Stripe.InvoiceItem: IDR :: Currency
- Web.Stripe.InvoiceItem: ILS :: Currency
- Web.Stripe.InvoiceItem: INR :: Currency
- Web.Stripe.InvoiceItem: ISK :: Currency
- Web.Stripe.InvoiceItem: Invoice :: UTCTime -> Maybe InvoiceId -> UTCTime -> UTCTime -> StripeList InvoiceLineItem -> Int -> Int -> CustomerId -> Text -> Bool -> Bool -> Bool -> Bool -> Bool -> Int -> Int -> Currency -> Int -> Maybe Int -> Maybe UTCTime -> Maybe UTCTime -> Maybe ChargeId -> Maybe Discount -> Maybe FeeId -> Maybe SubscriptionId -> Maybe Description -> Maybe Description -> MetaData -> Invoice
- Web.Stripe.InvoiceItem: InvoiceId :: Text -> InvoiceId
- Web.Stripe.InvoiceItem: InvoiceItem :: Text -> InvoiceItemId -> UTCTime -> Int -> Bool -> Bool -> Currency -> CustomerId -> Maybe Description -> Maybe InvoiceId -> Maybe Quantity -> Maybe Subscription -> MetaData -> InvoiceItem
- Web.Stripe.InvoiceItem: InvoiceItemId :: Text -> InvoiceItemId
- Web.Stripe.InvoiceItem: JMD :: Currency
- Web.Stripe.InvoiceItem: JPY :: Currency
- Web.Stripe.InvoiceItem: KES :: Currency
- Web.Stripe.InvoiceItem: KGS :: Currency
- Web.Stripe.InvoiceItem: KHR :: Currency
- Web.Stripe.InvoiceItem: KMF :: Currency
- Web.Stripe.InvoiceItem: KRW :: Currency
- Web.Stripe.InvoiceItem: KYD :: Currency
- Web.Stripe.InvoiceItem: KZT :: Currency
- Web.Stripe.InvoiceItem: LAK :: Currency
- Web.Stripe.InvoiceItem: LBP :: Currency
- Web.Stripe.InvoiceItem: LKR :: Currency
- Web.Stripe.InvoiceItem: LRD :: Currency
- Web.Stripe.InvoiceItem: LSL :: Currency
- Web.Stripe.InvoiceItem: LTL :: Currency
- Web.Stripe.InvoiceItem: LVL :: Currency
- Web.Stripe.InvoiceItem: MAD :: Currency
- Web.Stripe.InvoiceItem: MDL :: Currency
- Web.Stripe.InvoiceItem: MGA :: Currency
- Web.Stripe.InvoiceItem: MKD :: Currency
- Web.Stripe.InvoiceItem: MNT :: Currency
- Web.Stripe.InvoiceItem: MOP :: Currency
- Web.Stripe.InvoiceItem: MRO :: Currency
- Web.Stripe.InvoiceItem: MUR :: Currency
- Web.Stripe.InvoiceItem: MVR :: Currency
- Web.Stripe.InvoiceItem: MWK :: Currency
- Web.Stripe.InvoiceItem: MXN :: Currency
- Web.Stripe.InvoiceItem: MYR :: Currency
- Web.Stripe.InvoiceItem: MZN :: Currency
- Web.Stripe.InvoiceItem: NAD :: Currency
- Web.Stripe.InvoiceItem: NGN :: Currency
- Web.Stripe.InvoiceItem: NIO :: Currency
- Web.Stripe.InvoiceItem: NOK :: Currency
- Web.Stripe.InvoiceItem: NPR :: Currency
- Web.Stripe.InvoiceItem: NZD :: Currency
- Web.Stripe.InvoiceItem: PAB :: Currency
- Web.Stripe.InvoiceItem: PEN :: Currency
- Web.Stripe.InvoiceItem: PGK :: Currency
- Web.Stripe.InvoiceItem: PHP :: Currency
- Web.Stripe.InvoiceItem: PKR :: Currency
- Web.Stripe.InvoiceItem: PLN :: Currency
- Web.Stripe.InvoiceItem: PYG :: Currency
- Web.Stripe.InvoiceItem: QAR :: Currency
- Web.Stripe.InvoiceItem: RON :: Currency
- Web.Stripe.InvoiceItem: RSD :: Currency
- Web.Stripe.InvoiceItem: RUB :: Currency
- Web.Stripe.InvoiceItem: RWF :: Currency
- Web.Stripe.InvoiceItem: SAR :: Currency
- Web.Stripe.InvoiceItem: SBD :: Currency
- Web.Stripe.InvoiceItem: SCR :: Currency
- Web.Stripe.InvoiceItem: SEK :: Currency
- Web.Stripe.InvoiceItem: SGD :: Currency
- Web.Stripe.InvoiceItem: SHP :: Currency
- Web.Stripe.InvoiceItem: SLL :: Currency
- Web.Stripe.InvoiceItem: SOS :: Currency
- Web.Stripe.InvoiceItem: SRD :: Currency
- Web.Stripe.InvoiceItem: STD :: Currency
- Web.Stripe.InvoiceItem: SVC :: Currency
- Web.Stripe.InvoiceItem: SZL :: Currency
- Web.Stripe.InvoiceItem: StripeDeleteResult :: Bool -> Maybe Text -> StripeDeleteResult
- Web.Stripe.InvoiceItem: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.InvoiceItem: SubscriptionId :: Text -> SubscriptionId
- Web.Stripe.InvoiceItem: THB :: Currency
- Web.Stripe.InvoiceItem: TJS :: Currency
- Web.Stripe.InvoiceItem: TOP :: Currency
- Web.Stripe.InvoiceItem: TRY :: Currency
- Web.Stripe.InvoiceItem: TTD :: Currency
- Web.Stripe.InvoiceItem: TWD :: Currency
- Web.Stripe.InvoiceItem: TZS :: Currency
- Web.Stripe.InvoiceItem: UAH :: Currency
- Web.Stripe.InvoiceItem: UGX :: Currency
- Web.Stripe.InvoiceItem: USD :: Currency
- Web.Stripe.InvoiceItem: UYU :: Currency
- Web.Stripe.InvoiceItem: UZS :: Currency
- Web.Stripe.InvoiceItem: UnknownCurrency :: Currency
- Web.Stripe.InvoiceItem: VND :: Currency
- Web.Stripe.InvoiceItem: VUV :: Currency
- Web.Stripe.InvoiceItem: WST :: Currency
- Web.Stripe.InvoiceItem: XAF :: Currency
- Web.Stripe.InvoiceItem: XCD :: Currency
- Web.Stripe.InvoiceItem: XOF :: Currency
- Web.Stripe.InvoiceItem: XPF :: Currency
- Web.Stripe.InvoiceItem: YER :: Currency
- Web.Stripe.InvoiceItem: ZAR :: Currency
- Web.Stripe.InvoiceItem: ZMW :: Currency
- Web.Stripe.InvoiceItem: createInvoiceItem :: CustomerId -> Amount -> Currency -> Maybe InvoiceId -> Maybe SubscriptionId -> Maybe Description -> MetaData -> Stripe InvoiceItem
- Web.Stripe.InvoiceItem: data Currency
- Web.Stripe.InvoiceItem: data CustomerId
- Web.Stripe.InvoiceItem: data Invoice
- Web.Stripe.InvoiceItem: data InvoiceId
- Web.Stripe.InvoiceItem: data InvoiceItem
- Web.Stripe.InvoiceItem: data InvoiceItemId
- Web.Stripe.InvoiceItem: data StripeDeleteResult
- Web.Stripe.InvoiceItem: data StripeList a
- Web.Stripe.InvoiceItem: deleteInvoiceItem :: InvoiceItemId -> Stripe StripeDeleteResult
- Web.Stripe.InvoiceItem: deleted :: StripeDeleteResult -> Bool
- Web.Stripe.InvoiceItem: deletedId :: StripeDeleteResult -> Maybe Text
- Web.Stripe.InvoiceItem: getInvoiceItem :: InvoiceItemId -> Stripe InvoiceItem
- Web.Stripe.InvoiceItem: getInvoiceItemExpandable :: InvoiceItemId -> ExpandParams -> Stripe InvoiceItem
- Web.Stripe.InvoiceItem: getInvoiceItems :: Maybe CustomerId -> Limit -> StartingAfter InvoiceItemId -> EndingBefore InvoiceItemId -> Stripe (StripeList InvoiceItem)
- Web.Stripe.InvoiceItem: getInvoiceItemsExpandable :: Maybe CustomerId -> Limit -> StartingAfter InvoiceItemId -> EndingBefore InvoiceItemId -> ExpandParams -> Stripe (StripeList InvoiceItem)
- Web.Stripe.InvoiceItem: hasMore :: StripeList a -> Bool
- Web.Stripe.InvoiceItem: invoiceAmountDue :: Invoice -> Int
- Web.Stripe.InvoiceItem: invoiceApplicateFee :: Invoice -> Maybe FeeId
- Web.Stripe.InvoiceItem: invoiceAttemptCount :: Invoice -> Int
- Web.Stripe.InvoiceItem: invoiceAttempted :: Invoice -> Bool
- Web.Stripe.InvoiceItem: invoiceCharge :: Invoice -> Maybe ChargeId
- Web.Stripe.InvoiceItem: invoiceClosed :: Invoice -> Bool
- Web.Stripe.InvoiceItem: invoiceCurrency :: Invoice -> Currency
- Web.Stripe.InvoiceItem: invoiceCustomer :: Invoice -> CustomerId
- Web.Stripe.InvoiceItem: invoiceDate :: Invoice -> UTCTime
- Web.Stripe.InvoiceItem: invoiceDescription :: Invoice -> Maybe Description
- Web.Stripe.InvoiceItem: invoiceDiscount :: Invoice -> Maybe Discount
- Web.Stripe.InvoiceItem: invoiceEndingBalance :: Invoice -> Maybe Int
- Web.Stripe.InvoiceItem: invoiceForgiven :: Invoice -> Bool
- Web.Stripe.InvoiceItem: invoiceId :: Invoice -> Maybe InvoiceId
- Web.Stripe.InvoiceItem: invoiceItemAmount :: InvoiceItem -> Int
- Web.Stripe.InvoiceItem: invoiceItemCurrency :: InvoiceItem -> Currency
- Web.Stripe.InvoiceItem: invoiceItemCustomer :: InvoiceItem -> CustomerId
- Web.Stripe.InvoiceItem: invoiceItemDate :: InvoiceItem -> UTCTime
- Web.Stripe.InvoiceItem: invoiceItemDescription :: InvoiceItem -> Maybe Description
- Web.Stripe.InvoiceItem: invoiceItemId :: InvoiceItem -> InvoiceItemId
- Web.Stripe.InvoiceItem: invoiceItemInvoice :: InvoiceItem -> Maybe InvoiceId
- Web.Stripe.InvoiceItem: invoiceItemLiveMode :: InvoiceItem -> Bool
- Web.Stripe.InvoiceItem: invoiceItemMetaData :: InvoiceItem -> MetaData
- Web.Stripe.InvoiceItem: invoiceItemObject :: InvoiceItem -> Text
- Web.Stripe.InvoiceItem: invoiceItemProration :: InvoiceItem -> Bool
- Web.Stripe.InvoiceItem: invoiceItemQuantity :: InvoiceItem -> Maybe Quantity
- Web.Stripe.InvoiceItem: invoiceItemSubscription :: InvoiceItem -> Maybe Subscription
- Web.Stripe.InvoiceItem: invoiceLineItems :: Invoice -> StripeList InvoiceLineItem
- Web.Stripe.InvoiceItem: invoiceLiveMode :: Invoice -> Bool
- Web.Stripe.InvoiceItem: invoiceMetaData :: Invoice -> MetaData
- Web.Stripe.InvoiceItem: invoiceNextPaymentAttempt :: Invoice -> Maybe UTCTime
- Web.Stripe.InvoiceItem: invoiceObject :: Invoice -> Text
- Web.Stripe.InvoiceItem: invoicePaid :: Invoice -> Bool
- Web.Stripe.InvoiceItem: invoicePeriodEnd :: Invoice -> UTCTime
- Web.Stripe.InvoiceItem: invoicePeriodStart :: Invoice -> UTCTime
- Web.Stripe.InvoiceItem: invoiceStartingBalance :: Invoice -> Int
- Web.Stripe.InvoiceItem: invoiceStatementDescription :: Invoice -> Maybe Description
- Web.Stripe.InvoiceItem: invoiceSubTotal :: Invoice -> Int
- Web.Stripe.InvoiceItem: invoiceSubscription :: Invoice -> Maybe SubscriptionId
- Web.Stripe.InvoiceItem: invoiceTotal :: Invoice -> Int
- Web.Stripe.InvoiceItem: invoiceWebHooksDeliveredAt :: Invoice -> Maybe UTCTime
- Web.Stripe.InvoiceItem: list :: StripeList a -> [a]
- Web.Stripe.InvoiceItem: newtype SubscriptionId
- Web.Stripe.InvoiceItem: object :: StripeList a -> Text
- Web.Stripe.InvoiceItem: stripeUrl :: StripeList a -> Text
- Web.Stripe.InvoiceItem: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.InvoiceItem: type Amount = Int
- Web.Stripe.InvoiceItem: type Description = Text
- Web.Stripe.InvoiceItem: updateInvoiceItem :: InvoiceItemId -> Maybe Amount -> Maybe Description -> MetaData -> Stripe InvoiceItem
- Web.Stripe.Plan: AED :: Currency
- Web.Stripe.Plan: AFN :: Currency
- Web.Stripe.Plan: ALL :: Currency
- Web.Stripe.Plan: AMD :: Currency
- Web.Stripe.Plan: ANG :: Currency
- Web.Stripe.Plan: AOA :: Currency
- Web.Stripe.Plan: ARS :: Currency
- Web.Stripe.Plan: AUD :: Currency
- Web.Stripe.Plan: AWG :: Currency
- Web.Stripe.Plan: AZN :: Currency
- Web.Stripe.Plan: BAM :: Currency
- Web.Stripe.Plan: BBD :: Currency
- Web.Stripe.Plan: BDT :: Currency
- Web.Stripe.Plan: BGN :: Currency
- Web.Stripe.Plan: BIF :: Currency
- Web.Stripe.Plan: BMD :: Currency
- Web.Stripe.Plan: BND :: Currency
- Web.Stripe.Plan: BOB :: Currency
- Web.Stripe.Plan: BRL :: Currency
- Web.Stripe.Plan: BSD :: Currency
- Web.Stripe.Plan: BWP :: Currency
- Web.Stripe.Plan: BZD :: Currency
- Web.Stripe.Plan: CAD :: Currency
- Web.Stripe.Plan: CDF :: Currency
- Web.Stripe.Plan: CHF :: Currency
- Web.Stripe.Plan: CLP :: Currency
- Web.Stripe.Plan: CNY :: Currency
- Web.Stripe.Plan: COP :: Currency
- Web.Stripe.Plan: CRC :: Currency
- Web.Stripe.Plan: CVE :: Currency
- Web.Stripe.Plan: CZK :: Currency
- Web.Stripe.Plan: DJF :: Currency
- Web.Stripe.Plan: DKK :: Currency
- Web.Stripe.Plan: DOP :: Currency
- Web.Stripe.Plan: DZD :: Currency
- Web.Stripe.Plan: Day :: Interval
- Web.Stripe.Plan: EEK :: Currency
- Web.Stripe.Plan: EGP :: Currency
- Web.Stripe.Plan: ETB :: Currency
- Web.Stripe.Plan: EUR :: Currency
- Web.Stripe.Plan: Email :: Text -> Email
- Web.Stripe.Plan: FJD :: Currency
- Web.Stripe.Plan: FKP :: Currency
- Web.Stripe.Plan: GBP :: Currency
- Web.Stripe.Plan: GEL :: Currency
- Web.Stripe.Plan: GIP :: Currency
- Web.Stripe.Plan: GMD :: Currency
- Web.Stripe.Plan: GNF :: Currency
- Web.Stripe.Plan: GTQ :: Currency
- Web.Stripe.Plan: GYD :: Currency
- Web.Stripe.Plan: HKD :: Currency
- Web.Stripe.Plan: HNL :: Currency
- Web.Stripe.Plan: HRK :: Currency
- Web.Stripe.Plan: HTG :: Currency
- Web.Stripe.Plan: HUF :: Currency
- Web.Stripe.Plan: IDR :: Currency
- Web.Stripe.Plan: ILS :: Currency
- Web.Stripe.Plan: INR :: Currency
- Web.Stripe.Plan: ISK :: Currency
- Web.Stripe.Plan: IntervalCount :: Int -> IntervalCount
- Web.Stripe.Plan: JMD :: Currency
- Web.Stripe.Plan: JPY :: Currency
- Web.Stripe.Plan: KES :: Currency
- Web.Stripe.Plan: KGS :: Currency
- Web.Stripe.Plan: KHR :: Currency
- Web.Stripe.Plan: KMF :: Currency
- Web.Stripe.Plan: KRW :: Currency
- Web.Stripe.Plan: KYD :: Currency
- Web.Stripe.Plan: KZT :: Currency
- Web.Stripe.Plan: LAK :: Currency
- Web.Stripe.Plan: LBP :: Currency
- Web.Stripe.Plan: LKR :: Currency
- Web.Stripe.Plan: LRD :: Currency
- Web.Stripe.Plan: LSL :: Currency
- Web.Stripe.Plan: LTL :: Currency
- Web.Stripe.Plan: LVL :: Currency
- Web.Stripe.Plan: MAD :: Currency
- Web.Stripe.Plan: MDL :: Currency
- Web.Stripe.Plan: MGA :: Currency
- Web.Stripe.Plan: MKD :: Currency
- Web.Stripe.Plan: MNT :: Currency
- Web.Stripe.Plan: MOP :: Currency
- Web.Stripe.Plan: MRO :: Currency
- Web.Stripe.Plan: MUR :: Currency
- Web.Stripe.Plan: MVR :: Currency
- Web.Stripe.Plan: MWK :: Currency
- Web.Stripe.Plan: MXN :: Currency
- Web.Stripe.Plan: MYR :: Currency
- Web.Stripe.Plan: MZN :: Currency
- Web.Stripe.Plan: Month :: Interval
- Web.Stripe.Plan: NAD :: Currency
- Web.Stripe.Plan: NGN :: Currency
- Web.Stripe.Plan: NIO :: Currency
- Web.Stripe.Plan: NOK :: Currency
- Web.Stripe.Plan: NPR :: Currency
- Web.Stripe.Plan: NZD :: Currency
- Web.Stripe.Plan: PAB :: Currency
- Web.Stripe.Plan: PEN :: Currency
- Web.Stripe.Plan: PGK :: Currency
- Web.Stripe.Plan: PHP :: Currency
- Web.Stripe.Plan: PKR :: Currency
- Web.Stripe.Plan: PLN :: Currency
- Web.Stripe.Plan: PYG :: Currency
- Web.Stripe.Plan: Plan :: Interval -> Text -> UTCTime -> Int -> Currency -> PlanId -> Text -> Bool -> Maybe Int -> Maybe Int -> MetaData -> Maybe Description -> Plan
- Web.Stripe.Plan: PlanId :: Text -> PlanId
- Web.Stripe.Plan: QAR :: Currency
- Web.Stripe.Plan: RON :: Currency
- Web.Stripe.Plan: RSD :: Currency
- Web.Stripe.Plan: RUB :: Currency
- Web.Stripe.Plan: RWF :: Currency
- Web.Stripe.Plan: SAR :: Currency
- Web.Stripe.Plan: SBD :: Currency
- Web.Stripe.Plan: SCR :: Currency
- Web.Stripe.Plan: SEK :: Currency
- Web.Stripe.Plan: SGD :: Currency
- Web.Stripe.Plan: SHP :: Currency
- Web.Stripe.Plan: SLL :: Currency
- Web.Stripe.Plan: SOS :: Currency
- Web.Stripe.Plan: SRD :: Currency
- Web.Stripe.Plan: STD :: Currency
- Web.Stripe.Plan: SVC :: Currency
- Web.Stripe.Plan: SZL :: Currency
- Web.Stripe.Plan: StripeDeleteResult :: Bool -> Maybe Text -> StripeDeleteResult
- Web.Stripe.Plan: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.Plan: THB :: Currency
- Web.Stripe.Plan: TJS :: Currency
- Web.Stripe.Plan: TOP :: Currency
- Web.Stripe.Plan: TRY :: Currency
- Web.Stripe.Plan: TTD :: Currency
- Web.Stripe.Plan: TWD :: Currency
- Web.Stripe.Plan: TZS :: Currency
- Web.Stripe.Plan: TrialPeriodDays :: Int -> TrialPeriodDays
- Web.Stripe.Plan: UAH :: Currency
- Web.Stripe.Plan: UGX :: Currency
- Web.Stripe.Plan: USD :: Currency
- Web.Stripe.Plan: UYU :: Currency
- Web.Stripe.Plan: UZS :: Currency
- Web.Stripe.Plan: UnknownCurrency :: Currency
- Web.Stripe.Plan: VND :: Currency
- Web.Stripe.Plan: VUV :: Currency
- Web.Stripe.Plan: WST :: Currency
- Web.Stripe.Plan: Week :: Interval
- Web.Stripe.Plan: XAF :: Currency
- Web.Stripe.Plan: XCD :: Currency
- Web.Stripe.Plan: XOF :: Currency
- Web.Stripe.Plan: XPF :: Currency
- Web.Stripe.Plan: YER :: Currency
- Web.Stripe.Plan: Year :: Interval
- Web.Stripe.Plan: ZAR :: Currency
- Web.Stripe.Plan: ZMW :: Currency
- Web.Stripe.Plan: createPlan :: PlanId -> Amount -> Currency -> Interval -> Name -> MetaData -> Stripe Plan
- Web.Stripe.Plan: createPlanBase :: PlanId -> Amount -> Currency -> Interval -> Name -> Maybe IntervalCount -> Maybe TrialPeriodDays -> Maybe Description -> MetaData -> Stripe Plan
- Web.Stripe.Plan: createPlanIntervalCount :: PlanId -> Amount -> Currency -> Interval -> Name -> IntervalCount -> Stripe Plan
- Web.Stripe.Plan: createPlanTrialPeriodDays :: PlanId -> Amount -> Currency -> Interval -> Name -> TrialPeriodDays -> Stripe Plan
- Web.Stripe.Plan: data Currency
- Web.Stripe.Plan: data Interval
- Web.Stripe.Plan: data Plan
- Web.Stripe.Plan: data StripeDeleteResult
- Web.Stripe.Plan: data StripeList a
- Web.Stripe.Plan: deletePlan :: PlanId -> Stripe StripeDeleteResult
- Web.Stripe.Plan: deleted :: StripeDeleteResult -> Bool
- Web.Stripe.Plan: deletedId :: StripeDeleteResult -> Maybe Text
- Web.Stripe.Plan: getPlan :: PlanId -> Stripe Plan
- Web.Stripe.Plan: getPlans :: Limit -> StartingAfter PlanId -> EndingBefore PlanId -> Stripe (StripeList Plan)
- Web.Stripe.Plan: hasMore :: StripeList a -> Bool
- Web.Stripe.Plan: list :: StripeList a -> [a]
- Web.Stripe.Plan: newtype Email
- Web.Stripe.Plan: newtype IntervalCount
- Web.Stripe.Plan: newtype PlanId
- Web.Stripe.Plan: newtype TrialPeriodDays
- Web.Stripe.Plan: object :: StripeList a -> Text
- Web.Stripe.Plan: planAmount :: Plan -> Int
- Web.Stripe.Plan: planCreated :: Plan -> UTCTime
- Web.Stripe.Plan: planCurrency :: Plan -> Currency
- Web.Stripe.Plan: planDescription :: Plan -> Maybe Description
- Web.Stripe.Plan: planId :: Plan -> PlanId
- Web.Stripe.Plan: planInterval :: Plan -> Interval
- Web.Stripe.Plan: planIntervalCount :: Plan -> Maybe Int
- Web.Stripe.Plan: planLiveMode :: Plan -> Bool
- Web.Stripe.Plan: planMetaData :: Plan -> MetaData
- Web.Stripe.Plan: planName :: Plan -> Text
- Web.Stripe.Plan: planObject :: Plan -> Text
- Web.Stripe.Plan: planTrialPeriodDays :: Plan -> Maybe Int
- Web.Stripe.Plan: stripeUrl :: StripeList a -> Text
- Web.Stripe.Plan: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.Plan: type Amount = Int
- Web.Stripe.Plan: type Description = Text
- Web.Stripe.Plan: type EndingBefore a = Maybe a
- Web.Stripe.Plan: type Limit = Maybe Int
- Web.Stripe.Plan: type MetaData = [(Text, Text)]
- Web.Stripe.Plan: type Name = Text
- Web.Stripe.Plan: type StartingAfter a = Maybe a
- Web.Stripe.Plan: updatePlanBase :: PlanId -> Maybe Name -> Maybe Description -> MetaData -> Stripe Plan
- Web.Stripe.Plan: updatePlanDescription :: PlanId -> Description -> Stripe Plan
- Web.Stripe.Plan: updatePlanName :: PlanId -> Description -> Stripe Plan
- Web.Stripe.Recipient: AccountNumber :: Text -> AccountNumber
- Web.Stripe.Recipient: AddressCity :: Text -> AddressCity
- Web.Stripe.Recipient: AddressCountry :: Text -> AddressCountry
- Web.Stripe.Recipient: AddressLine1 :: Text -> AddressLine1
- Web.Stripe.Recipient: AddressLine2 :: Text -> AddressLine2
- Web.Stripe.Recipient: AddressState :: Text -> AddressState
- Web.Stripe.Recipient: AddressZip :: Text -> AddressZip
- Web.Stripe.Recipient: BankAccount :: BankAccountId -> Text -> Text -> Country -> Currency -> Maybe BankAccountStatus -> Maybe Text -> Text -> BankAccount
- Web.Stripe.Recipient: BankAccountId :: Text -> BankAccountId
- Web.Stripe.Recipient: Corporation :: RecipientType
- Web.Stripe.Recipient: Country :: Text -> Country
- Web.Stripe.Recipient: DeletedRecipient :: Maybe Bool -> RecipientId -> Recipient
- Web.Stripe.Recipient: Email :: Text -> Email
- Web.Stripe.Recipient: Errored :: BankAccountStatus
- Web.Stripe.Recipient: ExpandedRecipient :: Recipient -> RecipientId
- Web.Stripe.Recipient: FirstName :: Text -> FirstName
- Web.Stripe.Recipient: Individual :: RecipientType
- Web.Stripe.Recipient: LastName :: Text -> LastName
- Web.Stripe.Recipient: New :: BankAccountStatus
- Web.Stripe.Recipient: Recipient :: RecipientId -> Text -> UTCTime -> Bool -> RecipientType -> Maybe Description -> Maybe Email -> Name -> Bool -> Maybe BankAccount -> StripeList RecipientCard -> Maybe RecipientCardId -> Recipient
- Web.Stripe.Recipient: RecipientId :: Text -> RecipientId
- Web.Stripe.Recipient: RoutingNumber :: Text -> RoutingNumber
- Web.Stripe.Recipient: StripeDeleteResult :: Bool -> Maybe Text -> StripeDeleteResult
- Web.Stripe.Recipient: Validated :: BankAccountStatus
- Web.Stripe.Recipient: Verified :: BankAccountStatus
- Web.Stripe.Recipient: bankAccountCountry :: BankAccount -> Country
- Web.Stripe.Recipient: bankAccountCurrency :: BankAccount -> Currency
- Web.Stripe.Recipient: bankAccountFingerprint :: BankAccount -> Maybe Text
- Web.Stripe.Recipient: bankAccountId :: BankAccount -> BankAccountId
- Web.Stripe.Recipient: bankAccountLast4 :: BankAccount -> Text
- Web.Stripe.Recipient: bankAccountName :: BankAccount -> Text
- Web.Stripe.Recipient: bankAccountObject :: BankAccount -> Text
- Web.Stripe.Recipient: bankAccountStatus :: BankAccount -> Maybe BankAccountStatus
- Web.Stripe.Recipient: createRecipient :: FirstName -> LastName -> Maybe MiddleInitial -> RecipientType -> Stripe Recipient
- Web.Stripe.Recipient: createRecipientBase :: FirstName -> LastName -> Maybe MiddleInitial -> RecipientType -> Maybe TaxID -> Maybe Country -> Maybe RoutingNumber -> Maybe AccountNumber -> Maybe TokenId -> Maybe CardNumber -> Maybe ExpMonth -> Maybe ExpYear -> Maybe CVC -> Maybe Email -> Maybe Description -> MetaData -> Stripe Recipient
- Web.Stripe.Recipient: createRecipientByBank :: FirstName -> LastName -> Maybe MiddleInitial -> RecipientType -> Country -> RoutingNumber -> AccountNumber -> Stripe Recipient
- Web.Stripe.Recipient: createRecipientByCard :: FirstName -> LastName -> Maybe MiddleInitial -> RecipientType -> CardNumber -> ExpMonth -> ExpYear -> CVC -> Stripe Recipient
- Web.Stripe.Recipient: createRecipientByToken :: FirstName -> LastName -> Maybe MiddleInitial -> RecipientType -> TokenId -> Stripe Recipient
- Web.Stripe.Recipient: data BankAccount
- Web.Stripe.Recipient: data BankAccountStatus
- Web.Stripe.Recipient: data CVC
- Web.Stripe.Recipient: data CardNumber
- Web.Stripe.Recipient: data ExpMonth
- Web.Stripe.Recipient: data ExpYear
- Web.Stripe.Recipient: data Recipient
- Web.Stripe.Recipient: data RecipientId
- Web.Stripe.Recipient: data RecipientType
- Web.Stripe.Recipient: data StripeDeleteResult
- Web.Stripe.Recipient: data TokenId
- Web.Stripe.Recipient: deleteRecipient :: RecipientId -> Stripe StripeDeleteResult
- Web.Stripe.Recipient: deleted :: StripeDeleteResult -> Bool
- Web.Stripe.Recipient: deletedId :: StripeDeleteResult -> Maybe Text
- Web.Stripe.Recipient: deletedRecipient :: Recipient -> Maybe Bool
- Web.Stripe.Recipient: deletedRecipientId :: Recipient -> RecipientId
- Web.Stripe.Recipient: getRecipient :: RecipientId -> Stripe Recipient
- Web.Stripe.Recipient: getRecipientExpandable :: RecipientId -> ExpandParams -> Stripe Recipient
- Web.Stripe.Recipient: getRecipients :: Limit -> StartingAfter RecipientId -> EndingBefore RecipientId -> Stripe (StripeList Recipient)
- Web.Stripe.Recipient: getRecipientsExpandable :: Limit -> StartingAfter RecipientId -> EndingBefore RecipientId -> ExpandParams -> Stripe (StripeList Recipient)
- Web.Stripe.Recipient: newtype AccountNumber
- Web.Stripe.Recipient: newtype AddressCity
- Web.Stripe.Recipient: newtype AddressCountry
- Web.Stripe.Recipient: newtype AddressLine1
- Web.Stripe.Recipient: newtype AddressLine2
- Web.Stripe.Recipient: newtype AddressState
- Web.Stripe.Recipient: newtype AddressZip
- Web.Stripe.Recipient: newtype BankAccountId
- Web.Stripe.Recipient: newtype Country
- Web.Stripe.Recipient: newtype Email
- Web.Stripe.Recipient: newtype FirstName
- Web.Stripe.Recipient: newtype LastName
- Web.Stripe.Recipient: newtype RoutingNumber
- Web.Stripe.Recipient: recipientActiveAccount :: Recipient -> Maybe BankAccount
- Web.Stripe.Recipient: recipientCards :: Recipient -> StripeList RecipientCard
- Web.Stripe.Recipient: recipientCreated :: Recipient -> UTCTime
- Web.Stripe.Recipient: recipientDefaultCard :: Recipient -> Maybe RecipientCardId
- Web.Stripe.Recipient: recipientDescription :: Recipient -> Maybe Description
- Web.Stripe.Recipient: recipientEmail :: Recipient -> Maybe Email
- Web.Stripe.Recipient: recipientId :: Recipient -> RecipientId
- Web.Stripe.Recipient: recipientLiveMode :: Recipient -> Bool
- Web.Stripe.Recipient: recipientName :: Recipient -> Name
- Web.Stripe.Recipient: recipientObject :: Recipient -> Text
- Web.Stripe.Recipient: recipientType :: Recipient -> RecipientType
- Web.Stripe.Recipient: recipientVerified :: Recipient -> Bool
- Web.Stripe.Recipient: type Description = Text
- Web.Stripe.Recipient: type Limit = Maybe Int
- Web.Stripe.Recipient: type MiddleInitial = Char
- Web.Stripe.Recipient: type TaxID = Text
- Web.Stripe.Recipient: updateRecipientBankAccount :: RecipientId -> Country -> RoutingNumber -> AccountNumber -> Stripe Recipient
- Web.Stripe.Recipient: updateRecipientBase :: RecipientId -> Maybe FirstName -> Maybe LastName -> Maybe MiddleInitial -> Maybe TaxID -> Maybe Country -> Maybe RoutingNumber -> Maybe AccountNumber -> Maybe TokenId -> Maybe CardNumber -> Maybe ExpMonth -> Maybe ExpYear -> Maybe CVC -> Maybe CardId -> Maybe Email -> Maybe Description -> MetaData -> Stripe Recipient
- Web.Stripe.Recipient: updateRecipientDefaultCard :: RecipientId -> CardId -> Stripe Recipient
- Web.Stripe.Recipient: updateRecipientDescription :: RecipientId -> Description -> Stripe Recipient
- Web.Stripe.Recipient: updateRecipientEmail :: RecipientId -> Email -> Stripe Recipient
- Web.Stripe.Recipient: updateRecipientMetaData :: RecipientId -> MetaData -> Stripe Recipient
- Web.Stripe.Recipient: updateRecipientName :: RecipientId -> FirstName -> LastName -> MiddleInitial -> Stripe Recipient
- Web.Stripe.Recipient: updateRecipientTaxID :: RecipientId -> TaxID -> Stripe Recipient
- Web.Stripe.Recipient: updateRecipientTokenID :: RecipientId -> TokenId -> Stripe Recipient
- Web.Stripe.Refund: Charge :: ChargeId -> Text -> UTCTime -> Bool -> Bool -> Int -> Currency -> Bool -> Card -> Bool -> StripeList Refund -> Maybe TransactionId -> Maybe Text -> Maybe Text -> Int -> Maybe CustomerId -> Maybe InvoiceId -> Maybe Description -> Maybe Dispute -> MetaData -> Maybe Description -> Maybe Text -> Maybe Text -> Charge
- Web.Stripe.Refund: ChargeId :: Text -> ChargeId
- Web.Stripe.Refund: ExpandedCharge :: Charge -> ChargeId
- Web.Stripe.Refund: Refund :: RefundId -> Int -> Currency -> UTCTime -> Text -> ChargeId -> TransactionId -> MetaData -> Refund
- Web.Stripe.Refund: RefundId :: Text -> RefundId
- Web.Stripe.Refund: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.Refund: chargeAmount :: Charge -> Int
- Web.Stripe.Refund: chargeAmountRefunded :: Charge -> Int
- Web.Stripe.Refund: chargeBalanceTransaction :: Charge -> Maybe TransactionId
- Web.Stripe.Refund: chargeCaptured :: Charge -> Bool
- Web.Stripe.Refund: chargeCreated :: Charge -> UTCTime
- Web.Stripe.Refund: chargeCreditCard :: Charge -> Card
- Web.Stripe.Refund: chargeCurrency :: Charge -> Currency
- Web.Stripe.Refund: chargeCustomerId :: Charge -> Maybe CustomerId
- Web.Stripe.Refund: chargeDescription :: Charge -> Maybe Description
- Web.Stripe.Refund: chargeDispute :: Charge -> Maybe Dispute
- Web.Stripe.Refund: chargeFailureCode :: Charge -> Maybe Text
- Web.Stripe.Refund: chargeFailureMessage :: Charge -> Maybe Text
- Web.Stripe.Refund: chargeId :: Charge -> ChargeId
- Web.Stripe.Refund: chargeInvoice :: Charge -> Maybe InvoiceId
- Web.Stripe.Refund: chargeLiveMode :: Charge -> Bool
- Web.Stripe.Refund: chargeMetaData :: Charge -> MetaData
- Web.Stripe.Refund: chargeObject :: Charge -> Text
- Web.Stripe.Refund: chargePaid :: Charge -> Bool
- Web.Stripe.Refund: chargeReceiptEmail :: Charge -> Maybe Text
- Web.Stripe.Refund: chargeReceiptNumber :: Charge -> Maybe Text
- Web.Stripe.Refund: chargeRefunded :: Charge -> Bool
- Web.Stripe.Refund: chargeRefunds :: Charge -> StripeList Refund
- Web.Stripe.Refund: chargeStatementDescription :: Charge -> Maybe Description
- Web.Stripe.Refund: createRefund :: ChargeId -> MetaData -> Stripe Refund
- Web.Stripe.Refund: data Charge
- Web.Stripe.Refund: data ChargeId
- Web.Stripe.Refund: data Refund
- Web.Stripe.Refund: data StripeList a
- Web.Stripe.Refund: getRefund :: ChargeId -> RefundId -> Stripe Refund
- Web.Stripe.Refund: getRefundExpandable :: ChargeId -> RefundId -> ExpandParams -> Stripe Refund
- Web.Stripe.Refund: getRefunds :: ChargeId -> Limit -> StartingAfter RefundId -> EndingBefore RefundId -> Stripe (StripeList Refund)
- Web.Stripe.Refund: getRefundsExpandable :: ChargeId -> Limit -> StartingAfter RefundId -> EndingBefore RefundId -> ExpandParams -> Stripe (StripeList Refund)
- Web.Stripe.Refund: hasMore :: StripeList a -> Bool
- Web.Stripe.Refund: list :: StripeList a -> [a]
- Web.Stripe.Refund: newtype RefundId
- Web.Stripe.Refund: object :: StripeList a -> Text
- Web.Stripe.Refund: refundAmount :: Refund -> Int
- Web.Stripe.Refund: refundBalanceTransaction :: Refund -> TransactionId
- Web.Stripe.Refund: refundCharge :: Refund -> ChargeId
- Web.Stripe.Refund: refundCreated :: Refund -> UTCTime
- Web.Stripe.Refund: refundCurrency :: Refund -> Currency
- Web.Stripe.Refund: refundId :: Refund -> RefundId
- Web.Stripe.Refund: refundMetaData :: Refund -> MetaData
- Web.Stripe.Refund: refundObject :: Refund -> Text
- Web.Stripe.Refund: stripeUrl :: StripeList a -> Text
- Web.Stripe.Refund: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.Refund: updateRefund :: ChargeId -> RefundId -> MetaData -> Stripe Refund
- Web.Stripe.Subscription: Active :: SubscriptionStatus
- Web.Stripe.Subscription: Canceled :: SubscriptionStatus
- Web.Stripe.Subscription: Coupon :: CouponId -> UTCTime -> Maybe Int -> Maybe Int -> Maybe Currency -> Bool -> Duration -> Maybe UTCTime -> Maybe Int -> Maybe Int -> Maybe Int -> Bool -> MetaData -> Coupon
- Web.Stripe.Subscription: CouponId :: Text -> CouponId
- Web.Stripe.Subscription: CustomerId :: Text -> CustomerId
- Web.Stripe.Subscription: ExpandedCustomer :: Customer -> CustomerId
- Web.Stripe.Subscription: PastDue :: SubscriptionStatus
- Web.Stripe.Subscription: PlanId :: Text -> PlanId
- Web.Stripe.Subscription: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.Subscription: Subscription :: SubscriptionId -> Plan -> Text -> UTCTime -> SubscriptionStatus -> CustomerId -> Bool -> UTCTime -> UTCTime -> Maybe UTCTime -> Maybe UTCTime -> Maybe UTCTime -> Maybe UTCTime -> Quantity -> Maybe Double -> Maybe Discount -> MetaData -> Subscription
- Web.Stripe.Subscription: SubscriptionId :: Text -> SubscriptionId
- Web.Stripe.Subscription: Trialing :: SubscriptionStatus
- Web.Stripe.Subscription: UnPaid :: SubscriptionStatus
- Web.Stripe.Subscription: cancelSubscription :: CustomerId -> SubscriptionId -> Bool -> Stripe Subscription
- Web.Stripe.Subscription: couponAmountOff :: Coupon -> Maybe Int
- Web.Stripe.Subscription: couponCreated :: Coupon -> UTCTime
- Web.Stripe.Subscription: couponCurrency :: Coupon -> Maybe Currency
- Web.Stripe.Subscription: couponDuration :: Coupon -> Duration
- Web.Stripe.Subscription: couponDurationInMonths :: Coupon -> Maybe Int
- Web.Stripe.Subscription: couponId :: Coupon -> CouponId
- Web.Stripe.Subscription: couponLiveMode :: Coupon -> Bool
- Web.Stripe.Subscription: couponMaxRedemptions :: Coupon -> Maybe Int
- Web.Stripe.Subscription: couponMetaData :: Coupon -> MetaData
- Web.Stripe.Subscription: couponPercentOff :: Coupon -> Maybe Int
- Web.Stripe.Subscription: couponRedeemBy :: Coupon -> Maybe UTCTime
- Web.Stripe.Subscription: couponTimesRedeemed :: Coupon -> Maybe Int
- Web.Stripe.Subscription: couponValid :: Coupon -> Bool
- Web.Stripe.Subscription: createSubscription :: CustomerId -> PlanId -> MetaData -> Stripe Subscription
- Web.Stripe.Subscription: data Coupon
- Web.Stripe.Subscription: data CustomerId
- Web.Stripe.Subscription: data StripeList a
- Web.Stripe.Subscription: data Subscription
- Web.Stripe.Subscription: data SubscriptionStatus
- Web.Stripe.Subscription: getSubscription :: CustomerId -> SubscriptionId -> Stripe Subscription
- Web.Stripe.Subscription: getSubscriptionExpandable :: CustomerId -> SubscriptionId -> ExpandParams -> Stripe Subscription
- Web.Stripe.Subscription: getSubscriptions :: CustomerId -> Limit -> StartingAfter SubscriptionId -> EndingBefore SubscriptionId -> Stripe (StripeList Subscription)
- Web.Stripe.Subscription: getSubscriptionsExpandable :: CustomerId -> Limit -> StartingAfter SubscriptionId -> EndingBefore SubscriptionId -> ExpandParams -> Stripe (StripeList Subscription)
- Web.Stripe.Subscription: hasMore :: StripeList a -> Bool
- Web.Stripe.Subscription: list :: StripeList a -> [a]
- Web.Stripe.Subscription: newtype CouponId
- Web.Stripe.Subscription: newtype PlanId
- Web.Stripe.Subscription: newtype SubscriptionId
- Web.Stripe.Subscription: object :: StripeList a -> Text
- Web.Stripe.Subscription: stripeUrl :: StripeList a -> Text
- Web.Stripe.Subscription: subscriptionApplicationFeePercent :: Subscription -> Maybe Double
- Web.Stripe.Subscription: subscriptionCancelAtPeriodEnd :: Subscription -> Bool
- Web.Stripe.Subscription: subscriptionCanceledAt :: Subscription -> Maybe UTCTime
- Web.Stripe.Subscription: subscriptionCurrentPeriodEnd :: Subscription -> UTCTime
- Web.Stripe.Subscription: subscriptionCurrentPeriodStart :: Subscription -> UTCTime
- Web.Stripe.Subscription: subscriptionCustomerId :: Subscription -> CustomerId
- Web.Stripe.Subscription: subscriptionDiscount :: Subscription -> Maybe Discount
- Web.Stripe.Subscription: subscriptionEndedAt :: Subscription -> Maybe UTCTime
- Web.Stripe.Subscription: subscriptionId :: Subscription -> SubscriptionId
- Web.Stripe.Subscription: subscriptionMetaData :: Subscription -> MetaData
- Web.Stripe.Subscription: subscriptionObject :: Subscription -> Text
- Web.Stripe.Subscription: subscriptionPlan :: Subscription -> Plan
- Web.Stripe.Subscription: subscriptionQuantity :: Subscription -> Quantity
- Web.Stripe.Subscription: subscriptionStart :: Subscription -> UTCTime
- Web.Stripe.Subscription: subscriptionStatus :: Subscription -> SubscriptionStatus
- Web.Stripe.Subscription: subscriptionTrialEnd :: Subscription -> Maybe UTCTime
- Web.Stripe.Subscription: subscriptionTrialStart :: Subscription -> Maybe UTCTime
- Web.Stripe.Subscription: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.Subscription: updateSubscription :: CustomerId -> SubscriptionId -> Maybe CouponId -> Maybe PlanId -> MetaData -> Stripe Subscription
- Web.Stripe.Token: Account :: AccountId -> Email -> Maybe Description -> Maybe Text -> Text -> Bool -> Bool -> Bool -> [Currency] -> Currency -> Text -> Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Account
- Web.Stripe.Token: AccountNumber :: Text -> AccountNumber
- Web.Stripe.Token: CVC :: Text -> CVC
- Web.Stripe.Token: CardNumber :: Text -> CardNumber
- Web.Stripe.Token: Country :: Text -> Country
- Web.Stripe.Token: ExpMonth :: Int -> ExpMonth
- Web.Stripe.Token: ExpYear :: Int -> ExpYear
- Web.Stripe.Token: RoutingNumber :: Text -> RoutingNumber
- Web.Stripe.Token: Token :: TokenId -> Bool -> UTCTime -> Bool -> Text -> TokenType -> a -> Token a
- Web.Stripe.Token: TokenBankAccount :: TokenType
- Web.Stripe.Token: TokenCard :: TokenType
- Web.Stripe.Token: TokenId :: Text -> TokenId
- Web.Stripe.Token: accountBusinessLogo :: Account -> Maybe Text
- Web.Stripe.Token: accountBusinessName :: Account -> Maybe Text
- Web.Stripe.Token: accountBusinessURL :: Account -> Maybe Text
- Web.Stripe.Token: accountChargeEnabled :: Account -> Bool
- Web.Stripe.Token: accountCountry :: Account -> Text
- Web.Stripe.Token: accountCurrenciesSupported :: Account -> [Currency]
- Web.Stripe.Token: accountDefaultCurrency :: Account -> Currency
- Web.Stripe.Token: accountDetailsSubmitted :: Account -> Bool
- Web.Stripe.Token: accountDisplayName :: Account -> Maybe Text
- Web.Stripe.Token: accountEmail :: Account -> Email
- Web.Stripe.Token: accountId :: Account -> AccountId
- Web.Stripe.Token: accountObject :: Account -> Text
- Web.Stripe.Token: accountStatementDescriptor :: Account -> Maybe Description
- Web.Stripe.Token: accountSupportPhone :: Account -> Maybe Text
- Web.Stripe.Token: accountTimeZone :: Account -> Text
- Web.Stripe.Token: accountTransferEnabled :: Account -> Bool
- Web.Stripe.Token: createBankAccountToken :: Country -> RoutingNumber -> AccountNumber -> Stripe (Token BankAccount)
- Web.Stripe.Token: createCardToken :: CardNumber -> ExpMonth -> ExpYear -> CVC -> Stripe (Token Card)
- Web.Stripe.Token: data Account
- Web.Stripe.Token: data Token a
- Web.Stripe.Token: data TokenType
- Web.Stripe.Token: getBankAccountToken :: TokenId -> Stripe (Token BankAccount)
- Web.Stripe.Token: getCardToken :: TokenId -> Stripe (Token Card)
- Web.Stripe.Token: newtype AccountNumber
- Web.Stripe.Token: newtype CVC
- Web.Stripe.Token: newtype CardNumber
- Web.Stripe.Token: newtype Country
- Web.Stripe.Token: newtype ExpMonth
- Web.Stripe.Token: newtype ExpYear
- Web.Stripe.Token: newtype RoutingNumber
- Web.Stripe.Token: newtype TokenId
- Web.Stripe.Token: tokenCreated :: Token a -> UTCTime
- Web.Stripe.Token: tokenData :: Token a -> a
- Web.Stripe.Token: tokenId :: Token a -> TokenId
- Web.Stripe.Token: tokenLiveMode :: Token a -> Bool
- Web.Stripe.Token: tokenObject :: Token a -> Text
- Web.Stripe.Token: tokenType :: Token a -> TokenType
- Web.Stripe.Token: tokenUsed :: Token a -> Bool
- Web.Stripe.Transfer: AED :: Currency
- Web.Stripe.Transfer: AFN :: Currency
- Web.Stripe.Transfer: ALL :: Currency
- Web.Stripe.Transfer: AMD :: Currency
- Web.Stripe.Transfer: ANG :: Currency
- Web.Stripe.Transfer: AOA :: Currency
- Web.Stripe.Transfer: ARS :: Currency
- Web.Stripe.Transfer: AUD :: Currency
- Web.Stripe.Transfer: AWG :: Currency
- Web.Stripe.Transfer: AZN :: Currency
- Web.Stripe.Transfer: BAM :: Currency
- Web.Stripe.Transfer: BBD :: Currency
- Web.Stripe.Transfer: BDT :: Currency
- Web.Stripe.Transfer: BGN :: Currency
- Web.Stripe.Transfer: BIF :: Currency
- Web.Stripe.Transfer: BMD :: Currency
- Web.Stripe.Transfer: BND :: Currency
- Web.Stripe.Transfer: BOB :: Currency
- Web.Stripe.Transfer: BRL :: Currency
- Web.Stripe.Transfer: BSD :: Currency
- Web.Stripe.Transfer: BWP :: Currency
- Web.Stripe.Transfer: BZD :: Currency
- Web.Stripe.Transfer: BankAccountTransfer :: TransferType
- Web.Stripe.Transfer: CAD :: Currency
- Web.Stripe.Transfer: CDF :: Currency
- Web.Stripe.Transfer: CHF :: Currency
- Web.Stripe.Transfer: CLP :: Currency
- Web.Stripe.Transfer: CNY :: Currency
- Web.Stripe.Transfer: COP :: Currency
- Web.Stripe.Transfer: CRC :: Currency
- Web.Stripe.Transfer: CVE :: Currency
- Web.Stripe.Transfer: CZK :: Currency
- Web.Stripe.Transfer: CardTransfer :: TransferType
- Web.Stripe.Transfer: DJF :: Currency
- Web.Stripe.Transfer: DKK :: Currency
- Web.Stripe.Transfer: DOP :: Currency
- Web.Stripe.Transfer: DZD :: Currency
- Web.Stripe.Transfer: DeletedRecipient :: Maybe Bool -> RecipientId -> Recipient
- Web.Stripe.Transfer: EEK :: Currency
- Web.Stripe.Transfer: EGP :: Currency
- Web.Stripe.Transfer: ETB :: Currency
- Web.Stripe.Transfer: EUR :: Currency
- Web.Stripe.Transfer: ExpandedRecipient :: Recipient -> RecipientId
- Web.Stripe.Transfer: FJD :: Currency
- Web.Stripe.Transfer: FKP :: Currency
- Web.Stripe.Transfer: GBP :: Currency
- Web.Stripe.Transfer: GEL :: Currency
- Web.Stripe.Transfer: GIP :: Currency
- Web.Stripe.Transfer: GMD :: Currency
- Web.Stripe.Transfer: GNF :: Currency
- Web.Stripe.Transfer: GTQ :: Currency
- Web.Stripe.Transfer: GYD :: Currency
- Web.Stripe.Transfer: HKD :: Currency
- Web.Stripe.Transfer: HNL :: Currency
- Web.Stripe.Transfer: HRK :: Currency
- Web.Stripe.Transfer: HTG :: Currency
- Web.Stripe.Transfer: HUF :: Currency
- Web.Stripe.Transfer: IDR :: Currency
- Web.Stripe.Transfer: ILS :: Currency
- Web.Stripe.Transfer: INR :: Currency
- Web.Stripe.Transfer: ISK :: Currency
- Web.Stripe.Transfer: JMD :: Currency
- Web.Stripe.Transfer: JPY :: Currency
- Web.Stripe.Transfer: KES :: Currency
- Web.Stripe.Transfer: KGS :: Currency
- Web.Stripe.Transfer: KHR :: Currency
- Web.Stripe.Transfer: KMF :: Currency
- Web.Stripe.Transfer: KRW :: Currency
- Web.Stripe.Transfer: KYD :: Currency
- Web.Stripe.Transfer: KZT :: Currency
- Web.Stripe.Transfer: LAK :: Currency
- Web.Stripe.Transfer: LBP :: Currency
- Web.Stripe.Transfer: LKR :: Currency
- Web.Stripe.Transfer: LRD :: Currency
- Web.Stripe.Transfer: LSL :: Currency
- Web.Stripe.Transfer: LTL :: Currency
- Web.Stripe.Transfer: LVL :: Currency
- Web.Stripe.Transfer: MAD :: Currency
- Web.Stripe.Transfer: MDL :: Currency
- Web.Stripe.Transfer: MGA :: Currency
- Web.Stripe.Transfer: MKD :: Currency
- Web.Stripe.Transfer: MNT :: Currency
- Web.Stripe.Transfer: MOP :: Currency
- Web.Stripe.Transfer: MRO :: Currency
- Web.Stripe.Transfer: MUR :: Currency
- Web.Stripe.Transfer: MVR :: Currency
- Web.Stripe.Transfer: MWK :: Currency
- Web.Stripe.Transfer: MXN :: Currency
- Web.Stripe.Transfer: MYR :: Currency
- Web.Stripe.Transfer: MZN :: Currency
- Web.Stripe.Transfer: NAD :: Currency
- Web.Stripe.Transfer: NGN :: Currency
- Web.Stripe.Transfer: NIO :: Currency
- Web.Stripe.Transfer: NOK :: Currency
- Web.Stripe.Transfer: NPR :: Currency
- Web.Stripe.Transfer: NZD :: Currency
- Web.Stripe.Transfer: PAB :: Currency
- Web.Stripe.Transfer: PEN :: Currency
- Web.Stripe.Transfer: PGK :: Currency
- Web.Stripe.Transfer: PHP :: Currency
- Web.Stripe.Transfer: PKR :: Currency
- Web.Stripe.Transfer: PLN :: Currency
- Web.Stripe.Transfer: PYG :: Currency
- Web.Stripe.Transfer: QAR :: Currency
- Web.Stripe.Transfer: RON :: Currency
- Web.Stripe.Transfer: RSD :: Currency
- Web.Stripe.Transfer: RUB :: Currency
- Web.Stripe.Transfer: RWF :: Currency
- Web.Stripe.Transfer: Recipient :: RecipientId -> Text -> UTCTime -> Bool -> RecipientType -> Maybe Description -> Maybe Email -> Name -> Bool -> Maybe BankAccount -> StripeList RecipientCard -> Maybe RecipientCardId -> Recipient
- Web.Stripe.Transfer: RecipientId :: Text -> RecipientId
- Web.Stripe.Transfer: SAR :: Currency
- Web.Stripe.Transfer: SBD :: Currency
- Web.Stripe.Transfer: SCR :: Currency
- Web.Stripe.Transfer: SEK :: Currency
- Web.Stripe.Transfer: SGD :: Currency
- Web.Stripe.Transfer: SHP :: Currency
- Web.Stripe.Transfer: SLL :: Currency
- Web.Stripe.Transfer: SOS :: Currency
- Web.Stripe.Transfer: SRD :: Currency
- Web.Stripe.Transfer: STD :: Currency
- Web.Stripe.Transfer: SVC :: Currency
- Web.Stripe.Transfer: SZL :: Currency
- Web.Stripe.Transfer: StripeList :: [a] -> Text -> Text -> Maybe Int -> Bool -> StripeList a
- Web.Stripe.Transfer: THB :: Currency
- Web.Stripe.Transfer: TJS :: Currency
- Web.Stripe.Transfer: TOP :: Currency
- Web.Stripe.Transfer: TRY :: Currency
- Web.Stripe.Transfer: TTD :: Currency
- Web.Stripe.Transfer: TWD :: Currency
- Web.Stripe.Transfer: TZS :: Currency
- Web.Stripe.Transfer: Transfer :: TransferId -> Text -> UTCTime -> UTCTime -> Bool -> Int -> Currency -> TransferStatus -> TransferType -> TransactionId -> Maybe Description -> Maybe BankAccount -> Maybe Text -> Maybe Text -> Maybe Description -> Maybe RecipientId -> MetaData -> Transfer
- Web.Stripe.Transfer: TransferCanceled :: TransferStatus
- Web.Stripe.Transfer: TransferFailed :: TransferStatus
- Web.Stripe.Transfer: TransferId :: Text -> TransferId
- Web.Stripe.Transfer: TransferPaid :: TransferStatus
- Web.Stripe.Transfer: TransferPending :: TransferStatus
- Web.Stripe.Transfer: UAH :: Currency
- Web.Stripe.Transfer: UGX :: Currency
- Web.Stripe.Transfer: USD :: Currency
- Web.Stripe.Transfer: UYU :: Currency
- Web.Stripe.Transfer: UZS :: Currency
- Web.Stripe.Transfer: UnknownCurrency :: Currency
- Web.Stripe.Transfer: VND :: Currency
- Web.Stripe.Transfer: VUV :: Currency
- Web.Stripe.Transfer: WST :: Currency
- Web.Stripe.Transfer: XAF :: Currency
- Web.Stripe.Transfer: XCD :: Currency
- Web.Stripe.Transfer: XOF :: Currency
- Web.Stripe.Transfer: XPF :: Currency
- Web.Stripe.Transfer: YER :: Currency
- Web.Stripe.Transfer: ZAR :: Currency
- Web.Stripe.Transfer: ZMW :: Currency
- Web.Stripe.Transfer: cancelTransfer :: TransferId -> Stripe Transfer
- Web.Stripe.Transfer: createTransfer :: RecipientId -> Amount -> Currency -> MetaData -> Stripe Transfer
- Web.Stripe.Transfer: data Currency
- Web.Stripe.Transfer: data Recipient
- Web.Stripe.Transfer: data RecipientId
- Web.Stripe.Transfer: data StripeList a
- Web.Stripe.Transfer: data Transfer
- Web.Stripe.Transfer: data TransferStatus
- Web.Stripe.Transfer: data TransferType
- Web.Stripe.Transfer: deletedRecipient :: Recipient -> Maybe Bool
- Web.Stripe.Transfer: deletedRecipientId :: Recipient -> RecipientId
- Web.Stripe.Transfer: getTransfer :: TransferId -> Stripe Transfer
- Web.Stripe.Transfer: getTransferExpandable :: TransferId -> ExpandParams -> Stripe Transfer
- Web.Stripe.Transfer: getTransfers :: Limit -> StartingAfter TransferId -> EndingBefore TransferId -> Stripe (StripeList Transfer)
- Web.Stripe.Transfer: getTransfersExpandable :: Limit -> StartingAfter TransferId -> EndingBefore TransferId -> ExpandParams -> Stripe (StripeList Transfer)
- Web.Stripe.Transfer: hasMore :: StripeList a -> Bool
- Web.Stripe.Transfer: list :: StripeList a -> [a]
- Web.Stripe.Transfer: newtype TransferId
- Web.Stripe.Transfer: object :: StripeList a -> Text
- Web.Stripe.Transfer: recipientActiveAccount :: Recipient -> Maybe BankAccount
- Web.Stripe.Transfer: recipientCards :: Recipient -> StripeList RecipientCard
- Web.Stripe.Transfer: recipientCreated :: Recipient -> UTCTime
- Web.Stripe.Transfer: recipientDefaultCard :: Recipient -> Maybe RecipientCardId
- Web.Stripe.Transfer: recipientDescription :: Recipient -> Maybe Description
- Web.Stripe.Transfer: recipientEmail :: Recipient -> Maybe Email
- Web.Stripe.Transfer: recipientId :: Recipient -> RecipientId
- Web.Stripe.Transfer: recipientLiveMode :: Recipient -> Bool
- Web.Stripe.Transfer: recipientName :: Recipient -> Name
- Web.Stripe.Transfer: recipientObject :: Recipient -> Text
- Web.Stripe.Transfer: recipientType :: Recipient -> RecipientType
- Web.Stripe.Transfer: recipientVerified :: Recipient -> Bool
- Web.Stripe.Transfer: stripeUrl :: StripeList a -> Text
- Web.Stripe.Transfer: totalCount :: StripeList a -> Maybe Int
- Web.Stripe.Transfer: transferAmount :: Transfer -> Int
- Web.Stripe.Transfer: transferBalanceTransaction :: Transfer -> TransactionId
- Web.Stripe.Transfer: transferBankAccount :: Transfer -> Maybe BankAccount
- Web.Stripe.Transfer: transferCreated :: Transfer -> UTCTime
- Web.Stripe.Transfer: transferCurrency :: Transfer -> Currency
- Web.Stripe.Transfer: transferDate :: Transfer -> UTCTime
- Web.Stripe.Transfer: transferDescription :: Transfer -> Maybe Description
- Web.Stripe.Transfer: transferFailureCode :: Transfer -> Maybe Text
- Web.Stripe.Transfer: transferFailureMessage :: Transfer -> Maybe Text
- Web.Stripe.Transfer: transferId :: Transfer -> TransferId
- Web.Stripe.Transfer: transferLiveMode :: Transfer -> Bool
- Web.Stripe.Transfer: transferMetaData :: Transfer -> MetaData
- Web.Stripe.Transfer: transferObject :: Transfer -> Text
- Web.Stripe.Transfer: transferRecipient :: Transfer -> Maybe RecipientId
- Web.Stripe.Transfer: transferStatementDescription :: Transfer -> Maybe Description
- Web.Stripe.Transfer: transferStatus :: Transfer -> TransferStatus
- Web.Stripe.Transfer: transferType :: Transfer -> TransferType
- Web.Stripe.Transfer: type Amount = Int
- Web.Stripe.Transfer: type Limit = Maybe Int
- Web.Stripe.Transfer: updateTransfer :: TransferId -> Maybe Description -> MetaData -> Stripe Transfer
+ Web.Stripe: showAmount :: Currency -> Int -> String
+ Web.Stripe.Client.Stripe: stripe :: FromJSON (StripeReturn a) => StripeConfig -> StripeRequest a -> IO (Either StripeError (StripeReturn a))
- Web.Stripe: stripe :: FromJSON a => StripeConfig -> Stripe a -> IO (Either StripeError a)
+ Web.Stripe: stripe :: FromJSON (StripeReturn a) => StripeConfig -> StripeRequest a -> IO (Either StripeError (StripeReturn a))
Files
- README.md +0/−98
- Setup.hs +2/−0
- Setup.lhs +0/−4
- src-http-streams/Web/Stripe/Client/Stripe.hs +3/−0
- src/Web/Stripe.hs +12/−5
- src/Web/Stripe/Account.hs +0/−45
- src/Web/Stripe/ApplicationFee.hs +0/−107
- src/Web/Stripe/ApplicationFeeRefund.hs +0/−151
- src/Web/Stripe/Balance.hs +0/−98
- src/Web/Stripe/Bitcoin.hs +0/−90
- src/Web/Stripe/Card.hs +0/−481
- src/Web/Stripe/Charge.hs +0/−323
- src/Web/Stripe/Client.hs +0/−25
- src/Web/Stripe/Client/Error.hs +0/−109
- src/Web/Stripe/Client/Internal.hs +0/−149
- src/Web/Stripe/Client/Types.hs +0/−53
- src/Web/Stripe/Client/Util.hs +0/−107
- src/Web/Stripe/Coupon.hs +0/−157
- src/Web/Stripe/Customer.hs +0/−310
- src/Web/Stripe/Discount.hs +0/−66
- src/Web/Stripe/Dispute.hs +0/−74
- src/Web/Stripe/Event.hs +0/−72
- src/Web/Stripe/Invoice.hs +0/−197
- src/Web/Stripe/InvoiceItem.hs +0/−189
- src/Web/Stripe/Plan.hs +0/−260
- src/Web/Stripe/Recipient.hs +0/−498
- src/Web/Stripe/Refund.hs +0/−157
- src/Web/Stripe/Subscription.hs +0/−184
- src/Web/Stripe/Token.hs +0/−126
- src/Web/Stripe/Transfer.hs +0/−163
- src/Web/Stripe/Types.hs +0/−2205
- src/Web/Stripe/Types/Util.hs +0/−85
- stripe-haskell.cabal +40/−120
- tests/Main.hs +0/−62
- tests/Test/Account.hs +0/−15
- tests/Test/ApplicationFee.hs +0/−17
- tests/Test/ApplicationFeeRefund.hs +0/−24
- tests/Test/Balance.hs +0/−50
- tests/Test/Bitcoin.hs +0/−22
- tests/Test/Card.hs +0/−223
- tests/Test/Charge.hs +0/−82
- tests/Test/Config.hs +0/−27
- tests/Test/Coupon.hs +0/−91
- tests/Test/Customer.hs +0/−76
- tests/Test/Discount.hs +0/−106
- tests/Test/Dispute.hs +0/−99
- tests/Test/Event.hs +0/−18
- tests/Test/Invoice.hs +0/−98
- tests/Test/InvoiceItem.hs +0/−83
- tests/Test/Plan.hs +0/−114
- tests/Test/Raw.hs +0/−37
- tests/Test/Recipient.hs +0/−116
- tests/Test/Refund.hs +0/−96
- tests/Test/Subscription.hs +0/−157
- tests/Test/Token.hs +0/−44
- tests/Test/Transfer.hs +0/−117
- tests/Test/Util.hs +0/−36
− README.md
@@ -1,98 +0,0 @@-stripe -========-------##100% Stripe API coverage for Haskell ([Stripe API](http://stripe.com/docs/api)) - -All Stripe commands are supported, including but not limited to Charges, Refunds, Customers, Cards, Subscriptions, Plans, Coupons, Discounts, Invoices, Invoice Items, Disputes, Transfers, Recipients, Application Fees, Application Fee Refunds, Account, Balance, Events and Tokens.-***-##100% Haddock Coverage- All code written for this library is documented to completion with the haddock documentation tool--##[100+ Hspec Tests](https://github.com/dmjio/stripe-haskell/blob/master/COVERAGE.md)- Thoroughly unit-tested with hspec.- All API commands are unit-tested before inclusion into the API (see the tests directory).- To run the tests, perform the following:-```bash -cabal clean -cabal configure --enable-tests-cabal build tests-dist/build/tests/tests # You will be prompted to enter your *TEST* key-```--##[Pagination](https://stripe.com/docs/api#pagination)- Pagination is possible on all API calls that return a JSON array. - Any API call that returns a `StripeList` is eligible for pagination.- To use in practice do the following:--```haskell -import Web.Stripe-import Web.Stripe.Customer- -main :: IO ()-main = do- let config = StripeConfig "secret key"- result <- stripe config $ getCustomers - (Just 30 :: Maybe Limit) -- Defaults to 10 if Nothing, 100 is Max- (StartingAfter $ CustomerId "customer_id0")- (EndingBefore $ CustomerId "customer_id30")- case result of- Right stripelist -> print (list stripelist :: [Customer])- Left stripeError -> print stripeError-``` --##[Versioning](https://stripe.com/docs/api#versioning)- All versioning is hard-coded (for safety).- Stripe API versions specified in the HTTP headers of Stripe requests take precedence - over the API version specified in your Stripe Dashboard. In an attempt to ensure- API consistency and correct parsing of returned JSON, all Stripe versions are hard-coded, and are- inaccessible to the end-users of this library. When a new Stripe API version is released - this library will increment the hard-coded API version.--##[Expansion](https://stripe.com/docs/api#expansion)- Object expansion is supported on Stripe objects eligible for expansion though the `ExpandParams` type.- Object expansion allows normal Stripe API calls to return expanded objects inside of other objects. - For example, a `Customer` object contains a Card ID hash on the default_card field.- This default_card hash can be expanded into a full `Card` object inside a `Customer` object.- As an example:--```haskell -import Web.Stripe-import Web.Stripe.Customer- -main :: IO ()-main = do- let config = StripeConfig "secret key"- result <- stripe config $ getCustomerExpandable - (CustomerId "customerid")- (["default_card"] :: ExpandParams)- case result of- Right customer -> print (defaultCard customer) -- Will be an `ExpandedCard`- Left stripeError -> print stripeError-```--##[MetaData](https://stripe.com/docs/api#metadata)- Stripe objects allow the embedding of arbitrary metadata.- Any Stripe object that supports the embedding of metadata is available via this API.- As an example:- -```haskell-import Web.Stripe-import Web.Stripe.Coupon- -main :: IO ()-main = do- let config = StripeConfig "secret key"- result <- stripe config $ updateCoupon (CouponId "couponid") [("key1", "value2"), ("key2", "value2")]- case result of- Right coupon -> print $ couponMetaData coupon- Left stripeError -> print stripeError-```--##[Issues](https://github.com/dmjio/stripe-haskell/issues)- Any API recommendations or bugs can be reported on the GitHub issue tracker.- Pull requests welcome!
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
− Setup.lhs
@@ -1,4 +0,0 @@-#! /usr/bin/env runhaskell--> import Distribution.Simple-> main = defaultMain
+ src-http-streams/Web/Stripe/Client/Stripe.hs view
@@ -0,0 +1,3 @@+module Web.Stripe.Client.Stripe (stripe) where++import Web.Stripe.Client.HttpStreams (stripe)
src/Web/Stripe.hs view
@@ -5,23 +5,30 @@ -- Maintainer : djohnson.m@gmail.com -- Stability : experimental -- Portability : POSIX--- +-- -- < https:/\/\stripe.com/docs/api > -- -- @--- import Web.Stripe +-- import Web.Stripe -- import Web.Stripe.Account -- -- main :: IO () -- main = do--- let config = SecretKey "secret_key"+-- let config = StripeConfig "secret_key" -- result <- stripe config getAccountDetails -- case result of -- Right details -> print details -- Left stripeError -> print stripeError -- @ module Web.Stripe (- module Web.Stripe.Client + module Web.Stripe.Client+ , module Web.Stripe.StripeRequest+ , stripe+ , showAmount ) where -import Web.Stripe.Client+import Web.Stripe.Client (StripeConfig(..), StripeKey(..))+import Web.Stripe.StripeRequest+import Web.Stripe.Types (showAmount)+import Web.Stripe.Client.Stripe (stripe)+
− src/Web/Stripe/Account.hs
@@ -1,45 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Account--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#account >------ @--- import Web.Stripe --- import Web.Stripe.Account------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config getAccountDetails--- case result of--- Right account -> print account--- Left stripeError -> print stripeError--- @-module Web.Stripe.Account- ( -- * API- getAccountDetails- -- * Types- , Account (..)- , AccountId (..)- ) where--import Web.Stripe.Client.Internal ( Method (GET)- , Stripe- , StripeRequest (..)- , callAPI )-import Web.Stripe.Types ( Account (..)- , AccountId (..) )----------------------------------------------------------------------------------- | Retrieve the object that represents your Stripe account-getAccountDetails :: Stripe Account-getAccountDetails = callAPI request- where request = StripeRequest GET url params- url = "account"- params = []
− src/Web/Stripe/ApplicationFee.hs
@@ -1,107 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.AppplicationFee--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#application_fees >------ @--- import Web.Stripe --- import Web.Stripe.ApplicationFee------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config $ getApplicationFee (FeeId "fee_4xtEGZhPNDEt3w")--- case result of--- Right applicationFee -> print applicationFee--- Left stripeError -> print stripeError--- @-module Web.Stripe.ApplicationFee- ( -- * API- getApplicationFee- , getApplicationFeeExpanded- , getApplicationFees- , getApplicationFeesExpanded- -- * Types- , ApplicationId (..)- , ApplicationFee (..)- , FeeId (..)- , StripeList (..)- , EndingBefore- , StartingAfter- , Limit- , ExpandParams- , ConnectApp (..)- ) where--import Web.Stripe.Client.Internal (Method (GET), Stripe,- StripeRequest (..), callAPI,- getParams, toText, (</>), toExpandable)-import Web.Stripe.Types (ApplicationFee (..),- ApplicationId (..), ConnectApp (..),- EndingBefore, FeeId (..),- Limit, StartingAfter, ExpandParams,- StripeList (..))----------------------------------------------------------------------------------- | 'ApplicationFee' retrieval-getApplicationFee- :: FeeId -- ^ The `FeeId` associated with the Application- -> Stripe ApplicationFee-getApplicationFee- feeid = getApplicationFeeExpanded feeid []----------------------------------------------------------------------------------- | 'ApplicationFee' retrieval with `ExpandParams`-getApplicationFeeExpanded- :: FeeId -- ^ The `FeeId` associated with the application- -> ExpandParams -- ^ The `ExpandParams` for an `ApplicationFee`- -> Stripe ApplicationFee-getApplicationFeeExpanded- (FeeId feeid)- expandParams = callAPI request- where request = StripeRequest GET url params- url = "application_fees" </> feeid- params = toExpandable expandParams----------------------------------------------------------------------------------- | 'ApplicationFee's retrieval-getApplicationFees- :: Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter FeeId -- ^ Paginate starting after the following `FeeId`- -> EndingBefore FeeId -- ^ Paginate ending before the following `FeeId`- -> Stripe (StripeList ApplicationFee)-getApplicationFees- limit- startingAfter- endingBefore =- getApplicationFeesExpanded- limit startingAfter endingBefore []----------------------------------------------------------------------------------- | 'ApplicationFee's retrieval with `ExpandParams`-getApplicationFeesExpanded- :: Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter FeeId -- ^ Paginate starting after the following `FeeId`- -> EndingBefore FeeId -- ^ Paginate ending before the following `FeeId`- -> ExpandParams -- ^ The `ExpandParams` for `ApplicationFee`s- -> Stripe (StripeList ApplicationFee)-getApplicationFeesExpanded- limit- startingAfter- endingBefore- expandParams = callAPI request- where request = StripeRequest GET url params- url = "application_fees"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(FeeId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(FeeId x) -> x) `fmap` endingBefore)- ] ++ toExpandable expandParams--
− src/Web/Stripe/ApplicationFeeRefund.hs
@@ -1,151 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.AppplicationFeeRefund--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#fee_refunds >------ @--- import Web.Stripe --- import Web.Stripe.ApplicationFeeRefund------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config $ getApplicationFeeRefund (FeeId "fee_id") (RefundId "refund_id")--- case result of--- Right applicationFeeRefund -> print applicationFeeRefund--- Left stripeError -> print stripeError--- @-module Web.Stripe.ApplicationFeeRefund- ( -- * API- createApplicationFeeRefund- , getApplicationFeeRefund- , getApplicationFeeRefundExpandable- , getApplicationFeeRefunds- , getApplicationFeeRefundsExpandable- , updateApplicationFeeRefund- -- * Types- , FeeId (..)- , RefundId (..)- , ApplicationFee (..)- , ApplicationFeeRefund (..)- , StripeList (..)- , EndingBefore- , StartingAfter- , Limit- , ExpandParams- , MetaData- , Amount- ) where--import Web.Stripe.Client.Internal (Method (POST, GET), Stripe,- StripeRequest (..), callAPI,- getParams, toExpandable,- toMetaData, toText, (</>))-import Web.Stripe.Types (Amount, ApplicationFee (..),- ApplicationFeeRefund (..),- EndingBefore, ExpandParams,- FeeId (..), Limit, MetaData,- RefundId (..), StartingAfter,- StripeList (..))----------------------------------------------------------------------------------- | Create a new `ApplicationFeeRefund`-createApplicationFeeRefund- :: FeeId -- ^ The `FeeID` associated with the `ApplicationFee`- -> Maybe Amount -- ^ The `Amount` associated with the `ApplicationFee` (optional)- -> MetaData -- ^ The `MetaData` associated with the `ApplicationFee` (optional)- -> Stripe ApplicationFeeRefund-createApplicationFeeRefund- (FeeId feeid)- amount- metadata = callAPI request- where request = StripeRequest POST url params- url = "application_fees" </> feeid </> "refunds"- params = toMetaData metadata ++ getParams [- ("amount", fmap toText amount)- ]----------------------------------------------------------------------------------- | Retrieve an existing 'ApplicationFeeRefund'-getApplicationFeeRefund- :: FeeId -- ^ The `FeeID` associated with the `ApplicationFee`- -> RefundId -- ^ The `ReufndId` associated with the `ApplicationFeeRefund`- -> Stripe ApplicationFeeRefund-getApplicationFeeRefund feeid refundid =- getApplicationFeeRefundExpandable feeid refundid []----------------------------------------------------------------------------------- | Retrieve an existing 'ApplicationFeeRefund'-getApplicationFeeRefundExpandable- :: FeeId -- ^ The `FeeID` associated with the `ApplicationFee`- -> RefundId -- ^ The `ReufndId` associated with the `ApplicationFeeRefund`- -> ExpandParams -- ^ The `ExpandParams` to be used for object expansion- -> Stripe ApplicationFeeRefund-getApplicationFeeRefundExpandable (FeeId feeid) (RefundId refundid) expansion- = callAPI request- where request = StripeRequest GET url params- url = "application_fees" </> feeid </> "refunds" </> refundid- params = toExpandable expansion----------------------------------------------------------------------------------- | Retrieve a list of all 'ApplicationFeeRefund's for a given Application 'FeeId'-getApplicationFeeRefunds- :: FeeId -- ^ The `FeeID` associated with the application- -> Limit -- ^ `Limit` on how many `Refund`s to return (max 100, default 10)- -> StartingAfter FeeId -- ^ Lower bound on how many `Refund`s to return- -> EndingBefore FeeId -- ^ Upper bound on how many `Refund`s to return- -> Stripe (StripeList ApplicationFeeRefund)-getApplicationFeeRefunds- feeid- limit- startingAfter- endingBefore =- getApplicationFeeRefundsExpandable- feeid limit startingAfter endingBefore []----------------------------------------------------------------------------------- | Retrieve a list of all 'ApplicationFeeRefund's for a given Application 'FeeId'-getApplicationFeeRefundsExpandable- :: FeeId -- ^ The `FeeID` associated with the `ApplicationFee`- -> Limit -- ^ Limit on how many Refunds to return (max 100, default 10)- -> StartingAfter FeeId -- ^ Lower bound on how many Refunds to return- -> EndingBefore FeeId -- ^ Upper bound on how many Refunds to return- -> ExpandParams -- ^ The `ExpandParams` to be used for object expansion- -> Stripe (StripeList ApplicationFeeRefund)-getApplicationFeeRefundsExpandable- (FeeId feeid)- limit- startingAfter- endingBefore- expandParams = callAPI request- where- request = StripeRequest GET url params- url = "application_fees" </> feeid </> "refunds"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(FeeId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(FeeId x) -> x) `fmap` endingBefore)- ] ++ toExpandable expandParams----------------------------------------------------------------------------------- | Update an `ApplicationFeeRefund` for a given Application `FeeId` and `RefundId`-updateApplicationFeeRefund- :: FeeId -- ^ The `FeeID` associated with the application- -> RefundId -- ^ The `RefundId` associated with the application- -> MetaData -- ^ The `MetaData` associated with the Fee (optional)- -> Stripe (StripeList ApplicationFeeRefund)-updateApplicationFeeRefund- (FeeId feeid)- (RefundId refundid)- metadata = callAPI request- where- request = StripeRequest GET url params- url = "application_fees" </> feeid </> "refunds" </> refundid- params = toMetaData metadata-
− src/Web/Stripe/Balance.hs
@@ -1,98 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Balance--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#balance >------ @--- import Web.Stripe --- import Web.Stripe.Balance (getBalance)------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config getBalance--- case result of--- Right balance -> print balance --- Left stripeError -> print stripeError--- @-module Web.Stripe.Balance- ( -- * API- getBalance- , getBalanceTransaction- , getBalanceTransactionExpandable- , getBalanceTransactionHistory- -- * Types- , Balance (..)- , TransactionId (..)- , StripeList (..)- , EndingBefore- , StartingAfter- , Limit- , BalanceTransaction- , BalanceAmount- ) where--import Web.Stripe.Client.Internal (Method (GET), Stripe,- StripeRequest (..), callAPI,- getParams, toExpandable, toText,- (</>))-import Web.Stripe.Types (Balance (..), BalanceAmount,- BalanceTransaction, EndingBefore,- ExpandParams, Limit, StartingAfter,- StripeList (..),- TransactionId (..))-import Web.Stripe.Types.Util (getTransactionId)----------------------------------------------------------------------------------- | Retrieve the current `Balance` for your Stripe account-getBalance :: Stripe Balance-getBalance = callAPI request- where request = StripeRequest GET url params- url = "balance"- params = []----------------------------------------------------------------------------------- | Retrieve a 'BalanceTransaction' by 'TransactionId'-getBalanceTransaction- :: TransactionId -- ^ The `TransactionId` of the `Transaction` to retrieve- -> Stripe BalanceTransaction-getBalanceTransaction- transactionid = getBalanceTransactionExpandable transactionid []----------------------------------------------------------------------------------- | Retrieve a `BalanceTransaction` by `TransactionId` with `ExpandParams`-getBalanceTransactionExpandable- :: TransactionId -- ^ The `TransactionId` of the `Transaction` to retrieve- -> ExpandParams -- ^ The `ExpandParams` of the object to be expanded- -> Stripe BalanceTransaction-getBalanceTransactionExpandable- transactionid expandParams = callAPI request- where request = StripeRequest GET url params- url = "balance" </> "history" </> getTransactionId transactionid- params = toExpandable expandParams----------------------------------------------------------------------------------- | Retrieve the history of `BalanceTransaction`s-getBalanceTransactionHistory- :: Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter TransactionId -- ^ Paginate starting after the following `TransactionId`- -> EndingBefore TransactionId -- ^ Paginate ending before the following `TransactionId`- -> Stripe (StripeList BalanceTransaction)-getBalanceTransactionHistory- limit- startingAfter- endingBefore = callAPI request- where request = StripeRequest GET url params- url = "balance" </> "history"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(TransactionId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(TransactionId x) -> x) `fmap` endingBefore)- ]-
− src/Web/Stripe/Bitcoin.hs
@@ -1,90 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Bitcoin--- Copyright : (c) David Johnson, 2015--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https://stripe.com/docs/api#bitcoin_receivers >--- < https://stripe.com/docs/guides/bitcoin >------ @--- import Web.Stripe --- import Web.Stripe.Bitcoin------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config listAllReceivers--- case result of--- Right receivers -> print receivers--- Left stripeError -> print stripeError--- @-module Web.Stripe.Bitcoin- ( -- * API- createReceiver- , getReceiver- , listReceivers- -- * Types- , BitcoinReceiver (..)- , BitcoinReceiverId (..)- , BitcoinTransaction (..)- , BitcoinTransactionId (..)- , Email (..)- , StripeList (..)- ) where--import Web.Stripe.Client.Internal ( Method (GET, POST)- , Stripe- , StripeRequest (..)- , (</>)- , callAPI- , getParams- , toText )-import Web.Stripe.Types----------------------------------------------------------------------------------- | Retrieve the object that represents your Stripe account-createReceiver- :: Integer -- ^ Amount- -> Email -- ^ Email- -> Stripe BitcoinReceiver-createReceiver amount (Email email) = callAPI request- where request = StripeRequest POST url params- url = "bitcoin/receivers"- params = getParams [ ("currency", Just "usd")- , ("amount", Just $ toText amount )- , ("email", Just email )- ]----------------------------------------------------------------------------------- | Retrieve a `BitcoinReceiver`-getReceiver- :: BitcoinReceiverId- -> Stripe BitcoinReceiver-getReceiver (BitcoinReceiverId receiverId) = callAPI request- where request = StripeRequest GET url params- url = "bitcoin/receivers" </> receiverId- params = []----------------------------------------------------------------------------------- | Retrieve a list of `BitcoinReceiver`s-listReceivers- :: Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter BitcoinReceiverId -- ^ Paginate starting after the following `BitcoinReceiverId`- -> EndingBefore BitcoinReceiverId -- ^ Paginate ending before the following `BitcoinReceiverId`- -> Stripe (StripeList BitcoinReceiver)-listReceivers- limit- startingAfter- endingBefore = callAPI request- where- request = StripeRequest GET url params- url = "bitcoin/receivers"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(BitcoinReceiverId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(BitcoinReceiverId x) -> x) `fmap` endingBefore)- ]
− src/Web/Stripe/Card.hs
@@ -1,481 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Card--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#cards >------ @--- import Web.Stripe --- import Web.Stripe.Customer --- import Web.Stripe.Card------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- credit = CardNumber "4242424242424242"--- em = ExpMonth 12--- ey = ExpYear 2015--- cvc = CVC "123"--- result <- stripe config $ do--- Customer { customerId = cid } <- createEmptyCustomer--- card <- createCustomerCard cid credit em ey cvc--- return card--- case result of--- Right card -> print card--- Left stripeError -> print stripeError--- @-module Web.Stripe.Card- ( -- * API- -- ** Customers- -- *** Create Customer Card- createCustomerCard- , createCustomerCardByToken- -- *** Get Customer Card(s)- , getCustomerCard- , getCustomerCardExpandable- , getCustomerCards- , getCustomerCardsExpandable- -- *** Update Customer Card- , updateCustomerCard- -- *** Delete Card- , deleteCustomerCard- -- ** Recipients- -- *** Create Recipient Card- , createRecipientCard- , createRecipientCardByToken- -- *** Get Recipient Card(s)- , getRecipientCard- , getRecipientCardExpandable- , getRecipientCards- , getRecipientCardsExpandable- -- *** Updated Recipient Card- , updateRecipientCard- -- *** Delete Recipient Card- , deleteRecipientCard- -- * Types- , Brand (..)- , Card (..)- , RecipientCard (..)- , CardId (..)- , RecipientCardId (..)- , CardNumber (..)- , ExpMonth (..)- , ExpYear (..)- , CVC (..)- , Name- , AddressLine1 (..)- , AddressLine2 (..)- , AddressCity (..)- , AddressCountry (..)- , AddressState (..)- , AddressZip (..)- , RecipientId (..)- ) where--import Control.Applicative ((<$>))-import Data.Aeson (FromJSON)-import Web.Stripe.Client.Internal-import Web.Stripe.Types-import Web.Stripe.Types.Util ----------------------------------------------------------------------------------- | Base request function for `Card` creation, good for making custom create `Card` functions-createCardBase- :: FromJSON a- => URL -- ^ The `Recipient` or `Customer` on which to make the `Card` value can be "recipients" or "customers" only- -> ID -- ^ The `RecipientId` or `CustomerId` for which the `Card` can be made- -> Maybe TokenId -- ^ The `TokenId` to be used for `Card` creation- -> Maybe CardNumber -- ^ `CardNumber` for `Card` creation- -> Maybe ExpMonth -- ^ Expiration Month for `Card` creation- -> Maybe ExpYear -- ^ Expiration Year for `Card` creation- -> Maybe CVC -- ^ CVC for `Card` creation- -> Maybe Name -- ^ Name of `Recipient` or `Customer` to be used for `Card`- -> Maybe AddressCity -- ^ City associated with `Card`- -> Maybe AddressCountry -- ^ Country associated with `Card`- -> Maybe AddressLine1 -- ^ Address Line 1 associated with `Card`- -> Maybe AddressLine2 -- ^ Address Line 2 associated with `Card`- -> Maybe AddressState -- ^ Address State 2 associated with `Card`- -> Maybe AddressZip -- ^ Address Zip associated with `Card`- -> Stripe a-createCardBase- requestType- requestId- tokenid- cardNumber- expMonth- expYear- cvc- name- addressCity- addressCountry- addressLine1- addressLine2- addressState- addressZip = callAPI request- where request = StripeRequest POST url params- url = requestType </> requestId </> "cards"- params = getParams [- ("card", (\(TokenId x) -> x) <$> tokenid)- , ("card[number]", (\(CardNumber x) -> x) <$> cardNumber)- , ("card[exp_month]", (\(ExpMonth x) -> toText x) <$> expMonth)- , ("card[exp_year]", (\(ExpYear x) -> toText x) <$> expYear)- , ("card[cvc]", (\(CVC x) -> x) <$> cvc)- , ("name", name)- , ("address_city", (\(AddressCity x) -> x) <$> addressCity)- , ("address_country", (\(AddressCountry x) -> x) <$> addressCountry)- , ("address_line1", (\(AddressLine1 x) -> x) <$> addressLine1 )- , ("address_line2", (\(AddressLine2 x) -> x) <$> addressLine2 )- , ("address_state", (\(AddressState x) -> x) <$> addressState )- , ("address_zip", (\(AddressZip x) -> x) <$> addressZip )- ]----------------------------------------------------------------------------------- | Create a `Customer` card using a `Token`-createCustomerCardByToken- :: CustomerId -- ^ The Customer to which the card will be added- -> TokenId -- ^ The Token representative of the card- -> Stripe Card-createCustomerCardByToken- customerid- tokenid = createCardBase "customers" (getCustomerId customerid) (Just tokenid)- Nothing Nothing Nothing- Nothing Nothing Nothing- Nothing Nothing Nothing- Nothing Nothing ----------------------------------------------------------------------------------- | Create a `Recipient` card using a `Token`-createRecipientCardByToken- :: RecipientId -- ^ The Customer to which the card will be added- -> TokenId -- ^ The Token representative of the card- -> Stripe RecipientCard-createRecipientCardByToken- recipientid- tokenid = createCardBase "recipients" (getRecipientId recipientid) (Just tokenid)- Nothing Nothing Nothing- Nothing Nothing Nothing- Nothing Nothing Nothing- Nothing Nothing ----------------------------------------------------------------------------------- | Add a `Card` on a `Customer`-createCustomerCard- :: CustomerId -- ^ `Customer` to which the card will be added- -> CardNumber -- ^ `Card` digits- -> ExpMonth -- ^ `Card` expiration month- -> ExpYear -- ^ `Card` expiration year- -> CVC -- ^ `Card` cvc number- -> Stripe Card-createCustomerCard- customerid- cardNumber- expMonth- expYear- cvc = createCardBase "customers" (getCustomerId customerid) Nothing- (Just cardNumber) (Just expMonth) (Just expYear)- (Just cvc) Nothing Nothing- Nothing Nothing Nothing- Nothing Nothing ----------------------------------------------------------------------------------- | Create a `Recipient` `Card` by `CardNumber`-createRecipientCard- :: RecipientId -- ^ `Recipient` to which the card will be added- -> CardNumber -- ^ `Card` digits- -> ExpMonth -- ^ `Card` expiration month- -> ExpYear -- ^ `Card` expiration year- -> CVC -- ^ `Card` cvc number- -> Stripe RecipientCard-createRecipientCard- recipientid- cardNumber- expMonth- expYear- cvc = createCardBase "recipients" (getRecipientId recipientid) Nothing- (Just cardNumber) (Just expMonth) (Just expYear)- (Just cvc) Nothing Nothing- Nothing Nothing Nothing- Nothing Nothing ----------------------------------------------------------------------------------- | Update a `Card`, any fields not specified will remain the same-updateCardBase- :: FromJSON a- => URL -- ^ The `Recipient` or `Customer` on which to make the `Card` value can be "recipients" or "customers" only- -> ID -- ^ The `RecipientId` or `CustomerId` for which the `Card` can be made- -> Either CardId RecipientCardId -- ^ The `CardId` associated with the `Card` to be updated- -> Maybe Name -- ^ Name of `Recipient` or `Customer` to be used for `Card`- -> Maybe AddressCity -- ^ City associated with `Card`- -> Maybe AddressCountry -- ^ Country associated with `Card`- -> Maybe AddressLine1 -- ^ Address Line 1 associated with `Card`- -> Maybe AddressLine2 -- ^ Address Line 2 associated with `Card`- -> Maybe AddressState -- ^ Address State 2 associated with `Card`- -> Maybe AddressZip -- ^ Address Zip associated with `Card`- -> Stripe a-updateCardBase- requestType- requestId- cardid- name- addressCity- addressCountry- addressLine1- addressLine2- addressState- addressZip = callAPI request- where request = StripeRequest POST url params- url = requestType </> requestId </> "cards" </> case cardid of- Right x -> getRecipientCardId x- Left x -> getCardId x- params = getParams [- ("name", name)- , ("address_city", (\(AddressCity x) -> x) <$> addressCity)- , ("address_country", (\(AddressCountry x) -> x) <$> addressCountry)- , ("address_line1", (\(AddressLine1 x) -> x) <$> addressLine1 )- , ("address_line2", (\(AddressLine2 x) -> x) <$> addressLine2 )- , ("address_state", (\(AddressState x) -> x) <$> addressState )- , ("address_zip", (\(AddressZip x) -> x) <$> addressZip )- ]----------------------------------------------------------------------------------- | Update a `Customer` `Card`-updateCustomerCard- :: CustomerId -- ^ `CustomerId` associated with the `Card` to be updated- -> CardId -- ^ The `CardId` associated with the `Card` to be updated- -> Maybe Name -- ^ Name of `Recipient` or `Customer` to be used for `Card`- -> Maybe AddressCity -- ^ City associated with `Card`- -> Maybe AddressCountry -- ^ Country associated with `Card`- -> Maybe AddressLine1 -- ^ Address Line 1 associated with `Card`- -> Maybe AddressLine2 -- ^ Address Line 2 associated with `Card`- -> Maybe AddressState -- ^ Address State 2 associated with `Card`- -> Maybe AddressZip -- ^ Address Zip associated with `Card`- -> Stripe Card-updateCustomerCard- customerid- cardid = updateCardBase "customers" (getCustomerId customerid) (Left cardid)----------------------------------------------------------------------------------- | Update a `Recipient` `Card`-updateRecipientCard- :: RecipientId -- ^ `RecipientId` associated with the `Card` to be updated- -> RecipientCardId -- ^ The `CardId` associated with the `Card` to be updated- -> Maybe Name -- ^ Name of `Recipient` or `Customer` to be used for `Card`- -> Maybe AddressCity -- ^ City associated with `Card`- -> Maybe AddressCountry -- ^ Country associated with `Card`- -> Maybe AddressLine1 -- ^ Address Line 1 associated with `Card`- -> Maybe AddressLine2 -- ^ Address Line 2 associated with `Card`- -> Maybe AddressState -- ^ Address State 2 associated with `Card`- -> Maybe AddressZip -- ^ Address Zip associated with `Card`- -> Stripe RecipientCard-updateRecipientCard- recipientid- cardid = updateCardBase "recipients" (getRecipientId recipientid) (Right cardid)----------------------------------------------------------------------------------- | Base Request for retrieving cards from either a `Customer` or `Recipient`-getCardBase- :: FromJSON a- => URL -- ^ The type of the request to support (recipient or customer)- -> ID -- ^ `CustomerId` or `RecipientId` of the `Card` to retrieve- -> ID -- ^ `CardId` or `RecipientCardId` of the `Card` or `RecipientCard` to retrieve- -> ExpandParams -- ^ `ExpandParams` of the `Card`- -> Stripe a-getCardBase- requestType- requestId- cardid- expandParams = callAPI request- where request = StripeRequest GET url params- url = requestType </> requestId </> "cards" </> cardid- params = toExpandable expandParams----------------------------------------------------------------------------------- | Get card by `CustomerId` and `CardId`-getCustomerCard- :: CustomerId -- ^ `CustomerId` of the `Card` to retrieve- -> CardId -- ^ `CardId` of the card to retrieve- -> Stripe Card-getCustomerCard- customerid cardid = getCustomerCardExpandable customerid cardid []----------------------------------------------------------------------------------- | Get card by `CustomerId` and `CardId` with `ExpandParams`-getCustomerCardExpandable- :: CustomerId -- ^ `CustomerId` of the `Card` to retrieve- -> CardId -- ^ `CardId` of the card to retrieve- -> ExpandParams -- ^ `ExpandParams` of the card to retrieve- -> Stripe Card-getCustomerCardExpandable- customerid cardid expandParams =- getCardBase "customers" (getCustomerId customerid) (getCardId cardid) expandParams----------------------------------------------------------------------------------- | Get card by `RecipientId` and `CardId`-getRecipientCard- :: RecipientId -- ^ `RecipientId` of the `Card` to retrieve- -> RecipientCardId -- ^ `CardId` of the `Recipient` `Card` to retrieve- -> Stripe RecipientCard-getRecipientCard- recipientid- cardid = getRecipientCardExpandable recipientid cardid []----------------------------------------------------------------------------------- | Get card by `RecipientId` and `CardId`-getRecipientCardExpandable- :: RecipientId -- ^ `RecipientId` of the `Card` to retrieve- -> RecipientCardId -- ^ `CardId` of the `Recipient` `Card` to retrieve- -> ExpandParams -- ^ `ExpandParams` of the `Recipient` `Card` to retrieve- -> Stripe RecipientCard-getRecipientCardExpandable- recipientid- cardid- expandParams- = getCardBase "recipients" (getRecipientId recipientid)- (getRecipientCardId cardid) expandParams----------------------------------------------------------------------------------- | Base Request for retrieving `Customer` cards-getCustomerCardsBase- :: CustomerId -- ^ `CustomerId` of the `Card` to retrieve- -> Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter CardId -- ^ Paginate starting after the following `CardId`- -> EndingBefore CardId -- ^ Paginate ending before the following `CardId`- -> ExpandParams -- ^ Expansion on `Card`- -> Stripe (StripeList Card)-getCustomerCardsBase- customerid- limit- startingAfter- endingBefore- expandParams = callAPI request- where request = StripeRequest GET url params- url = "customers" </> getCustomerId customerid </> "cards"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(CardId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(CardId x) -> x) `fmap` endingBefore)- ] ++ toExpandable expandParams ----------------------------------------------------------------------------------- | Base Request for retrieving `Customer` or `Recipient` cards-getRecipientCardsBase- :: RecipientId -- ^ `RecipientId` of the `Card` to retrieve- -> Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter RecipientCardId -- ^ Paginate starting after the following `CardId`- -> EndingBefore RecipientCardId -- ^ Paginate ending before the following `CardId`- -> ExpandParams -- ^ Expansion on `Card`- -> Stripe (StripeList RecipientCard)-getRecipientCardsBase- recipientid- limit- startingAfter- endingBefore- expandParams = callAPI request- where request = StripeRequest GET url params- url = "recipients" </> getRecipientId recipientid </> "cards"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(RecipientCardId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(RecipientCardId x) -> x) `fmap` endingBefore)- ] ++ toExpandable expandParams ------------------------------------------------------------------------------------ | Retrieve all cards associated with a `Customer`-getCustomerCards- :: CustomerId -- ^ The `CustomerId` associated with the cards- -> Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter CardId -- ^ Paginate starting after the following `CardId`- -> EndingBefore CardId -- ^ Paginate ending before the following `CardId`- -> Stripe (StripeList Card)-getCustomerCards- customerid- limit- startingAfter- endingBefore- = getCustomerCardsExpandable customerid limit startingAfter endingBefore []----------------------------------------------------------------------------------- | Retrieve all cards associated with a `Customer`-getCustomerCardsExpandable- :: CustomerId -- ^ The `CustomerId` associated with the cards- -> Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter CardId -- ^ Paginate starting after the following `CardId`- -> EndingBefore CardId -- ^ Paginate ending before the following `CardId`- -> ExpandParams -- ^ Expansion on `Card`- -> Stripe (StripeList Card)-getCustomerCardsExpandable- customerid- limit- startingAfter- endingBefore- expandParams =- getCustomerCardsBase customerid- limit startingAfter endingBefore expandParams----------------------------------------------------------------------------------- | Retrieve all cards associated with a `Recipient`-getRecipientCards- :: RecipientId -- ^ The `RecipientId` associated with the cards- -> Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter RecipientCardId -- ^ Paginate starting after the following `CardId`- -> EndingBefore RecipientCardId -- ^ Paginate ending before the following `CardId`- -> Stripe (StripeList RecipientCard)-getRecipientCards- recipientid- limit- startingAfter- endingBefore =- getRecipientCardsExpandable recipientid limit- startingAfter endingBefore []----------------------------------------------------------------------------------- | Retrieve all cards associated with a `Recipient`-getRecipientCardsExpandable- :: RecipientId -- ^ The `RecipientId` associated with the cards- -> Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter RecipientCardId -- ^ Paginate starting after the following `CardId`- -> EndingBefore RecipientCardId -- ^ Paginate ending before the following `CardId`- -> ExpandParams -- ^ The `ExpandParams` of the object to be expanded- -> Stripe (StripeList RecipientCard)-getRecipientCardsExpandable- recipientid- limit- startingAfter- endingBefore- expandParams =- getRecipientCardsBase recipientid- limit startingAfter endingBefore expandParams----------------------------------------------------------------------------------- | Removes a card from a `Customer`-deleteCustomerCard- :: CustomerId -- ^ `CustomerId` of the `Card` to retrieve- -> CardId -- ^ `CardId` associated with `Card` to be deleted- -> Stripe StripeDeleteResult-deleteCustomerCard- customerid- cardid = callAPI request- where request = StripeRequest DELETE url params- url = "customers" </> getCustomerId customerid </> "cards" </> getCardId cardid- params = []----------------------------------------------------------------------------------- | Removes a card from a `Customer`-deleteRecipientCard- :: RecipientId -- ^ The `RecipientId` associated with the `Card` to be removed- -> RecipientCardId -- ^ The `CardId` of the `Card` to be removed- -> Stripe StripeDeleteResult-deleteRecipientCard- recipientid - cardid = callAPI request- where request = StripeRequest DELETE url params- url = "recipients" </> getRecipientId recipientid- </> "cards"- </> getRecipientCardId cardid- params = []
− src/Web/Stripe/Charge.hs
@@ -1,323 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Charge--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#charges >------ @--- import Web.Stripe --- import Web.Stripe.Customer --- import Web.Stripe.Charge------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- credit = CardNumber "4242424242424242"--- em = ExpMonth 12--- ey = ExpYear 2015--- cvc = CVC "123"--- result <- stripe config $ do--- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc--- charge <- chargeCustomer cid USD 100 Nothing--- return charge--- case result of--- Right charge -> print charge--- Left stripeError -> print stripeError--- @-module Web.Stripe.Charge- ( -- * API- ---- * Create Charges- chargeCustomer- , chargeCardByToken- , chargeCustomerByCardId- , chargeCard- , chargeBase- ---- * Get Charge(s)- , getCharge- , getChargeExpandable- , getCharges- , getChargesExpandable- , getCustomerCharges- , getCustomerChargesExpandable- ---- * Update Charge- , updateCharge- ---- * Capture Charge- , captureCharge- -- * Types- , Charge (..)- , TokenId (..)- , ChargeId (..)- , CustomerId (..)- , Customer (..)- , Currency (..)- , CardNumber (..)- , CVC (..)- , ExpMonth (..)- , ExpYear (..)- , StripeList (..)- , Email (..)- , Description- , StatementDescription- , Amount- , Capture- ) where--import Web.Stripe.Client.Internal (Method (GET, POST), Stripe,- StripeRequest (..), callAPI,- getParams, toMetaData, toText, toExpandable,- toTextLower, (</>))-import Web.Stripe.Types (Amount, CVC (..), Capture, - CardNumber (..), Charge (..),- ChargeId (..), Currency (..),- CustomerId (..), Description,- EndingBefore, ExpMonth (..),- ExpYear (..), Limit, MetaData,- Email (..), StartingAfter, Customer(..),- StatementDescription(..), ExpandParams,- StripeList (..), TokenId (..), CardId(..))-import Web.Stripe.Types.Util (getCardId, getChargeId, getCustomerId)----------------------------------------------------------------------------------- | Charge `Customer``s by `CustomerId`, will charge the default `Card` if exists-chargeCustomer- :: CustomerId -- ^ The `CustomerId` of the `Customer` to be charged- -> Currency -- ^ Required, 3-letter ISO Code- -> Amount -- ^ Required, Integer value of 100 represents $1- -> Maybe Description -- ^ Optional, default is null- -> Stripe Charge-chargeCustomer customerid currency amount description =- chargeBase amount currency description (Just customerid)- Nothing Nothing Nothing True- Nothing Nothing Nothing Nothing []----------------------------------------------------------------------------------- | Charge `Customer`s by `CustomerId`-chargeCustomerByCardId- :: CustomerId -- ^ The `CustomerId` of the `Customer` to be charged- -> CardId -- ^ `CardId` of `Customer` to charge- -> Currency -- ^ Required, 3-letter ISO Code- -> Amount -- ^ Required, Integer value of 100 represents $1- -> Maybe Description -- ^ Optional, default is null- -> Stripe Charge-chargeCustomerByCardId- customerid- cardid- currency- amount- description =- chargeBase amount currency description- (Just customerid) (Just $ TokenId $ getCardId cardid) Nothing- Nothing True Nothing Nothing- Nothing Nothing []----------------------------------------------------------------------------------- | Charge a card by a `TokenId`-chargeCardByToken- :: TokenId -- ^ The `TokenId` representative of a `Card`- -> Currency -- ^ Required, 3-letter ISO Code- -> Amount -- ^ Required, Integer value of 100 represents $1- -> Maybe Description -- ^ Optional, default is null- -> Stripe Charge-chargeCardByToken tokenId currency amount description =- chargeBase amount currency description Nothing (Just tokenId)- Nothing Nothing True Nothing Nothing Nothing Nothing []----------------------------------------------------------------------------------- | Charge a card by `CardNumber`-chargeCard- :: CardNumber -- ^ Required, Credit Card Number- -> ExpMonth -- ^ Required, Expiration Month (i.e. 09)- -> ExpYear -- ^ Required, Expiration Year (i.e. 2018)- -> CVC -- ^ Required, CVC Number (i.e. 000)- -> Currency -- ^ Required, 3-letter ISO Code- -> Amount -- ^ Required, Integer value of 100 represents $1- -> Maybe Description -- ^ Optional, default is null- -> Stripe Charge-chargeCard cardNumber expMonth expYear cvc currency amount description =- chargeBase amount currency description- Nothing Nothing Nothing Nothing True- (Just cardNumber) (Just expMonth)- (Just expYear) (Just cvc) []----------------------------------------------------------------------------------- | Base method for creating a `Charge`-chargeBase- :: Amount -- ^ Required, Integer value of 100 represents $1- -> Currency -- ^ Required, 3-letter ISO Code- -> Maybe Description -- ^ Optional, default is null- -> Maybe CustomerId -- ^ Optional, either `CustomerId` or `TokenId` has to be specified- -> Maybe TokenId -- ^ Optional, either `CustomerId` or `TokenId` has to be specified- -> Maybe StatementDescription -- ^ Optional, Arbitrary string to include on CC statements- -> Maybe Email -- ^ Optional, Arbitrary string to include on CC statements- -> Capture -- ^ Optional, default is True- -> Maybe CardNumber -- ^ Optional, Credit Card Number- -> Maybe ExpMonth -- ^ `Card` Expiration Month- -> Maybe ExpYear -- ^ `Card` Expiration Year- -> Maybe CVC -- ^ `Card` `CVC`- -> MetaData -- ^ `Card` `MetaData`- -> Stripe Charge-chargeBase- amount- currency- description- customerid- tokenId- statementDescription- receiptEmail- capture- cardNumber- expMonth- expYear- cvc'- metadata = callAPI request- where request = StripeRequest POST url params- url = "charges"- params = toMetaData metadata ++ getParams [- ("amount", toText `fmap` Just amount)- , ("customer", (\(CustomerId cid) -> cid) `fmap` customerid)- , ("currency", toTextLower `fmap` Just currency)- , ("card", (\(TokenId tokenid) -> tokenid) `fmap` tokenId)- , ("description", description)- , ("statement_description", (\(StatementDescription x) -> x) `fmap` statementDescription)- , ("receipt_email", (\(Email email) -> email) `fmap` receiptEmail)- , ("capture", (\x -> if x then "true" else "false") `fmap` Just capture)- , ("card[number]", (\(CardNumber c) -> c) `fmap` cardNumber)- , ("card[exp_month]", (\(ExpMonth m) -> toText m) `fmap` expMonth)- , ("card[exp_year]", (\(ExpYear y) -> toText y) `fmap` expYear)- , ("card[cvc]", (\(CVC c) -> c) `fmap` cvc')- ]----------------------------------------------------------------------------------- | Retrieve a `Charge` by `ChargeId`-getCharge- :: ChargeId -- ^ The `Charge` to retrive- -> Stripe Charge-getCharge chargeid = getChargeExpandable chargeid []----------------------------------------------------------------------------------- | Retrieve a `Charge` by `ChargeId` with `ExpandParams`-getChargeExpandable- :: ChargeId -- ^ The `Charge` retrive- -> ExpandParams -- ^ The `ExpandParams` to retrive- -> Stripe Charge-getChargeExpandable- chargeid- expandParams = callAPI request- where request = StripeRequest GET url params- url = "charges" </> getChargeId chargeid- params = toExpandable expandParams----------------------------------------------------------------------------------- | Retrieve all `Charge`s-getCharges- :: Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter ChargeId -- ^ Paginate starting after the following CustomerID- -> EndingBefore ChargeId -- ^ Paginate ending before the following CustomerID- -> Stripe (StripeList Charge)-getCharges- limit- startingAfter- endingBefore =- getChargesExpandable limit startingAfter endingBefore []----------------------------------------------------------------------------------- | Retrieve all `Charge`s-getChargesExpandable- :: Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter ChargeId -- ^ Paginate starting after the following `CustomerId`- -> EndingBefore ChargeId -- ^ Paginate ending before the following `CustomerId`- -> ExpandParams -- ^ Get Charges with `ExpandParams`- -> Stripe (StripeList Charge)-getChargesExpandable- limit- startingAfter- endingBefore- expandParams = callAPI request- where request = StripeRequest GET url params- url = "charges"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(ChargeId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(ChargeId x) -> x) `fmap` endingBefore)- ] ++ toExpandable expandParams------------------------------------------------------------------------------------ | Retrieve all `Charge`s for a specified `Customer`-getCustomerCharges- :: CustomerId- -> Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter ChargeId -- ^ Paginate starting after the following `CustomerId`- -> EndingBefore ChargeId -- ^ Paginate ending before the following `CustomerId`- -> Stripe (StripeList Charge)-getCustomerCharges- customerid- limit- startingAfter- endingBefore =- getCustomerChargesExpandable customerid limit- startingAfter endingBefore []----------------------------------------------------------------------------------- | Retrieve all `Charge`s for a specified `Customer` with `ExpandParams`-getCustomerChargesExpandable- :: CustomerId- -> Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter ChargeId -- ^ Paginate starting after the following `CustomerId`- -> EndingBefore ChargeId -- ^ Paginate ending before the following `CustomerId`- -> ExpandParams -- ^ Get `Customer` `Charge`s with `ExpandParams`- -> Stripe (StripeList Charge)-getCustomerChargesExpandable- customerid- limit- startingAfter- endingBefore- expandParams = callAPI request- where request = StripeRequest GET url params- url = "charges"- params = getParams [- ("customer", Just $ getCustomerId customerid )- , ("limit", toText `fmap` limit )- , ("starting_after", (\(ChargeId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(ChargeId x) -> x) `fmap` endingBefore)- ] ++ toExpandable expandParams----------------------------------------------------------------------------------- | A `Charge` to be updated-updateCharge- :: ChargeId -- ^ The `Charge` to update- -> Description -- ^ The `Charge` `Description` to update- -> MetaData -- ^ The `Charge` `MetaData` to update- -> Stripe Charge-updateCharge- chargeid- description- metadata = callAPI request- where request = StripeRequest POST url params- url = "charges" </> getChargeId chargeid- params = toMetaData metadata ++ getParams [- ("description", Just description)- ]----------------------------------------------------------------------------------- | a `Charge` to be captured-captureCharge- :: ChargeId -- ^ The `ChargeId` of the `Charge` to capture- -> Maybe Amount -- ^ If Nothing the entire charge will be captured, otherwise the remaining will be refunded- -> Maybe Email -- ^ `Email` to send `Charge` receipt- -> Stripe Charge-captureCharge- chargeid- amount- receiptEmail = callAPI request- where request = StripeRequest POST url params- url = "charges" </> getChargeId chargeid </> "capture"- params = getParams [- ("amount", toText `fmap` amount)- , ("receipt_email", (\(Email email) -> email) `fmap` receiptEmail)- ]
− src/Web/Stripe/Client.hs
@@ -1,25 +0,0 @@--- |--- Module : Web.Stripe.Client--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX-module Web.Stripe.Client- ( -- * Execute a `Stripe` action- stripe- -- * Execute a custom `Stripe` action (build your own, useful if- -- using old API's)- , stripeRaw- -- * `Stripe` Monad- , Stripe- -- * `Stripe` Secret Key - , StripeConfig (..)- -- * `Stripe` Request creator- , StripeRequest (..)- , module Web.Stripe.Client.Error- ) where--import Web.Stripe.Client.Internal-import Web.Stripe.Client.Error--
− src/Web/Stripe/Client/Error.hs
@@ -1,109 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}--- |--- Module : Web.Stripe.Client.Error--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX-module Web.Stripe.Client.Error - ( -- * Types- StripeErrorHTTPCode (..)- , StripeErrorType (..)- , StripeErrorCode (..)- , StripeError (..)- ) where--import Control.Applicative ((<$>))-import Data.Aeson -import Data.Text (Text)-import Control.Monad (mzero)----------------------------------------------------------------------------------- | Error Codes for HTTP Responses-data StripeErrorHTTPCode = - BadRequest -- ^ 400- | UnAuthorized -- ^ 401- | RequestFailed -- ^ 402- | NotFound -- ^ 404- | StripeServerError -- ^ (>=500)- | UnknownHTTPCode -- ^ All other codes- deriving Show----------------------------------------------------------------------------------- | Stripe Error Types-data StripeErrorType =- InvalidRequest- | APIError- | CardError- | ConnectionFailure- | ParseFailure- | UnknownErrorType - deriving Show----------------------------------------------------------------------------------- | Stripe Error Codes-data StripeErrorCode =- IncorrectNumber- | InvalidNumber- | InvalidExpiryMonth- | InvalidExpiryYear- | InvalidCVC- | ExpiredCard- | IncorrectCVC- | IncorrectZIP- | CardDeclined- | Missing- | ProcessingError- | RateLimit- | UnknownError - deriving Show----------------------------------------------------------------------------------- | Stripe Error-data StripeError = StripeError {- errorType :: StripeErrorType- , errorMsg :: Text- , errorCode :: Maybe StripeErrorCode- , errorParam :: Maybe Text- , errorHTTP :: Maybe StripeErrorHTTPCode- } deriving Show----------------------------------------------------------------------------------- | Parses an error message into a `StripeErrorType`-toErrorType- :: Text- -> StripeErrorType-toErrorType "invalid_request_error" = InvalidRequest-toErrorType "api_error" = APIError-toErrorType "card_error" = CardError-toErrorType _ = UnknownErrorType----------------------------------------------------------------------------------- | Parses an error message into a `StripeErrorCode`-toErrorCode- :: Text- -> StripeErrorCode-toErrorCode "incorrect_number" = IncorrectNumber-toErrorCode "invalid_number" = InvalidNumber-toErrorCode "invalid_expiry_month" = InvalidExpiryMonth-toErrorCode "invalid_expiry_year" = InvalidExpiryYear-toErrorCode "invalid_cvc" = InvalidCVC-toErrorCode "expired_card" = ExpiredCard-toErrorCode "incorrect_cvc" = IncorrectCVC-toErrorCode "incorrect_zip" = IncorrectZIP-toErrorCode "card_declined" = CardDeclined-toErrorCode "missing" = Missing-toErrorCode "processing_error" = ProcessingError-toErrorCode "rate_limit" = RateLimit-toErrorCode _ = UnknownError--instance FromJSON StripeError where- parseJSON (Object o) = do- e <- o .: "error"- typ <- toErrorType <$> e .: "type"- msg <- e .: "message"- code <- fmap toErrorCode <$> e .:? "code"- param <- e .:? "param"- return $ StripeError typ msg code param Nothing- parseJSON _ = mzero-
− src/Web/Stripe/Client/Internal.hs
@@ -1,149 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}---------------------------------------------------------------------------------- | --- Module : Web.Stripe.Client.Internal--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX--- | --------------------------------------------------------------------------------module Web.Stripe.Client.Internal- ( callAPI- , stripeRaw- , stripe- , Stripe- , StripeRequest (..)- , StripeError (..)- , StripeConfig (..)- , Method (..)- , module Web.Stripe.Client.Util- , module Web.Stripe.Client.Error- ) where---import Control.Exception (SomeException, try)-import Control.Monad (when)-import Control.Monad.IO.Class (MonadIO (liftIO))-import Control.Monad.Reader (ask, runReaderT)-import Control.Monad.Trans.Either (left, runEitherT, right)-import Data.Aeson (FromJSON, Value(..), eitherDecodeStrict)-import Data.Monoid (mempty, (<>))-import qualified Data.Text as T-import Network.Http.Client (Connection, Method (..),- baselineContextSSL, buildRequest,- closeConnection, concatHandler,- encodedFormBody, getStatusCode,- http, openConnectionSSL,- receiveResponse, sendRequest,- setAuthorizationBasic,- setContentType, setHeader)-import OpenSSL (withOpenSSL)-import Web.Stripe.Client.Error (StripeError (..),- StripeErrorHTTPCode (..),- StripeErrorType (..))-import Web.Stripe.Client.Types (APIVersion (..), Stripe,- StripeConfig (..),- StripeRequest (..))-import Web.Stripe.Client.Util (fromSeconds, getParams, toSeconds,- paramsToByteString, toBytestring,- toExpandable, toMetaData, toText,- toTextLower, (</>))-import qualified Data.ByteString as S-import qualified Data.Text.Encoding as T-import qualified System.IO.Streams as Streams----------------------------------------------------------------------------------- | Create a custom request to `Stripe`'s API, Build your own!--- Useful if you're using an old api) !-stripeRaw- :: FromJSON a- => StripeConfig - -> StripeRequest- -> IO (Either StripeError a)-stripeRaw config req = do- withOpenSSL $ do- ctx <- baselineContextSSL- result <- try (openConnectionSSL ctx "api.stripe.com" 443) :: IO (Either SomeException Connection)- case result of- Left msg -> return $ Left $ StripeError ConnectionFailure (toText msg) Nothing Nothing Nothing- Right conn -> do- json <- flip runReaderT (config, conn) $ runEitherT (callAPI req)- closeConnection conn- return json----------------------------------------------------------------------------------- | Create a request to `Stripe`'s API-stripe- :: FromJSON a- => StripeConfig- -> Stripe a- -> IO (Either StripeError a)-stripe config requests = do- withOpenSSL $ do- ctx <- baselineContextSSL- result <- try (openConnectionSSL ctx "api.stripe.com" 443) :: IO (Either SomeException Connection)- case result of- Left msg -> return $ Left $ StripeError ConnectionFailure (toText msg) Nothing Nothing Nothing- Right conn -> do- json <- flip runReaderT (config, conn) $ runEitherT requests- closeConnection conn- return json----------------------------------------------------------------------------------- | Debug Helper-debug :: Bool-debug = False----------------------------------------------------------------------------------- | API Request to be issued-callAPI :: FromJSON a => StripeRequest -> Stripe a-callAPI StripeRequest{..} = do- (StripeConfig{..}, conn) <- ask- let reqBody | method == GET = mempty- | otherwise = queryParams- reqURL | method == GET = S.concat [- T.encodeUtf8 endpoint- , "?"- , paramsToByteString queryParams- ]- | otherwise = T.encodeUtf8 endpoint- handleStream =<< liftIO (do- req <- buildRequest $ do- http method $ "/v1/" <> reqURL- setAuthorizationBasic secretKey mempty- setContentType "application/x-www-form-urlencoded"- setHeader "Stripe-Version" (toBytestring V20141007)- setHeader "Connection" "Keep-Alive"- sendRequest conn req $ encodedFormBody reqBody- receiveResponse conn $ \response inputStream ->- do when debug $ print response- result <- concatHandler response inputStream- return (response, result))- where- parseFail errorMessage = - left $ StripeError ParseFailure (T.pack errorMessage) Nothing Nothing Nothing- unknownCode = left $ StripeError UnknownErrorType mempty Nothing Nothing Nothing- handleStream (p,x) =- case getStatusCode p of- 200 -> case eitherDecodeStrict x of- Left message -> do- when debug $ liftIO $ print (eitherDecodeStrict x :: Either String Value)- parseFail message- Right json -> right json- code | code >= 400 ->- case eitherDecodeStrict x :: Either String StripeError of- Left message -> parseFail message- Right json ->- left $ case code of- 400 -> json { errorHTTP = Just BadRequest }- 401 -> json { errorHTTP = Just UnAuthorized }- 402 -> json { errorHTTP = Just RequestFailed }- 404 -> json { errorHTTP = Just NotFound }- 500 -> json { errorHTTP = Just StripeServerError }- 502 -> json { errorHTTP = Just StripeServerError }- 503 -> json { errorHTTP = Just StripeServerError }- 504 -> json { errorHTTP = Just StripeServerError }- _ -> json { errorHTTP = Just UnknownHTTPCode }- _ -> unknownCode
− src/Web/Stripe/Client/Types.hs
@@ -1,53 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}--- |--- Module : Web.Stripe.Client.Types--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX-module Web.Stripe.Client.Types- ( -- * Types- Stripe- , StripeRequest (..)- , StripeConfig (..)- , APIVersion (..)- ) where--import Control.Monad.Reader (ReaderT)-import Control.Monad.Trans.Either (EitherT)-import Data.ByteString (ByteString)-import Data.Text (Text)-import Network.Http.Client (Connection, Method)-import Web.Stripe.Client.Error (StripeError (..))----------------------------------------------------------------------------------- | The `Stripe` Monad-type Stripe = EitherT StripeError (ReaderT (StripeConfig, Connection) IO)----------------------------------------------------------------------------------- | HTTP Params-type Params = [(ByteString, ByteString)]----------------------------------------------------------------------------------- | Stripe Request holding `Method`, URL and `Params` for a Request-data StripeRequest = StripeRequest- { method :: Method -- ^ Method of StripeRequest (i.e. `GET`, `PUT`, `POST`, `PUT`)- , endpoint :: Text -- ^ Endpoint of StripeRequest- , queryParams :: Params -- ^ Query Parameters of StripeRequest- } deriving Show----------------------------------------------------------------------------------- | Stripe secret key-data StripeConfig = StripeConfig- { secretKey :: ByteString- } deriving Show----------------------------------------------------------------------------------- | API Version-data APIVersion =- V20141007 -- ^ Stripe API Version for this package release- deriving Eq--instance Show APIVersion where- show V20141007 = "2014-10-07"-
− src/Web/Stripe/Client/Util.hs
@@ -1,107 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}--- |--- Module : Web.Stripe.Client.Util--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX-module Web.Stripe.Client.Util- ( -- * Utils- fromSeconds- , toSeconds- , paramsToByteString- , toText- , toTextLower- , getParams- , toBytestring- , (</>)- , toMetaData- , toExpandable- ) where--import Data.ByteString (ByteString)-import qualified Data.ByteString.Char8 as B8-import Data.Monoid (Monoid, mconcat, mempty, (<>))-import Data.String (IsString)-import Data.Text (Text)-import qualified Data.Text as T-import qualified Data.Text.Encoding as T-import Data.Time.Clock (UTCTime)-import Data.Time.Clock.POSIX (posixSecondsToUTCTime, utcTimeToPOSIXSeconds)----------------------------------------------------------------------------------- | Conversion from a `Show` constrained type to `Text`-toText- :: Show a- => a - -> Text -toText = T.pack . show----------------------------------------------------------------------------------- | Conversion from a `Show` constrained type to lowercase `Text`-toTextLower- :: Show a- => a - -> Text -toTextLower = T.toLower . T.pack . show----------------------------------------------------------------------------------- | Conversion of a key value pair to a query parameterized string-paramsToByteString- :: (Monoid m, IsString m)- => [(m, m)]- -> m-paramsToByteString [] = mempty-paramsToByteString ((x,y) : []) = x <> "=" <> y-paramsToByteString ((x,y) : xs) =- mconcat [ x, "=", y, "&" ] <> paramsToByteString xs----------------------------------------------------------------------------------- | Forward slash interspersion on `Monoid` and `IsString`--- constrained types-(</>)- :: (Monoid m, IsString m)- => m- -> m- -> m-m1 </> m2 = m1 <> "/" <> m2----------------------------------------------------------------------------------- | Convert an `Integer` to a `UTCTime`-fromSeconds- :: Integer- -> UTCTime-fromSeconds = posixSecondsToUTCTime . fromInteger----------------------------------------------------------------------------------- | Convert a `UTCTime` to a `Integer`-toSeconds- :: UTCTime- -> Integer -toSeconds = read . takeWhile (/='.') . show . utcTimeToPOSIXSeconds----------------------------------------------------------------------------------- | Retrieve and encode the optional parameters-getParams- :: [(ByteString, Maybe Text)]- -> [(ByteString, ByteString)]-getParams xs = [ (x, T.encodeUtf8 y) | (x, Just y) <- xs ]----------------------------------------------------------------------------------- | Convert APITVersion to a ByteString-toBytestring :: Show a => a -> ByteString-toBytestring = B8.pack . show----------------------------------------------------------------------------------- | To MetaData-toMetaData :: [(Text, Text)] -> [(ByteString, ByteString)]-toMetaData = map toKV- where- toKV (k,v) = ("metadata[" <> T.encodeUtf8 k <> "]", T.encodeUtf8 v)----------------------------------------------------------------------------------- | To Expandable-toExpandable :: [Text] -> [(ByteString, ByteString)]-toExpandable = map toKV- where- toKV v = ("expand[]", T.encodeUtf8 v)
− src/Web/Stripe/Coupon.hs
@@ -1,157 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Coupon--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#coupons >------ @--- import Web.Stripe --- import Web.Stripe.Coupon------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- createCoupon--- (Just $ CouponId "$1 Off!")--- Once--- (Just $ AmountOff 1)--- (Just USD)--- Nothing--- Nothing--- Nothing--- Nothing--- []--- case result of--- Right coupon -> print coupon--- Left stripeError -> print stripeError--- @-module Web.Stripe.Coupon- ( -- * API- createCoupon- , getCoupon- , getCoupons- , updateCoupon- , deleteCoupon- -- * Types- , Duration (..)- , AmountOff (..)- , CouponId (..)- , Coupon (..)- , Currency (..)- , DurationInMonths (..)- , MaxRedemptions (..)- , PercentOff (..)- , RedeemBy (..)- , StripeList (..)- , StripeDeleteResult (..)- ) where--import Web.Stripe.Client.Internal (Method (POST, DELETE, GET), Stripe,- StripeRequest (..), callAPI, toMetaData,- getParams, toText, (</>), toTextLower)-import Web.Stripe.Types (AmountOff (..), Coupon (..),- CouponId (..), Currency (..),- Duration(..), DurationInMonths (..),- EndingBefore, Limit, MetaData,- MaxRedemptions (..),- PercentOff (..), RedeemBy (..),- StartingAfter,- StripeDeleteResult (..),- StripeList (..))----------------------------------------------------------------------------------- | `Coupon` creation-createCoupon- :: Maybe CouponId -- ^ Name of the `Coupon` - -> Duration -- ^ `Duration` of the `Coupon`- -> Maybe AmountOff -- ^ `AmountOff` of the `Coupon`- -> Maybe Currency -- ^ `Currency` of the `Coupon`- -> Maybe DurationInMonths -- ^ `DurationInMonths` of the `Coupon`- -> Maybe MaxRedemptions -- ^ `MaxRedemptions` of the `Coupon`- -> Maybe PercentOff -- ^ `PercentOff` of the `Coupon`- -> Maybe RedeemBy -- ^ `RedeemBy` date of the `Coupon`- -> MetaData -- ^ `MetaData` of the `Coupon`- -> Stripe Coupon-createCoupon- couponid- duration- amountOff- currency- durationInMonths- maxRedemptions- percentOff- redeemBy- metadata = callAPI request- where request = StripeRequest POST url params- url = "coupons"- params = toMetaData metadata ++ getParams [- ("id", (\(CouponId x) -> x) `fmap` couponid )- , ("duration", toText `fmap` Just duration )- , ("amount_off", (\(AmountOff x) -> toText x) `fmap` amountOff )- , ("currency", toTextLower `fmap` currency)- , ("duration_in_months", (\(DurationInMonths x) -> toText x) `fmap` durationInMonths )- , ("max_redemptions", (\(MaxRedemptions x) -> toText x) `fmap` maxRedemptions )- , ("percent_off", (\(PercentOff x) -> toText x) `fmap` percentOff )- , ("redeem_by", (\(RedeemBy x) -> toText x) `fmap` redeemBy )- ]----------------------------------------------------------------------------------- | Retrieve a `Coupon` by `CouponId`-getCoupon- :: CouponId -- ^ `CouponId` of the `Coupon` to retrieve- -> Stripe Coupon-getCoupon- (CouponId couponid) = callAPI request- where request = StripeRequest GET url params- url = "coupons" </> couponid- params = []----------------------------------------------------------------------------------- | Retrieve a list of 'Coupon's-getCoupons- :: Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter CouponId -- ^ Paginate starting after the following `CouponId`- -> EndingBefore CouponId -- ^ Paginate ending before the following `CouponId`- -> Stripe (StripeList Coupon)-getCoupons- limit- startingAfter- endingBefore- = callAPI request- where request = StripeRequest GET url params- url = "coupons"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(CouponId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(CouponId x) -> x) `fmap` endingBefore)- ]----------------------------------------------------------------------------------- | Update 'Coupon'-updateCoupon- :: CouponId -- ^ The `CoupondId` of the `Coupon` to update- -> MetaData -- ^ The `MetaData` for the `Coupon`- -> Stripe Coupon-updateCoupon- (CouponId couponid)- metadata = callAPI request- where request = StripeRequest POST url params- url = "coupons" </> couponid- params = toMetaData metadata----------------------------------------------------------------------------------- | Delete 'Coupon" by 'CouponId'-deleteCoupon- :: CouponId -- ^ The `CoupondId` of the `Coupon` to update- -> Stripe StripeDeleteResult-deleteCoupon- (CouponId couponid) = callAPI request- where request = StripeRequest DELETE url params- url = "coupons" </> couponid- params = []-
− src/Web/Stripe/Customer.hs
@@ -1,310 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}----------------------------------------------- |--- Module : Web.Stripe.Customer--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#customers >------ @--- import Web.Stripe --- import Web.Stripe.Customer------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config createEmptyCustomer--- case result of--- Right customer -> print customer--- Left stripeError -> print stripeError--- @-module Web.Stripe.Customer- ( -- * API- ---- * Create customer- createEmptyCustomer- , createCustomerByEmail- , createCustomerByToken- , createCustomerByCard- , createCustomerBase- ---- * Update customer- , updateCustomerBase- , updateCustomerAccountBalance- , updateCustomerDefaultCard- ---- * Delete customer- , deleteCustomer- ---- * Get customer(s)- , getCustomer- , getCustomerExpandable- , getCustomers- , getCustomersExpandable- -- * Types- , Customer (..)- , CustomerId (..)- , CardId (..)- , StripeList (..)- , TokenId (..)- , CardNumber (..)- , ExpMonth (..)- , ExpYear (..)- , CVC (..)- , CouponId (..)- , Email (..)- , PlanId (..)- , Quantity (..)- , StripeDeleteResult (..)- , TrialPeriod (..)- , Description- , AccountBalance- , Limit- ) where--import Web.Stripe.Client.Internal (Method (GET, POST, DELETE), Stripe,- StripeRequest (..), callAPI, toMetaData,- toSeconds, getParams, toText, (</>), toExpandable)-import Web.Stripe.Types (AccountBalance, CVC (..),- CardId (..), CardNumber (..),- CouponId (..), Customer (..),- CustomerId (..), Description,- Email (..), EndingBefore,- ExpMonth (..), ExpYear (..), Limit,- PlanId (..), Quantity (..), MetaData,- StartingAfter,- StripeDeleteResult (..),- StripeList (..), TokenId (..),- TrialPeriod(..), ExpandParams)-import Web.Stripe.Types.Util----------------------------------------------------------------------------------- | The base request for customer creation-createCustomerBase- :: Maybe AccountBalance -- ^ Integer amount corresponding to AccountBalance- -> Maybe TokenId -- ^ Either a dictionary of a card or a 'TokenId'- -> Maybe CardNumber -- ^ Card Number- -> Maybe ExpMonth -- ^ Card Expiration Month- -> Maybe ExpYear -- ^ Card Expiration Year- -> Maybe CVC -- ^ Card CVC- -> Maybe CouponId -- ^ Discount on all recurring charges- -> Maybe Description -- ^ Arbitrary string to attach to a customer object- -> Maybe Email -- ^ Email address of customer- -> Maybe PlanId -- ^ Identifier of plan to subscribe customer to- -> Maybe Quantity -- ^ The quantity you'd like to apply to the subscription you're creating- -> Maybe TrialPeriod -- ^ TimeStamp representing the trial period the customer will get- -> MetaData -- ^ MetaData associated with the customer being created- -> Stripe Customer-createCustomerBase- accountBalance- cardId- cardNumber- expMonth- expYear- cvc- couponId- description- email- planId- quantity- trialEnd- metadata = callAPI request- where request = StripeRequest POST "customers" params- params = toMetaData metadata ++ getParams [- ("account_balance", toText `fmap` accountBalance)- , ("card", (\(TokenId x) -> x) `fmap` cardId)- , ("card[number]", (\(CardNumber x) -> x) `fmap` cardNumber)- , ("card[exp_month]", (\(ExpMonth x) -> toText x) `fmap` expMonth)- , ("card[exp_year]", (\(ExpYear x) -> toText x) `fmap` expYear)- , ("card[cvc]", (\(CVC x) -> x) `fmap` cvc)- , ("coupon", (\(CouponId x) -> x) `fmap` couponId)- , ("description", description)- , ("email", (\(Email x) -> x) `fmap` email)- , ("plan", (\(PlanId x) -> x) `fmap` planId)- , ("quantity", (\(Quantity x) -> toText x) `fmap` quantity)- , ("trial_end", (\(TrialPeriod x) -> toText $ toSeconds x) `fmap` trialEnd)- ]----------------------------------------------------------------------------------- | Creates a customer by his/her email-createCustomerByEmail- :: Email -- ^ The `Email` of the `Customer` to create- -> Stripe Customer-createCustomerByEmail e =- createCustomerBase Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing- (Just e) Nothing Nothing Nothing []----------------------------------------------------------------------------------- | Creates a blank customer-createEmptyCustomer- :: Stripe Customer-createEmptyCustomer =- createCustomerBase Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing []----------------------------------------------------------------------------------- | Creates a customer by a Token created from stripe.js or the stripe API.-createCustomerByToken- :: TokenId -- ^ The `TokenId` of the `Customer` to create- -> Stripe Customer-createCustomerByToken t =- createCustomerBase Nothing (Just t) Nothing Nothing- Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing []----------------------------------------------------------------------------------- | Creates a 'Customer' with a 'Card'-createCustomerByCard- :: CardNumber -- ^ Card Number- -> ExpMonth -- ^ Card Expiration Month- -> ExpYear -- ^ Card Expiration Year- -> CVC -- ^ Card `CVC`- -> Stripe Customer-createCustomerByCard- cardNumber- expMonth- expYear- cvc = createCustomerBase Nothing Nothing (Just cardNumber) (Just expMonth)- (Just expYear) (Just cvc) Nothing Nothing- Nothing Nothing Nothing Nothing []----------------------------------------------------------------------------------- | Updates a customer-updateCustomerBase- :: CustomerId -- ^ `CustomerId` associated with the `Customer` to update- -> Maybe AccountBalance -- ^ Integer amount corresponding to AccountBalance- -> Maybe TokenId -- ^ Either a dictionary of a card or a tokenId- -> Maybe CardNumber -- ^ Either a dictionary of a card or a tokenId- -> Maybe ExpMonth -- ^ `Card` Expiration Month- -> Maybe ExpYear -- ^ `Card` Expiration Year- -> Maybe CVC -- ^ `Card` CVC- -> Maybe CouponId -- ^ Discount on all recurring charges- -> Maybe CardId -- ^ `CardId` to set as default for customer- -> Maybe Description -- ^ Arbitrary string to attach to a customer object- -> Maybe Email -- ^ Email address of customer- -> MetaData -- ^ MetaData associated with the customer being created- -> Stripe Customer-updateCustomerBase- customerid- accountBalance- cardId- cardNumber- expMonth- expYear- cvc- couponId- defaultCardId- description- email- metadata = callAPI request- where request = StripeRequest POST url params- url = "customers" </> getCustomerId customerid- params = toMetaData metadata ++ getParams [- ("account_balance", toText `fmap` accountBalance)- , ("card", (\(TokenId x) -> x) `fmap` cardId)- , ("card[number]", (\(CardNumber x) -> x) `fmap` cardNumber)- , ("card[exp_month]", (\(ExpMonth x) -> toText x) `fmap` expMonth)- , ("card[exp_year]", (\(ExpYear x) -> toText x) `fmap` expYear)- , ("card[cvc]", (\(CVC x) -> x) `fmap` cvc)- , ("coupon", (\(CouponId x) -> x) `fmap` couponId)- , ("default_card", (\(CardId x) -> x) `fmap` defaultCardId)- , ("description", description)- , ("email", (\(Email x) -> x) `fmap` email)- ]----------------------------------------------------------------------------------- | Update Customer Account Balance-updateCustomerAccountBalance- :: CustomerId -- ^ `CustomerId` associated with the `Customer` to update- -> AccountBalance -- ^ `AccountBalance` associated- -> Stripe Customer-updateCustomerAccountBalance- customerid- accountbalance- = updateCustomerBase customerid (Just accountbalance)- Nothing Nothing Nothing- Nothing Nothing Nothing- Nothing Nothing Nothing []----------------------------------------------------------------------------------- | Update Customer Account Balance-updateCustomerDefaultCard- :: CustomerId -- ^ `CustomerId` associated with the `Customer` to update- -> CardId -- ^ 'CardId' to become default card- -> Stripe Customer-updateCustomerDefaultCard- customerId- defaultCard- = updateCustomerBase customerId Nothing- Nothing Nothing Nothing- Nothing Nothing Nothing- (Just defaultCard) Nothing Nothing []----------------------------------------------------------------------------------- | Deletes the specified customer-deleteCustomer- :: CustomerId -- ^ The `CustomerId` of the `Customer` to delete- -> Stripe StripeDeleteResult-deleteCustomer customerid = callAPI request- where request = StripeRequest DELETE url params- url = "customers" </> getCustomerId customerid- params = []----------------------------------------------------------------------------------- | Retrieves a customer by his/her ID.-getCustomer- :: CustomerId -- ^ The `CustomerId` of the `Customer` to retrieve- -> Stripe Customer-getCustomer customerid =- getCustomerExpandable customerid []----------------------------------------------------------------------------------- | Retrieves a customer by his/her `CustomerID` with `ExpandParams`-getCustomerExpandable- :: CustomerId -- ^ The `CustomerId` of the `Customer` to retrieve- -> ExpandParams -- ^ The `ExpandParams` of the object to expand- -> Stripe Customer-getCustomerExpandable- customerid- expandParams = callAPI request- where request = StripeRequest GET url params- url = "customers" </> getCustomerId customerid- params = toExpandable expandParams----------------------------------------------------------------------------------- | Retrieve up to 100 customers at a time-getCustomers- :: Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter CustomerId -- ^ Paginate starting after the following `CustomerId`- -> EndingBefore CustomerId -- ^ Paginate ending before the following `CustomerId`- -> Stripe (StripeList Customer)-getCustomers- limit- startingAfter- endingBefore =- getCustomersExpandable limit startingAfter endingBefore []----------------------------------------------------------------------------------- | Retrieve up to 100 customers at a time-getCustomersExpandable- :: Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter CustomerId -- ^ Paginate starting after the following `CustomerId`- -> EndingBefore CustomerId -- ^ Paginate ending before the following `CustomerId`- -> ExpandParams -- ^ Get Customers with `ExpandParams`- -> Stripe (StripeList Customer)-getCustomersExpandable- limit- startingAfter- endingBefore- expandParams = callAPI request- where request = StripeRequest GET url params- url = "customers"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(CustomerId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(CustomerId x) -> x) `fmap` endingBefore)- ] ++ toExpandable expandParams--
− src/Web/Stripe/Discount.hs
@@ -1,66 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Discount--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#discounts >------ @--- import Web.Stripe --- import Web.Stripe.Discount--- import Web.Stripe.Customer------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config $ deleteCustomerDiscount (CustomerId "customer_id")--- case result of--- Right deleteResult -> print deleteResult--- Left stripeError -> print stripeError--- @-module Web.Stripe.Discount- ( -- * API- deleteCustomerDiscount- , deleteSubscriptionDiscount- -- * Types- , StripeDeleteResult (..)- , CustomerId (..)- , SubscriptionId (..)- , Discount (..)- ) where--import Web.Stripe.Client.Internal (Method (DELETE), Stripe,- StripeRequest (..), callAPI,- (</>))-import Web.Stripe.Types (CustomerId (..), Discount(..),- StripeDeleteResult (..),- SubscriptionId (..))-import Web.Stripe.Types.Util (getCustomerId)----------------------------------------------------------------------------------- | Delete `Customer` `Discount` by `CustomerId`-deleteCustomerDiscount- :: CustomerId -- ^ The `Customer` upon which to remove the `Discount`- -> Stripe StripeDeleteResult-deleteCustomerDiscount- customerId = callAPI request- where request = StripeRequest DELETE url params- url = "customers" </> getCustomerId customerId </> "discount"- params = []----------------------------------------------------------------------------------- | Delete `Subscription` `Discount` by `CustomerId` and `SubscriptionId`-deleteSubscriptionDiscount- :: CustomerId -- ^ The `Customer` to remove the `Discount` from- -> SubscriptionId -- ^ The `Subscription` to remove the `Discount` from- -> Stripe StripeDeleteResult-deleteSubscriptionDiscount- customerId- (SubscriptionId subId) = callAPI request- where request = StripeRequest DELETE url params- url = "customers" </> getCustomerId customerId </> "subscriptions" </> subId </> "discount"- params = []
− src/Web/Stripe/Dispute.hs
@@ -1,74 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Dispute--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#diputes >------ @--- import Web.Stripe --- import Web.Stripe.Charge--- import Web.Stripe.Dispute------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config $ do--- Charge { chargeDispute = dispute } <- getCharge (ChargeId "charge_id")--- return dispute--- case result of--- Right (Just dispute) -> print dispute--- Right Nothing -> print "no dispute on this charge"--- Left stripeError -> print stripeError--- @-module Web.Stripe.Dispute- ( -- * API- updateDispute- , closeDispute- -- * Types- , ChargeId (..)- , Dispute (..)- , DisputeReason (..)- , DisputeStatus (..)- , Evidence (..)- ) where--import Web.Stripe.Client.Internal (Method (POST), Stripe,- StripeRequest (..), callAPI,- getParams, (</>), toMetaData)-import Web.Stripe.Types (ChargeId (..), Dispute (..),- DisputeReason (..),- DisputeStatus (..),- Evidence (..), MetaData)-import Web.Stripe.Types.Util (getChargeId)----------------------------------------------------------------------------------- | `Dispute` to be updated-updateDispute- :: ChargeId -- ^ The ID of the Charge being disputed- -> Maybe Evidence -- ^ Text-only evidence of the dispute- -> MetaData -- ^ `MetaData` associated with `Dispute`- -> Stripe Dispute-updateDispute- chargeId- evidence- metadata = callAPI request- where request = StripeRequest POST url params- url = "charges" </> getChargeId chargeId </> "dispute"- params = toMetaData metadata ++ getParams [- ("evidence", (\(Evidence x) -> x) `fmap` evidence)- ]---------------------------------------------------------------------------------- | `Dispute` to be closed-closeDispute- :: ChargeId -- ^ The ID of the Charge being disputed- -> Stripe Dispute-closeDispute- chargeId = callAPI request- where request = StripeRequest POST url params- url = "charges" </> getChargeId chargeId </> "dispute" </> "close"- params = []
− src/Web/Stripe/Event.hs
@@ -1,72 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Event--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#events >------ @--- import Web.Stripe --- import Web.Stripe.Event------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config $ getEvents Nothing Nothing Nothing--- case result of--- Right events -> print events--- Left stripeError -> print stripeError--- @-module Web.Stripe.Event- ( -- * API- getEvent- , getEvents- -- * Types- , EventId (..)- , Event (..)- , EventData (..)- , EventType (..)- , StripeList (..)- , Limit- ) where--import Web.Stripe.Client.Internal (Method (GET), Stripe, Stripe, - StripeRequest (..), callAPI, (</>), getParams, toText)-import Web.Stripe.Types (Event (..), EventId (..), Limit, EventData(..),- EventType(..), StripeList (..), Limit,- StartingAfter, EndingBefore)----------------------------------------------------------------------------------- | `Event` to retrieve by `EventId`-getEvent- :: EventId -- ^ The ID of the Event to retrieve- -> Stripe Event-getEvent (EventId eventid) = callAPI request- where request = StripeRequest GET url params- url = "events" </> eventid- params = []----------------------------------------------------------------------------------- | `StripeList` of `Event`s to retrieve-getEvents- :: Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter EventId -- ^ Paginate starting after the following `EventId`- -> EndingBefore EventId -- ^ Paginate ending before the following `EventId`- -> Stripe (StripeList Event)-getEvents - limit- startingAfter- endingBefore = callAPI request- where request = StripeRequest GET url params- url = "events"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(EventId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(EventId x) -> x) `fmap` endingBefore)- ]--
− src/Web/Stripe/Invoice.hs
@@ -1,197 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Invoice--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#invoices >------ @--- import Web.Stripe --- import Web.Stripe.Customer--- import Web.Stripe.Invoice--- import Web.Stripe.InvoiceItem--- import Web.Stripe.Plan------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config $ do--- Customer { customerId = cid } <- createEmptyCustomer--- Plan { } <- createPlan (PlanId "planid") 20 USD Day "testplan" []--- InvoiceItem { } <- createInvoiceItem cid 100 USD Nothing Nothing Nothing []--- createInvoice cid []--- case result of--- Right invoice -> print invoice--- Left stripeError -> print stripeError--- @-module Web.Stripe.Invoice- ( -- * API- createInvoice- , getInvoice- , getInvoiceExpandable- , getInvoices- , getInvoicesExpandable- , getInvoiceLineItems- , getUpcomingInvoice- , getUpcomingInvoices- , updateInvoice- , payInvoice- -- * Types- , Invoice (..)- , InvoiceId (..)- , InvoiceLineItem (..)- , InvoiceLineItemId (..)- , InvoiceLineItemType (..)- , Discount (..)- , Period (..)- ) where--import Web.Stripe.Client.Internal-import Web.Stripe.Types-import Web.Stripe.Types.Util----------------------------------------------------------------------------------- | The `Invoice` to be created for a `Customer`-createInvoice- :: CustomerId -- ^ `CustomerId` of `Customer` to `Invoice`- -> MetaData -- ^ `MetaData` of `Customer` to `Invoice`- -> Stripe Invoice-createInvoice- customerid- metadata = callAPI request- where request = StripeRequest POST url params- url = "invoices"- params = toMetaData metadata ++ getParams [- ("customer", Just $ getCustomerId customerid)- ]----------------------------------------------------------------------------------- | Retrieve an `Invoice` by `InvoiceId`-getInvoice- :: InvoiceId -- ^ Get an `Invoice` by `InvoiceId`- -> Stripe Invoice-getInvoice- invoiceid = getInvoiceExpandable invoiceid []----------------------------------------------------------------------------------- | Retrieve an `Invoice` by `InvoiceId` with `ExpandParams`-getInvoiceExpandable- :: InvoiceId -- ^ Get an `Invoice` by `InvoiceId`- -> ExpandParams -- ^ `ExpandParams` of the objects for expansion- -> Stripe Invoice-getInvoiceExpandable- invoiceid- expandParams = callAPI request- where request = StripeRequest GET url params- url = "invoices" </> getInvoiceId invoiceid- params = toExpandable expandParams----------------------------------------------------------------------------------- | Retrieve a `StripeList` of `Invoice`s-getInvoices- :: Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter InvoiceItemId -- ^ Paginate starting after the following `Customer`- -> EndingBefore InvoiceItemId -- ^ Paginate ending before the following `CustomerID`- -> Stripe (StripeList Invoice)-getInvoices- limit- startingAfter- endingBefore =- getInvoicesExpandable limit startingAfter endingBefore []----------------------------------------------------------------------------------- | Retrieve a `StripeList` of `Invoice`s with `ExpandParams`-getInvoicesExpandable- :: Maybe Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter InvoiceItemId -- ^ Paginate starting after the following `Customer`- -> EndingBefore InvoiceItemId -- ^ Paginate ending before the following `CustomerID`- -> ExpandParams -- ^ `ExpandParams` of the objects for expansion- -> Stripe (StripeList Invoice)-getInvoicesExpandable- limit- startingAfter- endingBefore- expandParams = callAPI request- where request = StripeRequest GET url params- url = "invoices"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(InvoiceItemId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(InvoiceItemId x) -> x) `fmap` endingBefore)- ] ++ toExpandable expandParams----------------------------------------------------------------------------------- | Retrieve an `Invoice` by `InvoiceId`-getInvoiceLineItems- :: InvoiceId -- ^ Get an `Invoice` by `InvoiceId`- -> Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter InvoiceLineItemId -- ^ Paginate starting after the following `InvoiceLineItemId`- -> EndingBefore InvoiceLineItemId -- ^ Paginate ending before the following `InvoiceLineItemId`- -> Stripe (StripeList InvoiceLineItem)-getInvoiceLineItems- invoiceid- limit- startingAfter- endingBefore = callAPI request- where request = StripeRequest GET url params- url = "invoices" </> getInvoiceId invoiceid </> "lines"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(InvoiceLineItemId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(InvoiceLineItemId x) -> x) `fmap` endingBefore)- ]------------------------------------------------------------------------------------ | Pay `Invoice` by `InvoiceId`-payInvoice- :: InvoiceId -- ^ The `InvoiceId` of the `Invoice` to pay- -> Stripe Invoice-payInvoice- invoiceid = callAPI request- where request = StripeRequest POST url params- url = "invoices" </> getInvoiceId invoiceid </> "pay"- params = []----------------------------------------------------------------------------------- | Update `Invoice` by `InvoiceId`-updateInvoice- :: InvoiceId -- ^ The `InvoiceId` of the `Invoice` to update- -> MetaData -- ^ `MetaData` of `Customer` to `Invoice`- -> Stripe Invoice-updateInvoice- invoiceid- metadata = callAPI request- where request = StripeRequest POST url params- url = "invoices" </> getInvoiceId invoiceid- params = toMetaData metadata----------------------------------------------------------------------------------- | Retrieve an upcoming `Invoice` for a `Customer` by `CustomerId`-getUpcomingInvoice- :: CustomerId -- ^ The `InvoiceId` of the `Invoice` to retrieve- -> Stripe Invoice-getUpcomingInvoice- customerid = callAPI request- where request = StripeRequest GET url params- url = "invoices" </> "upcoming"- params = getParams [- ("customer", Just $ getCustomerId customerid)- ]----------------------------------------------------------------------------------- | Retrieve a `StripeList` of `Invoice`s-getUpcomingInvoices- :: CustomerId -- ^ The `InvoiceId` of the `Invoice` to retrieve- -> Stripe (StripeList Invoice)-getUpcomingInvoices- customerid = callAPI request- where request = StripeRequest GET url params- url = "invoices"- params = getParams [- ("customer", Just $ getCustomerId customerid)- ]
− src/Web/Stripe/InvoiceItem.hs
@@ -1,189 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.InvoiceItem--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#invoiceitems >------ @--- import Web.Stripe --- import Web.Stripe.Customer--- import Web.Stripe.InvoiceItem------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config $ do--- Customer { customerId = cid } <- createEmptyCustomer--- createInvoiceItem cid 100 USD Nothing Nothing (Just "description") []--- case result of--- Right invoiceitem -> print invoiceitem--- Left stripeError -> print stripeError--- @-module Web.Stripe.InvoiceItem- ( -- * API - createInvoiceItem- , getInvoiceItem- , getInvoiceItemExpandable- , getInvoiceItems- , getInvoiceItemsExpandable- , updateInvoiceItem- , deleteInvoiceItem- -- * Types- , InvoiceItemId (..)- , InvoiceItem (..)- , CustomerId (..)- , Currency (..)- , InvoiceId (..)- , Invoice (..)- , SubscriptionId (..)- , StripeDeleteResult (..)- , StripeList (..)- , Description - , Amount- ) where--import Web.Stripe.Client.Internal (Method (GET, POST, DELETE), Stripe,- StripeRequest (..), callAPI, toMetaData, toExpandable,- getParams, toText, (</>), toTextLower)-import Web.Stripe.Types (Amount, Currency (..), StripeList(..),- CustomerId (..), Description,- InvoiceId (..), InvoiceItem (..), Invoice(..),- InvoiceItemId (..), Limit, StartingAfter, EndingBefore,- StripeDeleteResult (..), ExpandParams,- SubscriptionId (..), MetaData)-import Web.Stripe.Types.Util----------------------------------------------------------------------------------- | Create an invoice for a Customer-createInvoiceItem- :: CustomerId -- ^ `CustomerId` of `Customer` on which to create an `InvoiceItem`- -> Amount -- ^ `Amount` associated with `InvoiceItem`- -> Currency -- ^ `Currency` to use for `InvoiceItem`- -> Maybe InvoiceId -- ^ `InvoiceId` to use for `InvoiceItem`- -> Maybe SubscriptionId -- ^ `SubscriptionId` to use for `InvoiceItem`- -> Maybe Description -- ^ `Description` to use for `InvoiceItem`- -> MetaData -- ^ `MetaData` to use for `InvoiceItem`- -> Stripe InvoiceItem-createInvoiceItem- customerid- amount- currency- invoiceid- subscriptionId- description- metadata = callAPI request- where request = StripeRequest POST url params- url = "invoiceitems"- params = toMetaData metadata ++ getParams [- ("customer", Just $ getCustomerId customerid)- , ("amount", toText `fmap` Just amount)- , ("currency", toTextLower `fmap` Just currency)- , ("invoice", (\(InvoiceId x) -> x) `fmap` invoiceid)- , ("subscription", (\(SubscriptionId x) -> x) `fmap` subscriptionId)- , ("description", description)- ]----------------------------------------------------------------------------------- | Retrieve an `InvoiceItem` by `InvoiceItemId`-getInvoiceItems- :: Maybe CustomerId -- ^ When specified, only `InvoiceItems` for this `Customer` are returned- -> Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter InvoiceItemId -- ^ Paginate starting after the following `InvoiceItemId`- -> EndingBefore InvoiceItemId -- ^ Paginate ending before the following `InvoiceItemId`- -> Stripe (StripeList InvoiceItem)-getInvoiceItems- customerid- limit- startingAfter- endingBefore = callAPI request- where request = StripeRequest GET url params- url = "invoiceitems"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(InvoiceItemId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(InvoiceItemId x) -> x) `fmap` endingBefore)- , ("customer", (\(CustomerId x) -> x) `fmap` customerid)- ]----------------------------------------------------------------------------------- | Retrieve an `InvoiceItem` by `InvoiceItemId` with `ExpandParams`-getInvoiceItemsExpandable- :: Maybe CustomerId -- ^ When specified, only `InvoiceItems` for this `Customer` are returned- -> Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter InvoiceItemId -- ^ Paginate starting after the following `InvoiceItemId`- -> EndingBefore InvoiceItemId -- ^ Paginate ending before the following `InvoiceItemId`- -> ExpandParams -- ^ `ExpandParams` of the objects for expansion- -> Stripe (StripeList InvoiceItem)-getInvoiceItemsExpandable- customerid- limit- startingAfter- endingBefore- expandParams = callAPI request- where request = StripeRequest GET url params- url = "invoiceitems"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(InvoiceItemId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(InvoiceItemId x) -> x) `fmap` endingBefore)- , ("customer", (\(CustomerId x) -> x) `fmap` customerid)- ] ++ toExpandable expandParams----------------------------------------------------------------------------------- | Retrieve an `InvoiceItem` by `InvoiceItemId`-getInvoiceItem- :: InvoiceItemId -- ^ `InvoiceItemId` of `InvoiceItem` to retrieve- -> Stripe InvoiceItem-getInvoiceItem- invoiceitemid =- getInvoiceItemExpandable invoiceitemid []----------------------------------------------------------------------------------- | Retrieve an `InvoiceItem` by `InvoiceItemId`-getInvoiceItemExpandable- :: InvoiceItemId -- ^ `InvoiceItemId` of `InvoiceItem` to retrieve- -> ExpandParams -- ^ `ExpandParams` of the objects for expansion- -> Stripe InvoiceItem-getInvoiceItemExpandable- invoiceitemid- expandParams = callAPI request- where request = StripeRequest GET url params- url = "invoiceitems" </> getInvoiceItemId invoiceitemid- params = toExpandable expandParams----------------------------------------------------------------------------------- | Update an `InvoiceItem` by `InvoiceItemId`-updateInvoiceItem- :: InvoiceItemId -- ^ `InvoiceItemId` of to update- -> Maybe Amount -- ^ `Amount` in cents of the charge to be applied to the invoice- -> Maybe Description -- ^ `Amount` in cents of the charge to be applied to the invoice- -> MetaData -- ^ `MetaData` of `InvoiceItem` to update- -> Stripe InvoiceItem-updateInvoiceItem- invoiceitemid- amount- description- metadata = callAPI request- where request = StripeRequest POST url params- url = "invoiceitems" </> getInvoiceItemId invoiceitemid- params = toMetaData metadata ++ getParams [- ("amount", toText `fmap` amount)- , ("description", description)- ]----------------------------------------------------------------------------------- | Delete an `InvoiceItem` by `InvoiceItemId`-deleteInvoiceItem- :: InvoiceItemId -- ^ `InvoiceItemdId` of `InvoiceItem` to be deleted- -> Stripe StripeDeleteResult-deleteInvoiceItem- invoiceitemid = callAPI request- where request = StripeRequest DELETE url params- url = "invoiceitems" </> getInvoiceItemId invoiceitemid- params = []-
− src/Web/Stripe/Plan.hs
@@ -1,260 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Plan--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#plans >------ @--- import Web.Stripe --- import Web.Stripe.Plan------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config $ do--- createPlan (PlanId "free plan")--- (0 :: Amount) --- (USD :: Currency)--- (Month :: Interval)--- ("a sample free plan" :: Name)--- ([] :: MetaData)--- case result of--- Right plan -> print plan--- Left stripeError -> print stripeError--- @-module Web.Stripe.Plan - ( -- * API - createPlan- , createPlanIntervalCount- , createPlanTrialPeriodDays- , createPlanBase- , getPlan- , getPlans- , updatePlanName- , updatePlanDescription- , updatePlanBase- , deletePlan- -- * Types- , PlanId (..)- , Plan (..)- , Interval (..)- , StripeList (..)- , IntervalCount (..)- , TrialPeriodDays (..)- , StripeDeleteResult (..)- , Currency (..)- , Email (..)- , Limit- , StartingAfter- , EndingBefore- , Name- , Amount- , Description- , MetaData- ) where--import Web.Stripe.Client.Internal (callAPI, Method(POST, GET, DELETE), toText,- getParams, toMetaData, Stripe,- StripeRequest(..), toTextLower, (</>))--import Web.Stripe.Types (PlanId (..) , Plan (..), Interval (..), StripeList(..),- IntervalCount (..), TrialPeriodDays (..), Limit, Email (..),- StartingAfter, EndingBefore, StripeDeleteResult(..),- Currency (..), Name, Amount, Description, MetaData)----------------------------------------------------------------------------------- | Base Request for creating a 'Plan', useful for making custom `Plan` creation requests-createPlanBase- :: PlanId -- ^ Unique string used to identify `Plan`- -> Amount -- ^ Positive integer in cents representing how much to charge on a recurring basis- -> Currency -- ^ `Currency` of `Plan`- -> Interval -- ^ Billing Frequency (i.e. `Day`, `Week` or `Month`)- -> Name -- ^ Name of `Plan` to be displayed on `Invoice`s- -> Maybe IntervalCount -- ^ Number of intervals between each `Subscription` billing, default 1- -> Maybe TrialPeriodDays -- ^ Integer number of days a trial will have- -> Maybe Description -- ^ An arbitrary string to be displayed on `Customer` credit card statements- -> MetaData -- ^ `MetaData` for the `Plan`- -> Stripe Plan-createPlanBase- (PlanId planid)- amount- currency- interval- name- intervalCount- trialPeriodDays- description - metadata = callAPI request- where request = StripeRequest POST url params- url = "plans"- params = toMetaData metadata ++ getParams [- ("id", Just planid) - , ("amount", toText `fmap` Just amount) - , ("currency", toTextLower `fmap` Just currency)- , ("interval", toText `fmap` Just interval) - , ("name", Just name) - , ("interval_count", (\(IntervalCount x) -> toText x) `fmap` intervalCount )- , ("trial_period_days", (\(TrialPeriodDays x) -> toText x) `fmap` trialPeriodDays )- , ("statement_description", description )- ]----------------------------------------------------------------------------------- | Create a `Plan`-createPlan - :: PlanId -- ^ Unique string used to identify `Plan`- -> Amount -- ^ Positive integer in cents (or 0 for a free plan) representing how much to charge on a recurring basis- -> Currency -- ^ `Currency` of `Plan`- -> Interval -- ^ Billing Frequency - -> Name -- ^ Name of `Plan` to be displayed on `Invoice`s- -> MetaData -- ^ MetaData for the Plan- -> Stripe Plan-createPlan - planid- amount- currency- intervalCount- name = createPlanBase planid amount currency intervalCount name Nothing Nothing Nothing ----------------------------------------------------------------------------------- | Create a `Plan` with a specified `IntervalCount`-createPlanIntervalCount- :: PlanId -- ^ Unique string used to identify `Plan`- -> Amount -- ^ Positive integer in cents (or 0 for a free plan) representing how much to charge on a recurring basis- -> Currency -- ^ `Currency` of `Plan`- -> Interval -- ^ Billing Frequency - -> Name -- ^ Name of `Plan` to be displayed on `Invoice`s- -> IntervalCount -- ^ # of billins between each `Subscription` billing- -> Stripe Plan-createPlanIntervalCount- planid- amount- currency- interval- name- intervalCount = createPlanBase planid amount - currency interval name- (Just intervalCount) Nothing Nothing []----------------------------------------------------------------------------------- | Create a `Plan` with a specified number of `TrialPeriodDays`-createPlanTrialPeriodDays- :: PlanId -- ^ Unique string used to identify `Plan`- -> Amount -- ^ Positive integer in cents (or 0 for a free plan) representing how much to charge on a recurring basis- -> Currency -- ^ `Currency` of `Plan`- -> Interval -- ^ Billing Frequency - -> Name -- ^ Name of `Plan` to be displayed on `Invoice`s- -> TrialPeriodDays -- ^ Number of Trial Period Days to be displayed on `Invoice`s- -> Stripe Plan-createPlanTrialPeriodDays- planid- amount- currency- interval- name- trialPeriodDays = - createPlanBase- planid- amount- currency- interval- name- Nothing- (Just trialPeriodDays) - Nothing - []----------------------------------------------------------------------------------- | Retrieve a `Plan`-getPlan- :: PlanId -- ^ The ID of the plan to retrieve- -> Stripe Plan-getPlan- (PlanId planid) = callAPI request- where request = StripeRequest GET url params- url = "plans" </> planid- params = []----------------------------------------------------------------------------------- | Retrieve a `Plan`-getPlans- :: Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter PlanId -- ^ Paginate starting after the following `CustomerID`- -> EndingBefore PlanId -- ^ Paginate ending before the following `CustomerID`- -> Stripe (StripeList Plan)-getPlans- limit- startingAfter- endingBefore = callAPI request- where request = StripeRequest GET url params- url = "plans"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(PlanId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(PlanId x) -> x) `fmap` endingBefore)- ]----------------------------------------------------------------------------------- | Base Request for updating a `Plan`, useful for creating customer `Plan` update functions-updatePlanBase- :: PlanId -- ^ The ID of the `Plan` to update- -> Maybe Name -- ^ The `Name` of the `Plan` to update- -> Maybe Description -- ^ The `Description` of the `Plan` to update- -> MetaData -- ^ The `MetaData` for the `Plan`- -> Stripe Plan-updatePlanBase- (PlanId planid)- name- description - metadata = callAPI request - where request = StripeRequest POST url params- url = "plans" </> planid- params = toMetaData metadata ++ getParams [- ("name", name)- , ("statement_description", description)- ]----------------------------------------------------------------------------------- | Update a `Plan` `Description`-updatePlanDescription- :: PlanId -- ^ The ID of the `Plan` to update- -> Description -- ^ The `Description` of the `Plan` to update- -> Stripe Plan-updatePlanDescription- (PlanId planid)- description = callAPI request - where request = StripeRequest POST url params- url = "plans" </> planid- params = getParams [- ("statement_description", Just description)- ]----------------------------------------------------------------------------------- | Update a `Plan` `Name`-updatePlanName- :: PlanId -- ^ The ID of the `Plan` to update- -> Description -- ^ The `Name` of the `Plan` to update- -> Stripe Plan-updatePlanName- (PlanId planid)- name = callAPI request - where request = StripeRequest POST url params- url = "plans" </> planid- params = getParams [- ("name", Just name)- ]----------------------------------------------------------------------------------- | Delete a `Plan`-deletePlan- :: PlanId -- ^ The ID of the `Plan` to delete- -> Stripe StripeDeleteResult-deletePlan - (PlanId planid) = callAPI request - where request = StripeRequest DELETE url params- url = "plans" </> planid- params = []
− src/Web/Stripe/Recipient.hs
@@ -1,498 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Recipient--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#recipients >------ @--- import Web.Stripe --- import Web.Stripe.Recipient------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config $ --- createRecipient (FirstName "simon")--- (LastName "marlow")--- Nothing -- What is Simon Marlow's middle initial?--- (Invidiual :: RecipientType)--- case result of--- Right recipient -> print recipient--- Left stripeError -> print stripeError--- @-module Web.Stripe.Recipient- ( -- * API- createRecipient- , createRecipientByCard- , createRecipientByToken- , createRecipientByBank- , createRecipientBase- , getRecipient- , getRecipientExpandable- , getRecipients- , getRecipientsExpandable- , updateRecipientName- , updateRecipientTaxID- , updateRecipientBankAccount- , updateRecipientTokenID- , updateRecipientDefaultCard- , updateRecipientEmail- , updateRecipientDescription- , updateRecipientMetaData- , updateRecipientBase- , deleteRecipient- -- * Types- , Recipient (..)- , RecipientId (..)- , FirstName (..)- , LastName (..)- , MiddleInitial- , RecipientType (..)- , TaxID- , BankAccount (..)- , TokenId- , CardNumber- , ExpMonth- , Email (..)- , ExpYear- , CVC- , Description- , Limit- , StripeDeleteResult (..)- , RoutingNumber (..)- , AccountNumber (..)- , Country (..)- , AddressCity (..)- , AddressCountry (..)- , AddressLine1 (..)- , AddressLine2 (..)- , AddressState (..)- , AddressZip (..)- , BankAccountId (..)- , BankAccountStatus (..)- ) where--import Data.Monoid ((<>))-import qualified Data.Text as T--import Web.Stripe.Client.Internal (callAPI, Method(POST,GET,DELETE), Stripe,- StripeRequest(..), toMetaData, getParams,- toText, toExpandable, (</>))-import Web.Stripe.Types (AccountNumber (..),- BankAccount (..), CVC, CVC (..), - CardId (..), CardNumber, BankAccountId (..), BankAccountStatus(..),- CardNumber (..), Country (..),- Description, Email, Email (..),- ExpMonth, ExpMonth (..), ExpYear,- RoutingNumber (..), AccountNumber (..),- Country (..), AddressCity (..),- AddressCountry (..), AddressLine1 (..),- AddressLine2 (..), AddressState (..),- AddressZip (..), ExpYear (..),- FirstName (..), LastName (..), Limit,- MiddleInitial, Recipient (..),- RecipientId (..), ExpandParams,- RecipientType (..), StripeDeleteResult(..),- RoutingNumber (..), EndingBefore, StartingAfter,- StripeList (..), TaxID, TokenId,- TokenId (..), MetaData)-import Web.Stripe.Types.Util (getRecipientId)----------------------------------------------------------------------------------- | Base Request for issues create `Recipient` requests-createRecipientBase- :: FirstName -- ^ First Name of `Recipient`- -> LastName -- ^ Last Name of `Recipient`- -> Maybe MiddleInitial -- ^ Middle Initial of `Recipient`- -> RecipientType -- ^ `Individual` or `Corporation`- -> Maybe TaxID -- ^ SSN for `Individual`, EIN for `Corporation`- -> Maybe Country -- ^ `Country` of BankAccount to attach to `Recipient`- -> Maybe RoutingNumber -- ^ `RoutingNumber` of BankAccount to attach to `Recipient`- -> Maybe AccountNumber -- ^ `AccountNumber` of BankAccount to attach to `Recipient`- -> Maybe TokenId -- ^ `TokenId` of `Card` or `BankAccount` to attach to a `Recipient`- -> Maybe CardNumber -- ^ `CardNumber` to attach to `Card` of `Recipient`- -> Maybe ExpMonth -- ^ Expiration Month of `Card`- -> Maybe ExpYear -- ^ Expiration Year of `Card`- -> Maybe CVC -- ^ CVC of Card- -> Maybe Email -- ^ Create `Email` with `Recipient`- -> Maybe Description -- ^ Create `Description` with `Recipient`- -> MetaData -- ^ The `MetaData` associated with the `Recipient`- -> Stripe Recipient-createRecipientBase- (FirstName firstName)- (LastName lastName)- middleInitial- recipienttype- taxId- country- routingNumber- accountNumber- tokenId- cardNumber- expMonth- expYear- cvc- email- description- metadata = callAPI request- where request = StripeRequest POST url params- url = "recipients"- params =- let name = firstName <> middle <> lastName- middle = maybe " " (\x -> " " <> T.singleton x <> " ") middleInitial- in toMetaData metadata ++ getParams [- ("name", Just name)- , ("type", toText `fmap` Just recipienttype)- , ("tax_id", taxId)- , ("bank_account[country]", (\(Country x) -> x) `fmap` country)- , ("bank_account[routing_number]", (\(RoutingNumber x ) -> x) `fmap` routingNumber)- , ("bank_account[account_number]", (\(AccountNumber x ) -> x) `fmap` accountNumber)- , ("card", (\(TokenId x) -> x) `fmap` tokenId)- , ("card[number]", (\(CardNumber x) -> x) `fmap` cardNumber)- , ("card[exp_month]", (\(ExpMonth x) -> toText x) `fmap` expMonth)- , ("card[exp_year]", (\(ExpYear x) -> toText x) `fmap` expYear)- , ("card[cvc]", (\(CVC x) -> x) `fmap` cvc)- , ("email", (\(Email x) -> x) `fmap` email)- , ("description", description)- ]---------------------------------------------------------------------------------- | Create a `Recipient`-createRecipient- :: FirstName -- ^ First Name of 'Recipient'- -> LastName -- ^ Last Name of 'Recipient'- -> Maybe MiddleInitial -- ^ Middle Initial of 'Recipient'- -> RecipientType -- ^ 'Individual' or 'Corporation'- -> Stripe Recipient-createRecipient- firstName- lastName- middleInitial- recipienttype- = createRecipientBase firstName lastName middleInitial recipienttype- Nothing Nothing Nothing Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing []---------------------------------------------------------------------------------- | Create a `Recipient` by a `Card`-createRecipientByCard- :: FirstName -- ^ First Name of 'Recipient'- -> LastName -- ^ Last Name of 'Recipient'- -> Maybe MiddleInitial -- ^ Middle Initial of 'Recipient'- -> RecipientType -- ^ 'Individual' or 'Corporation'- -> CardNumber -- ^ 'Card' Number- -> ExpMonth -- ^ Expiration Month- -> ExpYear -- ^ Expiration Year- -> CVC -- ^ 'CVC' (i.e. 117)- -> Stripe Recipient-createRecipientByCard- firstName- lastName- middleInitial- recipienttype- cardNumber- expMonth- expYear- cvc- = createRecipientBase firstName lastName middleInitial recipienttype- Nothing Nothing Nothing Nothing Nothing (Just cardNumber) (Just expMonth) - (Just expYear) (Just cvc) Nothing Nothing []----------------------------------------------------------------------------------- | Create a `Recipient` by specifying a `TokenId`-createRecipientByToken- :: FirstName -- ^ First Name of `Recipient`- -> LastName -- ^ Last Name of `Recipient`- -> Maybe MiddleInitial -- ^ Middle Initial of `Recipient`- -> RecipientType -- ^ `Individual` or `Corporation`- -> TokenId -- ^ `TokenId` received from stripe.js or Token API- -> Stripe Recipient-createRecipientByToken- firstName- lastName- middleInitial- recipienttype- tokenId- = createRecipientBase firstName lastName middleInitial recipienttype- Nothing Nothing Nothing Nothing (Just tokenId) Nothing Nothing- Nothing Nothing Nothing Nothing []----------------------------------------------------------------------------------- | Create a `Recipient` with a `BankAccount`-createRecipientByBank- :: FirstName -- ^ First Name of `Recipient`- -> LastName -- ^ Last Name of `Recipient`- -> Maybe MiddleInitial -- ^ Middle Initial of `Recipient`- -> RecipientType -- ^ `Individual` or `Corporation`- -> Country -- ^ `Country` of BankAccount to attach to `Recipient`- -> RoutingNumber -- ^ `RoutingNumber` of BankAccount to attach to `Recipient`- -> AccountNumber -- ^ `AccountNumber` of BankAccount to attach to `Recipient`- -> Stripe Recipient-createRecipientByBank- firstName- lastName- middleInitial- recipienttype- country- routingNumber- accountNumber- = createRecipientBase firstName lastName middleInitial recipienttype- Nothing (Just country) (Just routingNumber) (Just accountNumber) Nothing Nothing- Nothing Nothing Nothing Nothing Nothing []----------------------------------------------------------------------------------- | Retrieve a 'Recipient'-getRecipient- :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be retrieved- -> Stripe Recipient-getRecipient- recipientid = getRecipientExpandable recipientid []----------------------------------------------------------------------------------- | Retrieve a `Recipient`-getRecipientExpandable- :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be retrieved- -> ExpandParams -- ^ `ExpandParams` of the object to be expanded- -> Stripe Recipient-getRecipientExpandable- recipientid- expandParams = callAPI request- where request = StripeRequest GET url params- url = "recipients" </> getRecipientId recipientid- params = toExpandable expandParams----------------------------------------------------------------------------------- | Retrieve multiple 'Recipient's-getRecipients- :: Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter RecipientId -- ^ Paginate starting after the following `RecipientId`- -> EndingBefore RecipientId -- ^ Paginate ending before the following `RecipientId`- -> Stripe (StripeList Recipient)-getRecipients- limit- startingAfter- endingBefore =- getRecipientsExpandable- limit startingAfter endingBefore []----------------------------------------------------------------------------------- | Retrieve multiple 'Recipient's with `ExpandParams`-getRecipientsExpandable- :: Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter RecipientId -- ^ Paginate starting after the following `RecipientId`- -> EndingBefore RecipientId -- ^ Paginate ending before the following `RecipientId`- -> ExpandParams -- ^ `ExpandParams` of the object to be expanded- -> Stripe (StripeList Recipient)-getRecipientsExpandable- limit- startingAfter- endingBefore- expandParams = callAPI request- where request = StripeRequest GET url params- url = "recipients"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(RecipientId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(RecipientId x) -> x) `fmap` endingBefore)- ] ++ toExpandable expandParams------------------------------------------------------------------------------------ | Base Request for updating a `Recipient`, useful for creating custom `Recipient` update functions-updateRecipientBase- :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated- -> Maybe FirstName -- ^ First Name of `Recipient`- -> Maybe LastName -- ^ Last Name of `Recipient`- -> Maybe MiddleInitial -- ^ Middle Initial of `Recipient`- -> Maybe TaxID -- ^ SSN for `Individual`, EIN for `Corporation`- -> Maybe Country -- ^ `Country` of BankAccount to attach to `Recipient`- -> Maybe RoutingNumber -- ^ `RoutingNumber` of BankAccount to attach to `Recipient`- -> Maybe AccountNumber -- ^ `AccountNumber` of BankAccount to attach to `Recipient`- -> Maybe TokenId -- ^ `TokenId` of `Card` to attach to a `Recipient`- -> Maybe CardNumber -- ^ `CardNumber` to attach to `Card` of `Recipient`- -> Maybe ExpMonth -- ^ Expiration Month of `Card`- -> Maybe ExpYear -- ^ Expiration Year of `Card`- -> Maybe CVC -- ^ CVC of Card- -> Maybe CardId -- ^ The Default `Card` for this `Recipient` to use- -> Maybe Email -- ^ Create `Email` with `Recipient`- -> Maybe Description -- ^ Create `Description` with `Recipient`- -> MetaData -- ^ The `MetaData` associated with the `Recipient`- -> Stripe Recipient-updateRecipientBase- recipientid- firstName- lastName- middleInitial- taxId- country- routingNumber- accountNumber- tokenId- cardNumber- expMonth- expYear- cvc- cardId- email- description- metadata = callAPI request- where request = StripeRequest POST url params- url = "recipients" </> getRecipientId recipientid- params =- let name = if firstName == Nothing || lastName == Nothing- then Nothing- else do let Just (FirstName f) = firstName- Just (LastName l) = lastName- middle = maybe " " (\x -> " " <> T.singleton x <> " ") middleInitial- Just $ f <> middle <> l- in getParams [- ("name", name)- , ("tax_id", taxId)- , ("bank_account[country]", (\(Country x) -> x) `fmap` country)- , ("bank_account[routing_number]", (\(RoutingNumber x ) -> x) `fmap` routingNumber)- , ("bank_account[account_number]", (\(AccountNumber x ) -> x) `fmap` accountNumber)- , ("card", (\(TokenId x) -> x) `fmap` tokenId)- , ("card[number]", (\(CardNumber x) -> x) `fmap` cardNumber)- , ("card[exp_month]", (\(ExpMonth x) -> toText x) `fmap` expMonth)- , ("card[exp_year]", (\(ExpYear x) -> toText x) `fmap` expYear)- , ("card[cvc]", (\(CVC x) -> x) `fmap` cvc)- , ("default_card", (\(CardId x) -> x) `fmap` cardId)- , ("email", (\(Email x) -> x) `fmap` email)- , ("description", description)- ] ++ toMetaData metadata----------------------------------------------------------------------------------- | Update a `Recipient` `FirstName`, `LastName` and/or `MiddleInitial`-updateRecipientName- :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated- -> FirstName -- ^ First Name of `Recipient`- -> LastName -- ^ Last Name of `Recipient`- -> MiddleInitial -- ^ Middle Initial of `Recipient`- -> Stripe Recipient-updateRecipientName- recipientid- firstName- lastName- middleInitial = updateRecipientBase- recipientid (Just firstName) (Just lastName) (Just middleInitial)- Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing []----------------------------------------------------------------------------------- | Update a 'Recipient' 'BankAccount'-updateRecipientBankAccount- :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated- -> Country -- ^ `Country` of BankAccount to attach to `Recipient`- -> RoutingNumber -- ^ `RoutingNumber` of BankAccount to attach to `Recipient`- -> AccountNumber -- ^ `AccountNumber` of BankAccount to attach to `Recipient`- -> Stripe Recipient-updateRecipientBankAccount- recipientid- country- routingNumber- accountNumber- = updateRecipientBase- recipientid Nothing Nothing Nothing- Nothing (Just country) (Just routingNumber)- (Just accountNumber) Nothing Nothing- Nothing Nothing Nothing Nothing- Nothing Nothing []----------------------------------------------------------------------------------- | Update a `Recipient` `TaxID`-updateRecipientTaxID- :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated- -> TaxID -- ^ `TaxID` of `Recipient` to be updated- -> Stripe Recipient-updateRecipientTaxID- recipientid- taxID = updateRecipientBase- recipientid Nothing Nothing Nothing- (Just taxID) Nothing Nothing Nothing- Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing []----------------------------------------------------------------------------------- | Update a `Recipient` `Card` by `TokenId`-updateRecipientTokenID- :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated- -> TokenId -- ^ `TaxID` of `Recipient` to be updated- -> Stripe Recipient-updateRecipientTokenID- recipientid- tokenId = updateRecipientBase- recipientid Nothing Nothing Nothing- Nothing Nothing Nothing Nothing (Just tokenId) Nothing- Nothing Nothing Nothing Nothing Nothing Nothing []------------------------------------------------------------------------------------ | Update default `Card` of `Recipient`-updateRecipientDefaultCard- :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated- -> CardId -- ^ `CardId` of `Card` to be made default- -> Stripe Recipient-updateRecipientDefaultCard- recipientid- cardId = updateRecipientBase- recipientid Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing- (Just cardId) Nothing Nothing []----------------------------------------------------------------------------------- | Update a `Recipient` `Email` Address-updateRecipientEmail- :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated- -> Email -- ^ `Email` of `Recipient` to be updated- -> Stripe Recipient-updateRecipientEmail- recipientid- email = updateRecipientBase- recipientid Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing- Nothing (Just email) Nothing []----------------------------------------------------------------------------------- | Update a `Recipient` `Description`-updateRecipientDescription- :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated- -> Description -- ^ `Description` of `Recipient` to be updated- -> Stripe Recipient-updateRecipientDescription- recipientid- description = updateRecipientBase- recipientid Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing- Nothing Nothing (Just description) []----------------------------------------------------------------------------------- | Update a `Recipient` `MetaData`-updateRecipientMetaData- :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated- -> MetaData -- ^ The `MetaData` associated with the `Recipient`- -> Stripe Recipient-updateRecipientMetaData- recipientid- metadata = updateRecipientBase- recipientid Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing- Nothing Nothing Nothing Nothing- Nothing Nothing Nothing metadata----------------------------------------------------------------------------------- | Delete a `Recipient`-deleteRecipient- :: RecipientId -- ^ `RecipiendId` of `Recipient` to delete- -> Stripe StripeDeleteResult-deleteRecipient- recipientid = callAPI request- where request = StripeRequest DELETE url params- url = "recipients" </> getRecipientId recipientid- params = []
− src/Web/Stripe/Refund.hs
@@ -1,157 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}----------------------------------------------- |--- Module : Web.Stripe.Refund--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#refunds >------ @--- import Web.Stripe --- import Web.Stripe.Customer--- import Web.Stripe.Charge--- import Web.Stripe.Refund------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- credit = CardNumber "4242424242424242"--- em = ExpMonth 12--- ey = ExpYear 2015--- cvc = CVC "123"--- result <- stripe config $ do--- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc--- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing--- createRefund chid ([] :: MetaData)--- case result of--- Right refund -> print refund--- Left stripeError -> print stripeError--- @-module Web.Stripe.Refund- ( -- * API- createRefund- , getRefund- , getRefundExpandable- , getRefunds- , getRefundsExpandable- , updateRefund- -- * Types- , Refund (..)- , RefundId (..)- , ChargeId (..)- , Charge (..)- , StripeList (..)- ) where--import Web.Stripe.Client.Internal (Method (GET, POST), Stripe,- StripeRequest (..), callAPI,- getParams, toMetaData, toText,- (</>), toExpandable)-import Web.Stripe.Types (Charge (..), ChargeId (..),- EndingBefore, Limit, MetaData,- Refund (..), Refund (..),- RefundId (..), StartingAfter, ExpandParams,- StripeList (..))-import Web.Stripe.Types.Util (getChargeId)----------------------------------------------------------------------------------- | `Refund` a `Charge`-createRefund- :: ChargeId -- ^ `ChargeId` associated with the `Charge` to be refunded- -> MetaData -- ^ `MetaData` associated with a `Refund`- -> Stripe Refund-createRefund- chargeid- metadata = callAPI request- where request = StripeRequest POST url params- url = "charges" </> getChargeId chargeid </> "refunds"- params = toMetaData metadata----------------------------------------------------------------------------------- | Retrieve a `Refund` by `ChargeId` and `RefundId`-getRefund- :: ChargeId -- ^ `ChargeId` associated with the `Refund` to be retrieved- -> RefundId -- ^ `RefundId` associated with the `Refund` to be retrieved- -> Stripe Refund-getRefund- chargeid- (RefundId refundid) = callAPI request- where request = StripeRequest GET url params- url = "charges" </> getChargeId chargeid </> "refunds" </> refundid- params = []----------------------------------------------------------------------------------- | Retrieve a `Refund` by `ChargeId` and `RefundId` with `ExpandParams`-getRefundExpandable- :: ChargeId -- ^ `ChargeId` associated with the `Charge` to be retrieved- -> RefundId -- ^ `RefundId` associated with the `Refund` to be retrieved- -> ExpandParams -- ^ `ExpandParams` of object for expansion- -> Stripe Refund-getRefundExpandable- chargeid- (RefundId refundid)- expandParams = callAPI request- where request = StripeRequest GET url params- url = "charges" </> getChargeId chargeid </> "refunds" </> refundid- params = toExpandable expandParams----------------------------------------------------------------------------------- | Update a `Refund` by `ChargeId` and `RefundId`-updateRefund- :: ChargeId -- ^ `ChargeId` associated with the `Charge` to be updated- -> RefundId -- ^ `RefundId` associated with the `Refund` to be retrieved- -> MetaData -- ^ `MetaData` associated with a `Refund`- -> Stripe Refund-updateRefund- chargeid- (RefundId refid)- metadata = callAPI request- where request = StripeRequest POST url params- url = "charges" </> getChargeId chargeid </> "refunds" </> refid- params = toMetaData metadata----------------------------------------------------------------------------------- | Retrieve a lot of Refunds by `ChargeId`-getRefunds- :: ChargeId -- ^ `ChargeId` associated with the `Charge` to be updated- -> Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter RefundId -- ^ Paginate starting after the following `RefundId`- -> EndingBefore RefundId -- ^ Paginate ending before the following `RefundId`- -> Stripe (StripeList Refund)-getRefunds- chargeid- limit- startingAfter- endingBefore =- getRefundsExpandable chargeid- limit startingAfter endingBefore []----------------------------------------------------------------------------------- | Retrieve a lot of Refunds by `ChargeId` with `ExpandParams`-getRefundsExpandable- :: ChargeId -- ^ `ChargeId` associated with the `Charge` to be updated- -> Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter RefundId -- ^ Paginate starting after the following `RefundId`- -> EndingBefore RefundId -- ^ Paginate ending before the following `RefundId`- -> ExpandParams -- ^ `MetaData` associated with a `Refund`- -> Stripe (StripeList Refund)-getRefundsExpandable- chargeid- limit- startingAfter- endingBefore- expandParams = callAPI request- where request = StripeRequest GET url params- url = "charges" </> getChargeId chargeid </> "refunds"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(RefundId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(RefundId x) -> x) `fmap` endingBefore)- ] ++ toExpandable expandParams---
− src/Web/Stripe/Subscription.hs
@@ -1,184 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Subscription--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#subscriptions >------ @--- import Web.Stripe --- import Web.Stripe.Subscription--- import Web.Stripe.Customer--- import Web.Stripe.Plan------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config $ do--- Customer { customerId = cid } <- createEmptyCustomer--- Plan { planId = pid } <- createPlan (PlanId "free plan")--- (0 :: Amount) -- free plan--- (USD :: Currency)--- (Month :: Inteval)--- ("sample plan" :: Name)--- ([] :: MetaData)--- createSubscription cid pid ([] :: MetaData)--- case result of--- Right subscription -> print subscription--- Left stripeError -> print stripeError--- @-module Web.Stripe.Subscription- ( -- * API- createSubscription- , getSubscription- , getSubscriptionExpandable- , getSubscriptions- , getSubscriptionsExpandable- , updateSubscription- , cancelSubscription- -- * Types- , Subscription (..)- , SubscriptionId (..)- , SubscriptionStatus (..)- , CustomerId (..)- , CouponId (..)- , Coupon (..)- , PlanId (..)- , StripeList (..)- ) where--import Web.Stripe.Client.Internal (Method (GET, POST, DELETE), Stripe,- StripeRequest (..), callAPI,- getParams, toExpandable,- toMetaData, toText, (</>))-import Web.Stripe.Types (CustomerId (..), EndingBefore,- ExpandParams, Limit, MetaData,- PlanId (..), StartingAfter, CouponId(..),- Subscription (..), StripeList(..),- SubscriptionId (..), Coupon(..),- SubscriptionStatus (..))-import Web.Stripe.Types.Util (getCustomerId)----------------------------------------------------------------------------------- | Create a `Subscription` by `CustomerId` and `PlanId`-createSubscription- :: CustomerId -- ^ The `CustomerId` upon which to create the `Subscription`- -> PlanId -- ^ The `PlanId` to associate the `Subscription` with- -> MetaData -- ^ The `MetaData` associated with the `Subscription`- -> Stripe Subscription-createSubscription- customerid- (PlanId planid)- metadata = callAPI request- where request = StripeRequest POST url params- url = "customers" </> getCustomerId customerid </> "subscriptions"- params = toMetaData metadata ++ getParams [ ("plan", Just planid) ]----------------------------------------------------------------------------------- | Retrieve a `Subscription` by `CustomerId` and `SubscriptionId`-getSubscription- :: CustomerId -- ^ The `CustomerId` of the `Subscription`- -> SubscriptionId -- ^ The `SubscriptionId` of the `Subscription` to retrieve- -> Stripe Subscription-getSubscription- customerid- subscriptionid =- getSubscriptionExpandable- customerid subscriptionid []----------------------------------------------------------------------------------- | Retrieve a `Subscription` by `CustomerId` and `SubscriptionId` with `ExpandParams`-getSubscriptionExpandable- :: CustomerId -- ^ The `CustomerId` of the `Subscription` to retrieve- -> SubscriptionId -- ^ The `SubscriptionId` of the `Subscription` to retrieve- -> ExpandParams -- ^ The `ExpandParams` of the object to expand- -> Stripe Subscription-getSubscriptionExpandable- customerid- (SubscriptionId subscriptionid)- expandParams = callAPI request- where request = StripeRequest GET url params- url = "customers" </> getCustomerId customerid </> "subscriptions" </> subscriptionid- params = toExpandable expandParams----------------------------------------------------------------------------------- | Retrieve active `Subscription`s-getSubscriptions- :: CustomerId -- ^ The `CustomerId` of the `Subscription`s to retrieve- -> Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter SubscriptionId -- ^ Paginate starting after the following `CustomerId`- -> EndingBefore SubscriptionId -- ^ Paginate ending before the following `CustomerId`- -> Stripe (StripeList Subscription)-getSubscriptions- customerid- limit- startingAfter- endingBefore =- getSubscriptionsExpandable customerid limit- startingAfter endingBefore []----------------------------------------------------------------------------------- | Retrieve active `Subscription`s-getSubscriptionsExpandable- :: CustomerId -- ^ The `CustomerId` of the `Subscription`s to retrieve- -> Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter SubscriptionId -- ^ Paginate starting after the following `CustomerId`- -> EndingBefore SubscriptionId -- ^ Paginate ending before the following `CustomerId`- -> ExpandParams -- ^ The `ExpandParams` of the object to expand- -> Stripe (StripeList Subscription)-getSubscriptionsExpandable- customerid- limit- startingAfter- endingBefore- expandParams = callAPI request- where request = StripeRequest GET url params- url = "customers" </> getCustomerId customerid </> "subscriptions"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(SubscriptionId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(SubscriptionId x) -> x) `fmap` endingBefore)- ] ++ toExpandable expandParams----------------------------------------------------------------------------------- | Update a `Subscription` by `CustomerId` and `SubscriptionId`-updateSubscription- :: CustomerId -- ^ The `CustomerId` of the `Subscription` to update- -> SubscriptionId -- ^ The `SubscriptionId` of the `Subscription` to update- -> Maybe CouponId -- ^ Optional: The `Coupon` of the `Subscription` to update- -> Maybe PlanId -- ^ Optional: The id `Plan` to switch the `Subscription` to- -> MetaData- -> Stripe Subscription-updateSubscription- customerid- (SubscriptionId subscriptionid)- couponid- planid- metadata = callAPI request- where request = StripeRequest POST url params- url = "customers" </> getCustomerId customerid </> "subscriptions" </> subscriptionid- params = toMetaData metadata ++ getParams [- ("coupon", (\(CouponId x) -> x) `fmap` couponid)- , ("plan", (\(PlanId x) -> x) `fmap` planid)- ]----------------------------------------------------------------------------------- | Delete a `Subscription` by `CustomerId` and `SubscriptionId`-cancelSubscription- :: CustomerId -- ^ The `CustomerId` of the `Subscription` to cancel- -> SubscriptionId -- ^ The `SubscriptionId` of the `Subscription` to cancel- -> Bool -- ^ Flag set to true will delay cancellation until end of current period, default `False`- -> Stripe Subscription-cancelSubscription- customerid- (SubscriptionId subscriptionid)- atPeriodEnd- = callAPI request- where request = StripeRequest DELETE url params- url = "customers" </> getCustomerId customerid </> "subscriptions" </> subscriptionid- params = getParams [ ("at_period_end", Just $ toText atPeriodEnd) ]-
− src/Web/Stripe/Token.hs
@@ -1,126 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Token--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#tokens >------ @--- import Web.Stripe --- import Web.Stripe.Token------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- credit = CardNumber "4242424242424242"--- em = ExpMonth 12--- ey = ExpYear 2015--- cvc = CVC "123"--- result <- stripe config $ createCardToken cn em ey cvc--- case result of--- Right token -> print token--- Left stripeError -> print stripeError--- @-module Web.Stripe.Token- ( -- * API- createCardToken- , createBankAccountToken- , getCardToken- , getBankAccountToken- -- * Types- , CardNumber (..)- , ExpMonth (..)- , ExpYear (..)- , CVC (..)- , Token (..)- , TokenId (..)- , TokenType (..)- , Country (..)- , RoutingNumber (..)- , AccountNumber (..)- , Account (..)- ) where--import Web.Stripe.Client.Internal (Method (GET, POST), Stripe,- StripeRequest (..), callAPI,- getParams, toText, (</>))-import Web.Stripe.Types (Account(..), AccountNumber (..),- CVC (..), CardNumber (..), - Country (..), ExpMonth (..), BankAccount(..),- ExpYear (..), RoutingNumber (..), Card(..),- Token (..), TokenId (..), TokenType(..))----------------------------------------------------------------------------------- | Create a `Token` by specifiying Credit `Card` information-createCardToken- :: CardNumber -- ^ Card Number- -> ExpMonth -- ^ Card Expiration Month- -> ExpYear -- ^ Card Expiration Year- -> CVC -- ^ Card CVC- -> Stripe (Token Card)-createCardToken- (CardNumber number)- (ExpMonth month)- (ExpYear year)- (CVC cvc)- = callAPI request- where request = StripeRequest POST url params- url = "tokens"- params = getParams [- ("card[number]", Just number)- , ("card[exp_month]", toText `fmap` Just month)- , ("card[exp_year]", toText `fmap` Just year)- , ("card[cvc]", Just cvc)- ]----------------------------------------------------------------------------------- | Create a `Token` for a specific `BankAccount`-createBankAccountToken- :: Country -- ^ Country of the `BankAccount` `Token` to retrieve- -> RoutingNumber -- ^ Routing Number- -> AccountNumber -- ^ Account Number- -> Stripe (Token BankAccount)-createBankAccountToken- (Country country)- (RoutingNumber routingNumber)- (AccountNumber accountNumber)- = callAPI request- where request = StripeRequest POST url params- url = "tokens"- params = getParams [- ("bank_account[country]", Just country)- , ("bank_account[routing_number]", Just routingNumber)- , ("bank_account[account_number]", Just accountNumber)- ]----------------------------------------------------------------------------------- | Retrieve a `Token` by `TokenId`-getCardToken - :: TokenId -- ^ The `TokenId` of the `Card` `Token` to retrieve- -> Stripe (Token Card)-getCardToken (TokenId token) = callAPI request- where request = StripeRequest GET url params- url = "tokens" </> token- params = []----------------------------------------------------------------------------------- | Retrieve a `Token` by `TokenId`-getBankAccountToken- :: TokenId -- ^ The `TokenId` of the `BankAccount` `Token` to retrieve- -> Stripe (Token BankAccount)-getBankAccountToken (TokenId token) = callAPI request- where request = StripeRequest GET url params- url = "tokens" </> token- params = []--------
− src/Web/Stripe/Transfer.hs
@@ -1,163 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}----------------------------------------------- |--- Module : Web.Stripe.Transfer--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX------ < https:/\/\stripe.com/docs/api#transfers >------ @--- import Web.Stripe --- import Web.Stripe.Transfer--- import Web.Stripe.Recipient------ main :: IO ()--- main = do--- let config = SecretKey "secret_key"--- result <- stripe config $ do--- Recipient { recipientId = recipientid } <- getRecipient (RecipientId "recipient_id")--- createTransfer recipientid (100 :: Amount) USD ([] :: MetaData)--- case result of--- Right transfer -> print transfer--- Left stripeError -> print stripeError--- @-module Web.Stripe.Transfer- ( -- * API- createTransfer- , getTransfer- , getTransferExpandable- , getTransfers- , getTransfersExpandable- , updateTransfer- , cancelTransfer- -- * Types- , Transfer (..)- , TransferId (..)- , TransferStatus (..)- , TransferType (..)- , RecipientId (..)- , Recipient (..)- , StripeList (..)- , Currency (..)- , Amount- , Limit- ) where--import Web.Stripe.Client.Internal (Method (GET, POST), Stripe,- StripeRequest (..), callAPI,- getParams, toExpandable, toTextLower,- toMetaData, toText, (</>))-import Web.Stripe.Types (Amount, Currency (..),- EndingBefore, ExpandParams, Limit,- MetaData, RecipientId (..), Recipient(..),- StartingAfter, StripeList (..),- Transfer (..), TransferId (..),- TransferStatus (..),Description,- TransferType (..))-import Web.Stripe.Types.Util (getRecipientId)----------------------------------------------------------------------------------- | Create a `Transfer`-createTransfer- :: RecipientId -- ^ The `RecipientId` of the `Recipient` who will receive the `Transfer`- -> Amount -- ^ The `Amount` of money to transfer to the `Recipient`- -> Currency -- ^ The `Currency` in which to perform the `Transfer`- -> MetaData -- ^ The `MetaData` associated with the Transfer- -> Stripe Transfer-createTransfer- recipientid- amount- currency- metadata = callAPI request- where request = StripeRequest POST url params- url = "transfers"- params = toMetaData metadata ++ getParams [- ("amount", toText `fmap` Just amount)- , ("currency", toTextLower `fmap` Just currency)- , ("recipient", getRecipientId `fmap` Just recipientid)- ]----------------------------------------------------------------------------------- | Retrieve a `Transfer`-getTransfer- :: TransferId -- ^ `TransferId` associated with the `Transfer` to retrieve- -> Stripe Transfer-getTransfer transferid =- getTransferExpandable transferid []----------------------------------------------------------------------------------- | Retrieve a `Transfer` with `ExpandParams`-getTransferExpandable- :: TransferId -- ^ `TransferId` associated with the `Transfer` to retrieve- -> ExpandParams -- ^ The `ExpandParams` of the object to be expanded- -> Stripe Transfer-getTransferExpandable- (TransferId transferid)- expandParams = callAPI request- where request = StripeRequest GET url params- url = "transfers" </> transferid- params = toExpandable expandParams----------------------------------------------------------------------------------- | Retrieve StripeList of `Transfers`-getTransfers- :: Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter TransferId -- ^ Paginate starting after the following `TransferId`- -> EndingBefore TransferId -- ^ Paginate ending before the following `TransferId`- -> Stripe (StripeList Transfer)-getTransfers- limit- startingAfter- endingBefore =- getTransfersExpandable limit startingAfter endingBefore []----------------------------------------------------------------------------------- | Retrieve StripeList of `Transfers` with `ExpandParams`-getTransfersExpandable- :: Limit -- ^ Defaults to 10 if `Nothing` specified- -> StartingAfter TransferId -- ^ Paginate starting after the following `TransferId`- -> EndingBefore TransferId -- ^ Paginate ending before the following `TransferId`- -> ExpandParams -- ^ The `ExpandParams` of the object to be expanded- -> Stripe (StripeList Transfer)-getTransfersExpandable- limit- startingAfter- endingBefore- expandParams = callAPI request- where request = StripeRequest GET url params- url = "transfers"- params = getParams [- ("limit", toText `fmap` limit )- , ("starting_after", (\(TransferId x) -> x) `fmap` startingAfter)- , ("ending_before", (\(TransferId x) -> x) `fmap` endingBefore)- ] ++ toExpandable expandParams----------------------------------------------------------------------------------- | Update a `Transfer`-updateTransfer- :: TransferId -- ^ The `TransferId` of the `Transfer` to update- -> Maybe Description -- ^ The `Description` of the `Transfer` to update- -> MetaData -- ^ The `MetaData` of the `Transfer` to update- -> Stripe Transfer-updateTransfer- (TransferId transferid)- description- metadata = callAPI request- where request = StripeRequest POST url params- url = "transfers" </> transferid- params = toMetaData metadata ++ getParams [- ("description", description)- ] ----------------------------------------------------------------------------------- | Cancel a `Transfer`-cancelTransfer- :: TransferId -- ^ The `TransferId` of the `Transfer` to cancel- -> Stripe Transfer-cancelTransfer (TransferId transferid) = callAPI request- where request = StripeRequest POST url params- url = "transfers" </> transferid </> "cancel"- params = []
− src/Web/Stripe/Types.hs
@@ -1,2205 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}--- |--- Module : Web.Stripe.Types--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX-module Web.Stripe.Types where--import Control.Applicative (pure, (<$>), (<*>), (<|>))-import Control.Monad (mzero)-import Data.Aeson (FromJSON (parseJSON),- Value (String, Object, Bool), (.:),- (.:?))-import qualified Data.HashMap.Strict as H-import Data.Text (Text)-import Data.Time (UTCTime)-import Web.Stripe.Client.Internal (fromSeconds)----------------------------------------------------------------------------------- | `ChargeId` associated with a `Charge`-data ChargeId- = ChargeId Text- | ExpandedCharge Charge- deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `ChargeId`-instance FromJSON ChargeId where- parseJSON (String x) = pure $ ChargeId x- parseJSON o@(Object _) = ExpandedCharge <$> parseJSON o- parseJSON _ = mzero----------------------------------------------------------------------------------- | `StatementDescription` to be added to a `Charge`-newtype StatementDescription =- StatementDescription Text deriving (Show, Eq)----------------------------------------------------------------------------------- | `Charge` object in `Stripe` API-data Charge = Charge {- chargeId :: ChargeId- , chargeObject :: Text- , chargeCreated :: UTCTime- , chargeLiveMode :: Bool- , chargePaid :: Bool- , chargeAmount :: Int- , chargeCurrency :: Currency- , chargeRefunded :: Bool- , chargeCreditCard :: Card- , chargeCaptured :: Bool- , chargeRefunds :: StripeList Refund- , chargeBalanceTransaction :: Maybe TransactionId- , chargeFailureMessage :: Maybe Text- , chargeFailureCode :: Maybe Text- , chargeAmountRefunded :: Int- , chargeCustomerId :: Maybe CustomerId- , chargeInvoice :: Maybe InvoiceId- , chargeDescription :: Maybe Description- , chargeDispute :: Maybe Dispute- , chargeMetaData :: MetaData- , chargeStatementDescription :: Maybe Description- , chargeReceiptEmail :: Maybe Text- , chargeReceiptNumber :: Maybe Text- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Charge`-instance FromJSON Charge where- parseJSON (Object o) =- Charge <$> (ChargeId <$> o .: "id")- <*> o .: "object"- <*> (fromSeconds <$> o .: "created")- <*> o .: "livemode"- <*> o .: "paid"- <*> o .: "amount"- <*> o .: "currency"- <*> o .: "refunded"- <*> o .: "card"- <*> o .: "captured"- <*> o .: "refunds"- <*> ((fmap TransactionId <$> o .:? "balance_transaction")- <|> (fmap ExpandedTransaction <$> o .:? "balance_transaction"))- <*> o .:? "failure_message"- <*> o .:? "failure_code"- <*> o .: "amount_refunded"- <*> ((fmap CustomerId <$> o .:? "customer")- <|> (fmap ExpandedCustomer <$> o .:? "customer"))- <*> ((fmap InvoiceId <$> o .:? "invoice")- <|> (fmap ExpandedInvoice <$> o .:? "invoice"))- <*> o .:? "description"- <*> o .:? "dispute"- <*> (H.toList <$> o .: "metadata")- <*> o .:? "statement_description"- <*> o .:? "receipt_email"- <*> o .:? "receipt_number"- parseJSON _ = mzero----------------------------------------------------------------------------------- | Capture for `Charge`-type Capture = Bool----------------------------------------------------------------------------------- | `RefundId` for `Refund`-newtype RefundId =- RefundId Text deriving (Eq, Show)----------------------------------------------------------------------------------- | `Refund` Object-data Refund = Refund {- refundId :: RefundId- , refundAmount :: Int- , refundCurrency :: Currency- , refundCreated :: UTCTime- , refundObject :: Text- , refundCharge :: ChargeId- , refundBalanceTransaction :: TransactionId- , refundMetaData :: MetaData- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Refund`-instance FromJSON Refund where- parseJSON (Object o) =- Refund <$> (RefundId <$> o .: "id")- <*> o .: "amount"- <*> o .: "currency"- <*> (fromSeconds <$> o .: "created")- <*> o .: "object"- <*> (ChargeId <$> o .: "charge")- <*> ((TransactionId <$> o .: "balance_transaction")- <|> (ExpandedTransaction <$> o .: "balance_transaction"))- <*> (H.toList <$> o .: "metadata")- parseJSON _ = mzero----------------------------------------------------------------------------------- | `CustomerId` for a `Customer`-data CustomerId =- CustomerId Text |- ExpandedCustomer Customer- deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `CustomerId`-instance FromJSON CustomerId where- parseJSON (String x) = pure (CustomerId x)- parseJSON v@(Object _) = ExpandedCustomer <$> parseJSON v- parseJSON _ = mzero----------------------------------------------------------------------------------- | `Customer` object-data Customer = Customer {- customerObject :: Text- , customerCreated :: UTCTime- , customerId :: CustomerId- , customerLiveMode :: Bool- , customerDescription :: Maybe Description- , customerEmail :: Maybe Email- , customerDelinquent :: Bool- , customerSubscriptions :: StripeList Subscription- , customerDiscount :: Maybe Discount- , customerAccountBalance :: Int- , customerCards :: StripeList Card- , customerCurrency :: Maybe Currency- , customerDefaultCard :: Maybe CardId- , customerMetaData :: MetaData- } | DeletedCustomer {- deletedCustomer :: Maybe Bool- , deletedCustomerId :: CustomerId- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Customer`-instance FromJSON Customer where- parseJSON (Object o)- = (Customer- <$> o .: "object"- <*> (fromSeconds <$> o .: "created")- <*> (CustomerId <$> o .: "id")- <*> o .: "livemode"- <*> o .:? "description"- <*> (fmap Email <$> o .:? "email")- <*> o .: "delinquent"- <*> o .: "subscriptions"- <*> o .:? "discount"- <*> o .: "account_balance"- <*> o .: "cards"- <*> o .:? "currency"- <*> ((fmap CardId <$> o .:? "default_card")- <|> (fmap ExpandedCard <$> o .:? "default_card"))- <*> (H.toList <$> o .: "metadata")- <|> DeletedCustomer- <$> o .: "deleted"- <*> (CustomerId <$> o .: "id"))- <|> DeletedCustomer- <$> o .:? "deleted"- <*> (CustomerId <$> o .: "id")- parseJSON _ = mzero----------------------------------------------------------------------------------- | AccountBalance for a `Customer`-type AccountBalance = Int----------------------------------------------------------------------------------- | CardId for a `Customer`-data CardId = CardId Text- | ExpandedCard Card- deriving (Eq, Show)----------------------------------------------------------------------------------- | CardId for a `Recipient`-data RecipientCardId = RecipientCardId Text- | ExpandedRecipientCard RecipientCard- deriving (Eq, Show)----------------------------------------------------------------------------------- | JSON Instance for `CardId`-instance FromJSON CardId where- parseJSON o@(Object _) = ExpandedCard <$> parseJSON o- parseJSON (String x) = pure $ CardId x- parseJSON _ = mzero----------------------------------------------------------------------------------- | Number associated with a `Card`-newtype CardNumber = CardNumber Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Expiration Month for a `Card`-newtype ExpMonth = ExpMonth Int deriving (Show, Eq)----------------------------------------------------------------------------------- | Expiration Year for a `Card`-newtype ExpYear = ExpYear Int deriving (Show, Eq)----------------------------------------------------------------------------------- | CVC for a `Card`-newtype CVC = CVC Text deriving (Show, Eq)----------------------------------------------------------------------------------- | City address for a `Card`-newtype AddressCity = AddressCity Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Country address for a `Card`-newtype AddressCountry = AddressCountry Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Address Line One for a `Card`-newtype AddressLine1 = AddressLine1 Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Address Line Two for a `Card`-newtype AddressLine2 = AddressLine2 Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Address State for a `Card`-newtype AddressState = AddressState Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Address Zip Code for a `Card`-newtype AddressZip = AddressZip Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Credit / Debit Card Brand-data Brand = Visa- | AMEX- | MasterCard- | Discover- | JCB- | DinersClub- | Unknown- deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Brand`-instance FromJSON Brand where- parseJSON (String "American Express") = pure AMEX- parseJSON (String "MasterCard") = pure MasterCard- parseJSON (String "Discover") = pure Discover- parseJSON (String "JCB") = pure JCB- parseJSON (String "Visa") = pure Visa- parseJSON (String "DinersClub") = pure DinersClub- parseJSON _ = mzero----------------------------------------------------------------------------------- | `Card` Object-data Card = Card {- cardId :: CardId- , cardObject :: Text- , cardLastFour :: Text- , cardBrand :: Brand- , cardFunding :: Text- , cardExpMonth :: ExpMonth- , cardExpYear :: ExpYear- , cardFingerprint :: Text- , cardCountry :: Text- , cardName :: Maybe Name- , cardAddressLine1 :: Maybe AddressLine1- , cardAddressLine2 :: Maybe AddressLine2- , cardAddressCity :: Maybe AddressCity- , cardAddressState :: Maybe AddressState- , cardAddressZip :: Maybe AddressZip- , cardAddressCountry :: Maybe AddressCountry- , cardCVCCheck :: Maybe Text- , cardAddressLine1Check :: Maybe Text- , cardAddressZipCheck :: Maybe Text- , cardCustomerId :: Maybe CustomerId- } deriving (Show, Eq)----------------------------------------------------------------------------------- | `RecipientCard` object-data RecipientCard = RecipientCard {- recipientCardId :: RecipientCardId- , recipientCardLastFour :: Text- , recipientCardBrand :: Brand- , recipientCardFunding :: Text- , recipientCardExpMonth :: ExpMonth- , recipientCardExpYear :: ExpYear- , recipientCardFingerprint :: Text- , recipientCardCountry :: Country- , recipientCardName :: Maybe Name- , recipientCardAddressLine1 :: Maybe AddressLine1- , recipientCardAddressLine2 :: Maybe AddressLine2- , recipientCardAddressCity :: Maybe AddressCity- , recipientCardAddressState :: Maybe AddressState- , recipientCardAddressZip :: Maybe AddressZip- , recipientCardAddressCountry :: Maybe AddressCountry- , recipientCardCVCCheck :: Maybe Text- , recipientCardAddressLine1Check :: Maybe Text- , recipientCardAddressZipCheck :: Maybe Text- , recipientCardRecipientId :: Maybe RecipientId-} deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Card`-instance FromJSON Card where- parseJSON (Object o) =- Card <$> (CardId <$> o .: "id")- <*> o .: "object"- <*> o .: "last4"- <*> o .: "brand"- <*> o .: "funding"- <*> (ExpMonth <$> o .: "exp_month")- <*> (ExpYear <$> o .: "exp_year")- <*> o .: "fingerprint"- <*> o .: "country"- <*> o .:? "name"- <*> (fmap AddressLine1 <$> o .:? "address_line1")- <*> (fmap AddressLine2 <$> o .:? "address_line2")- <*> (fmap AddressCity <$> o .:? "address_city")- <*> (fmap AddressState <$> o .:? "address_state")- <*> (fmap AddressZip <$> o .:? "address_zip")- <*> (fmap AddressCountry <$> o .:? "address_country")- <*> o .:? "cvc_check"- <*> o .:? "address_line1_check"- <*> o .:? "address_zip_check"- <*> ((fmap CustomerId <$> o .:? "customer")- <|> (fmap ExpandedCustomer <$> o .:? "customer"))- parseJSON _ = mzero----------------------------------------------------------------------------------- | JSON Instance for `RecipientCard`-instance FromJSON RecipientCard where- parseJSON (Object o) =- RecipientCard- <$> (RecipientCardId <$> o .: "id")- <*> o .: "last4"- <*> o .: "brand"- <*> o .: "funding"- <*> (ExpMonth <$> o .: "exp_month")- <*> (ExpYear <$> o .: "exp_year")- <*> o .: "fingerprint"- <*> (Country <$> o .: "country")- <*> o .:? "name"- <*> (fmap AddressLine1 <$> o .:? "address_line1")- <*> (fmap AddressLine2 <$> o .:? "address_line2")- <*> (fmap AddressCity <$> o .:? "address_city")- <*> (fmap AddressState <$> o .:? "address_state")- <*> (fmap AddressZip <$> o .:? "address_zip")- <*> (fmap AddressCountry <$> o .:? "address_country")- <*> o .:? "cvc_check"- <*> o .:? "address_line1_check"- <*> o .:? "address_zip_check"- <*> ((fmap RecipientId <$> o .:? "recipient")- <|> (fmap ExpandedRecipient <$> o .:? "recipient"))- parseJSON _ = mzero----------------------------------------------------------------------------------- | `SubscriptionId` for a `Subscription`-newtype SubscriptionId =- SubscriptionId Text- deriving (Show, Eq)----------------------------------------------------------------------------------- | Subscription Object-data Subscription = Subscription {- subscriptionId :: SubscriptionId- , subscriptionPlan :: Plan- , subscriptionObject :: Text- , subscriptionStart :: UTCTime- , subscriptionStatus :: SubscriptionStatus- , subscriptionCustomerId :: CustomerId- , subscriptionCancelAtPeriodEnd :: Bool- , subscriptionCurrentPeriodStart :: UTCTime- , subscriptionCurrentPeriodEnd :: UTCTime- , subscriptionEndedAt :: Maybe UTCTime- , subscriptionTrialStart :: Maybe UTCTime- , subscriptionTrialEnd :: Maybe UTCTime- , subscriptionCanceledAt :: Maybe UTCTime- , subscriptionQuantity :: Quantity- , subscriptionApplicationFeePercent :: Maybe Double- , subscriptionDiscount :: Maybe Discount- , subscriptionMetaData :: MetaData-} deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Subscription`-instance FromJSON Subscription where- parseJSON (Object o) =- Subscription <$> (SubscriptionId <$> o .: "id")- <*> o .: "plan"- <*> o .: "object"- <*> (fromSeconds <$> o .: "start")- <*> o .: "status"- <*> ((CustomerId <$> o .: "customer")- <|> (ExpandedCustomer <$> o .: "customer"))- <*> o .: "cancel_at_period_end"- <*> (fromSeconds <$> o .: "current_period_start")- <*> (fromSeconds <$> o .: "current_period_end")- <*> (fmap fromSeconds <$> o .:? "ended_at")- <*> (fmap fromSeconds <$> o .:? "trial_start")- <*> (fmap fromSeconds <$> o .:? "trial_end")- <*> (fmap fromSeconds <$> o .:? "canceled_at")- <*> (Quantity <$> o .: "quantity")- <*> o .:? "application_fee_percent"- <*> o .:? "discount"- <*> (H.toList <$> o .: "metadata")- parseJSON _ = mzero----------------------------------------------------------------------------------- | Status of a `Subscription`-data SubscriptionStatus =- Trialing- | Active- | PastDue- | Canceled- | UnPaid- deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `SubscriptionStatus`-instance FromJSON SubscriptionStatus where- parseJSON (String "trialing") = pure Trialing- parseJSON (String "active") = pure Active- parseJSON (String "past_due") = pure PastDue- parseJSON (String "canceled") = pure Canceled- parseJSON (String "unpaid") = pure UnPaid- parseJSON _ = mzero----------------------------------------------------------------------------------- | `PlanId` for a `Plan`-newtype PlanId = PlanId Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Plan object-data Plan = Plan {- planInterval :: Interval- , planName :: Text- , planCreated :: UTCTime- , planAmount :: Int- , planCurrency :: Currency- , planId :: PlanId- , planObject :: Text- , planLiveMode :: Bool- , planIntervalCount :: Maybe Int -- optional, max of 1 year intervals allowed, default 1- , planTrialPeriodDays :: Maybe Int- , planMetaData :: MetaData- , planDescription :: Maybe Description-} deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Plan`-instance FromJSON Plan where- parseJSON (Object o) =- Plan <$> o .: "interval"- <*> o .: "name"- <*> (fromSeconds <$> o .: "created")- <*> o .: "amount"- <*> o .: "currency"- <*> (PlanId <$> o .: "id")- <*> o .: "object"- <*> o .: "livemode"- <*> o .:? "interval_count"- <*> o .:? "trial_period_days"- <*> (H.toList <$> o .: "metadata")- <*> o .:? "statement_description"- parseJSON _ = mzero----------------------------------------------------------------------------------- | `TrialPeriod` for a Plan-newtype TrialPeriod = TrialPeriod UTCTime deriving (Show, Eq)----------------------------------------------------------------------------------- | Interval for `Plan`s-data Interval = Day | Week | Month | Year deriving Eq----------------------------------------------------------------------------------- | JSON Instance for `Interval`-instance FromJSON Interval where- parseJSON (String "day") = pure Day- parseJSON (String "week") = pure Week- parseJSON (String "month") = pure Month- parseJSON (String "year") = pure Year- parseJSON _ = mzero----------------------------------------------------------------------------------- | `Show` instance for `Interval`-instance Show Interval where- show Day = "day"- show Week = "week"- show Month = "month"- show Year = "year"----------------------------------------------------------------------------------- | `Coupon` Duration-data Duration = Forever | Once | Repeating deriving Eq----------------------------------------------------------------------------------- | `Show` instance for `Duration`-instance Show Duration where- show Forever = "forever"- show Once = "once"- show Repeating = "repeating"----------------------------------------------------------------------------------- | JSON Instance for `Duration`-instance FromJSON Duration where- parseJSON (String x)- | x == "forever" = pure Forever- | x == "once" = pure Once- | x == "repeating" = pure Repeating- parseJSON _ = mzero----------------------------------------------------------------------------------- | `Coupon` Object-data Coupon = Coupon {- couponId :: CouponId- , couponCreated :: UTCTime- , couponPercentOff :: Maybe Int- , couponAmountOff :: Maybe Int- , couponCurrency :: Maybe Currency- , couponLiveMode :: Bool- , couponDuration :: Duration- , couponRedeemBy :: Maybe UTCTime- , couponMaxRedemptions :: Maybe Int- , couponTimesRedeemed :: Maybe Int- , couponDurationInMonths :: Maybe Int- , couponValid :: Bool- , couponMetaData :: MetaData- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Coupon`-instance FromJSON Coupon where- parseJSON (Object o) =- Coupon <$> (CouponId <$> o .: "id")- <*> (fromSeconds <$> o .: "created")- <*> o .: "percent_off"- <*> o .:? "amount_off"- <*> o .:? "currency"- <*> o .: "livemode"- <*> o .: "duration"- <*> (fmap fromSeconds <$> o .:? "redeem_by")- <*> o .:? "max_redemptions"- <*> o .:? "times_redeemed"- <*> o .:? "duration_in_months"- <*> o .: "valid"- <*> (H.toList <$> o .: "metadata")- parseJSON _ = mzero----------------------------------------------------------------------------------- | `CouponId` for a `Coupon`-newtype CouponId = CouponId Text deriving (Show, Eq)----------------------------------------------------------------------------------- | `AmountOff` for a `Coupon`-newtype AmountOff = AmountOff Int deriving (Show, Eq)----------------------------------------------------------------------------------- | `MaxRedemptions` for a `Coupon`-newtype MaxRedemptions = MaxRedemptions Int deriving (Show, Eq)----------------------------------------------------------------------------------- | `PercentOff` for a `Coupon`-newtype PercentOff = PercentOff Int deriving (Show, Eq)----------------------------------------------------------------------------------- | `RedeemBy` date for a `Coupon`-newtype RedeemBy = RedeemBy UTCTime deriving (Show, Eq)----------------------------------------------------------------------------------- | `DurationInMonths` for a `Coupon`-newtype DurationInMonths = DurationInMonths Int deriving (Show, Eq)----------------------------------------------------------------------------------- | `IntervalCount` for a `Coupon`-newtype IntervalCount = IntervalCount Int deriving (Show, Eq)----------------------------------------------------------------------------------- | `TrialPeriodDays` for a `Coupon`-newtype TrialPeriodDays = TrialPeriodDays Int deriving (Show, Eq)----------------------------------------------------------------------------------- | Amount representing a monetary value.--- Stripe represents pennies as whole numbers--- i.e. 100 = $1-type Amount = Int----------------------------------------------------------------------------------- | `Discount` for `Coupon`-data Discount = Discount {- discountCoupon :: Coupon- , discountStart :: UTCTime- , discountEnd :: Maybe UTCTime- , discountCustomer :: CustomerId- , discountObject :: Text- , discountSubscription :: Maybe SubscriptionId-} deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Discount`-instance FromJSON Discount where- parseJSON (Object o) =- Discount <$> o .: "coupon"- <*> (fromSeconds <$> o .: "start")- <*> (fmap fromSeconds <$> o .:? "end")- <*> ((CustomerId <$> o .: "customer")- <|> (ExpandedCustomer <$> o .: "customer"))- <*> o .: "object"- <*> (fmap SubscriptionId <$> o .:? "subscription")- parseJSON _ = mzero----------------------------------------------------------------------------------- | `Invoice` for a `Coupon`-data InvoiceId =- InvoiceId Text- | ExpandedInvoice Invoice- deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `InvoiceId`-instance FromJSON InvoiceId where- parseJSON (String x) = pure $ InvoiceId x- parseJSON o@(Object _) = ExpandedInvoice <$> parseJSON o- parseJSON _ = mzero----------------------------------------------------------------------------------- | `Invoice` Object-data Invoice = Invoice {- invoiceDate :: UTCTime- , invoiceId :: Maybe InvoiceId -- ^ If upcoming no ID will exist- , invoicePeriodStart :: UTCTime- , invoicePeriodEnd :: UTCTime- , invoiceLineItems :: StripeList InvoiceLineItem- , invoiceSubTotal :: Int- , invoiceTotal :: Int- , invoiceCustomer :: CustomerId- , invoiceObject :: Text- , invoiceAttempted :: Bool- , invoiceClosed :: Bool- , invoiceForgiven :: Bool- , invoicePaid :: Bool- , invoiceLiveMode :: Bool- , invoiceAttemptCount :: Int- , invoiceAmountDue :: Int- , invoiceCurrency :: Currency- , invoiceStartingBalance :: Int- , invoiceEndingBalance :: Maybe Int- , invoiceNextPaymentAttempt :: Maybe UTCTime- , invoiceWebHooksDeliveredAt :: Maybe UTCTime- , invoiceCharge :: Maybe ChargeId- , invoiceDiscount :: Maybe Discount- , invoiceApplicateFee :: Maybe FeeId- , invoiceSubscription :: Maybe SubscriptionId- , invoiceStatementDescription :: Maybe Description- , invoiceDescription :: Maybe Description- , invoiceMetaData :: MetaData-} deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Invoice`-instance FromJSON Invoice where- parseJSON (Object o) =- Invoice <$> (fromSeconds <$> o .: "date")- <*> (fmap InvoiceId <$> o .:? "id")- <*> (fromSeconds <$> o .: "period_start")- <*> (fromSeconds <$> o .: "period_end")- <*> o .: "lines"- <*> o .: "subtotal"- <*> o .: "total"- <*> ((CustomerId <$> o .: "customer")- <|> (ExpandedCustomer <$> o .: "customer"))- <*> o .: "object"- <*> o .: "attempted"- <*> o .: "closed"- <*> o .: "forgiven"- <*> o .: "paid"- <*> o .: "livemode"- <*> o .: "attempt_count"- <*> o .: "amount_due"- <*> o .: "currency"- <*> o .: "starting_balance"- <*> o .:? "ending_balance"- <*> (fmap fromSeconds <$> o .:? "next_payment_attempt")- <*> (fmap fromSeconds <$> o .: "webhooks_delivered_at")- <*> ((fmap ChargeId <$> o .:? "charge")- <|> (fmap ExpandedCharge <$> o .:? "charge"))- <*> o .:? "discount"- <*> (fmap FeeId <$> o .:? "application_fee")- <*> (fmap SubscriptionId <$> o .: "subscription")- <*> o .:? "statement_description"- <*> o .:? "description"- <*> (H.toList <$> o .: "metadata")- parseJSON _ = mzero----------------------------------------------------------------------------------- | `InvoiceItemId` for `InvoiceItem`-data InvoiceItemId- = InvoiceItemId Text- | ExpandedInvoiceItem InvoiceItem- deriving (Eq, Show)----------------------------------------------------------------------------------- | `InvoiceItem` object-data InvoiceItem = InvoiceItem {- invoiceItemObject :: Text- , invoiceItemId :: InvoiceItemId- , invoiceItemDate :: UTCTime- , invoiceItemAmount :: Int- , invoiceItemLiveMode :: Bool- , invoiceItemProration :: Bool- , invoiceItemCurrency :: Currency- , invoiceItemCustomer :: CustomerId- , invoiceItemDescription :: Maybe Description- , invoiceItemInvoice :: Maybe InvoiceId- , invoiceItemQuantity :: Maybe Quantity- , invoiceItemSubscription :: Maybe Subscription- , invoiceItemMetaData :: MetaData- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `InvoiceItem`-instance FromJSON InvoiceItem where- parseJSON (Object o) =- InvoiceItem <$> o .: "object"- <*> (InvoiceItemId <$> o .: "id")- <*> (fromSeconds <$> o .: "date")- <*> o .: "amount"- <*> o .: "livemode"- <*> o .: "proration"- <*> o .: "currency"- <*> ((CustomerId <$> o .: "customer")- <|> (ExpandedCustomer <$> o .: "customer"))- <*> o .:? "description"- <*> ((fmap InvoiceId <$> o .:? "invoice")- <|> (fmap ExpandedInvoice <$> o .:? "invoice"))- <*> (fmap Quantity <$> o .:? "quantity")- <*> o .:? "subscription"- <*> (H.toList <$> o .: "metadata")- parseJSON _ = mzero----------------------------------------------------------------------------------- | `InvoiceLineItemId` for an `InvoiceLineItem`-newtype InvoiceLineItemId =- InvoiceLineItemId Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Type of `InvoiceItem`-data InvoiceLineItemType- = InvoiceItemType |- SubscriptionItemType- deriving (Show,Eq)----------------------------------------------------------------------------------- | JSON Instance for `InvoiceLineItemType`-instance FromJSON InvoiceLineItemType where- parseJSON (String "invoiceitem") = pure InvoiceItemType- parseJSON (String "subscription") = pure SubscriptionItemType- parseJSON _ = mzero----------------------------------------------------------------------------------- | `InvoiceLineItem` Object-data InvoiceLineItem = InvoiceLineItem {- invoiceLineItemId :: InvoiceLineItemId- , invoiceLineItemObject :: Text- , invoiceLineItemType :: InvoiceLineItemType- , invoiceLineItemLiveMode :: Bool- , invoiceLineItemAmount :: Int- , invoiceLineItemCurrency :: Currency- , invoiceLineItemProration :: Bool- , invoiceLineItemPeriod :: Period- , invoiceLineItemQuantity :: Maybe Quantity- , invoiceLineItemPlan :: Maybe Plan- , invoiceLineItemDescription :: Maybe Description- , invoiceLineItemMetaData :: MetaData- } deriving (Show, Eq)----------------------------------------------------------------------------------- | Period for an `InvoiceLineItem`-data Period = Period {- start :: UTCTime- , end :: UTCTime- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Period`-instance FromJSON Period where- parseJSON (Object o) =- Period <$> (fromSeconds <$> o .: "start")- <*> (fromSeconds <$> o .: "end")- parseJSON _ = mzero----------------------------------------------------------------------------------- | JSON Instance for `InvoiceLineItem`-instance FromJSON InvoiceLineItem where- parseJSON (Object o) =- InvoiceLineItem <$> (InvoiceLineItemId <$> o .: "id")- <*> o .: "object"- <*> o .: "type"- <*> o .: "livemode"- <*> o .: "amount"- <*> o .: "currency"- <*> o .: "proration"- <*> o .: "period"- <*> (fmap Quantity <$> o .:? "quantity")- <*> o .:? "plan"- <*> o .:? "description"- <*> (H.toList <$> o .: "metadata")- parseJSON _ = mzero----------------------------------------------------------------------------------- | Status of a `Dispute`-data DisputeStatus- = WarningNeedsResponse- | WarningUnderReview- | NeedsResponse- | UnderReview- | ChargeRefunded- | Won- | Lost- deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `DisputeReason`-instance FromJSON DisputeReason where- parseJSON (String "duplicate") = pure Duplicate- parseJSON (String "fraudulent") = pure Fraudulent- parseJSON (String "subscription_canceled") = pure SubscriptionCanceled- parseJSON (String "product_unacceptable") = pure ProductUnacceptable- parseJSON (String "product_not_received") = pure ProductNotReceived- parseJSON (String "credit_not_processed") = pure CreditNotProcessed- parseJSON (String "general") = pure General- parseJSON _ = mzero----------------------------------------------------------------------------------- | Reason of a `Dispute`-data DisputeReason- = Duplicate- | Fraudulent- | SubscriptionCanceled- | ProductUnacceptable- | ProductNotReceived- | Unrecognized- | CreditNotProcessed- | General- deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `DisputeStatus`-instance FromJSON DisputeStatus where- parseJSON (String "needs_response") = pure NeedsResponse- parseJSON (String "warning_needs_response") = pure WarningNeedsResponse- parseJSON (String "warning_under_review") = pure WarningUnderReview- parseJSON (String "under_review") = pure UnderReview- parseJSON (String "charge_refunded") = pure ChargeRefunded- parseJSON (String "won") = pure Won- parseJSON (String "lost") = pure Lost- parseJSON _ = mzero----------------------------------------------------------------------------------- | `Dispute` Object-data Dispute = Dispute {- disputeChargeId :: 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- } deriving (Show, Eq)----------------------------------------------------------------------------------- | `Evidence` associated with a `Dispute`-newtype Evidence = Evidence Text deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Dispute`-instance FromJSON Dispute where- parseJSON (Object o) =- Dispute <$> ((ChargeId <$> o .: "charge")- <|> (ExpandedCharge <$> o .: "charge"))- <*> o .: "amount"- <*> (fromSeconds <$> o .: "created")- <*> o .: "status"- <*> o .: "livemode"- <*> o .: "currency"- <*> o .: "object"- <*> o .: "reason"- <*> o .: "is_charge_refundable"- <*> o .: "balance_transactions"- <*> (fromSeconds <$> o .: "evidence_due_by")- <*> (fmap Evidence <$> o .:? "evidence")- <*> (H.toList <$> o .: "metadata")- parseJSON _ = mzero----------------------------------------------------------------------------------- | `TransferId`-newtype TransferId =- TransferId Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Status of a `Transfer`-data TransferStatus =- TransferPaid- | TransferPending- | TransferCanceled- | TransferFailed- deriving (Show, Eq)----------------------------------------------------------------------------------- | Type of a `Transfer`-data TransferType =- CardTransfer- | BankAccountTransfer- deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `TransferType`-instance FromJSON TransferType where- parseJSON (String "card") = pure CardTransfer- parseJSON (String "bank_account") = pure BankAccountTransfer- parseJSON _ = mzero----------------------------------------------------------------------------------- | JSON Instance for `TransferStatus`-instance FromJSON TransferStatus where- parseJSON (String "paid") = pure TransferPaid- parseJSON (String "pending") = pure TransferPending- parseJSON (String "canceled") = pure TransferCanceled- parseJSON _ = mzero----------------------------------------------------------------------------------- | `Transfer` Object-data Transfer = Transfer {- transferId :: TransferId- , transferObject :: Text- , transferCreated :: UTCTime- , transferDate :: UTCTime- , transferLiveMode :: Bool- , transferAmount :: Int- , transferCurrency :: Currency- , transferStatus :: TransferStatus- , transferType :: TransferType- , transferBalanceTransaction :: TransactionId- , transferDescription :: Maybe Description- , transferBankAccount :: Maybe BankAccount- , transferFailureMessage :: Maybe Text- , transferFailureCode :: Maybe Text- , transferStatementDescription :: Maybe Description- , transferRecipient :: Maybe RecipientId- , transferMetaData :: MetaData-} deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Transfer`-instance FromJSON Transfer where- parseJSON (Object o) =- Transfer <$> (TransferId <$> o .: "id")- <*> o .: "object"- <*> (fromSeconds <$> o .: "created")- <*> (fromSeconds <$> o .: "date")- <*> o .: "livemode"- <*> o .: "amount"- <*> o .: "currency"- <*> o .: "status"- <*> o .: "type"- <*> ((TransactionId <$> o .: "balance_transaction")- <|> (ExpandedTransaction <$> o .: "balance_transaction"))- <*> o .:? "description"- <*> o .:? "bank_account"- <*> o .:? "failure_message"- <*> o .:? "failure_code"- <*> o .:? "statement_description"- <*> ((fmap RecipientId <$> o .:? "recipient")- <|> (fmap ExpandedRecipient <$> o .:? "recipient"))- <*> (H.toList <$> o .: "metadata")- parseJSON _ = mzero----------------------------------------------------------------------------------- | `BankAccount` Object-data BankAccount = BankAccount {- bankAccountId :: BankAccountId- , bankAccountObject :: Text- , bankAccountLast4 :: Text- , bankAccountCountry :: Country- , bankAccountCurrency :: Currency- , bankAccountStatus :: Maybe BankAccountStatus- , bankAccountFingerprint :: Maybe Text- , bankAccountName :: Text-} deriving (Show, Eq)----------------------------------------------------------------------------------- | `BankAccount` JSON Instance-instance FromJSON BankAccount where- parseJSON (Object o) =- BankAccount <$> (BankAccountId <$> o .: "id")- <*> o .: "object"- <*> o .: "last4"- <*> (Country <$> o .: "country")- <*> o .: "currency"- <*> o .:? "status"- <*> o .:? "fingerprint"- <*> o .: "bank_name"- parseJSON _ = mzero----------------------------------------------------------------------------------- | `BankAccountId` for `BankAccount`-newtype BankAccountId = BankAccountId Text- deriving (Show, Eq)----------------------------------------------------------------------------------- | `BankAccountStatus` Object-data BankAccountStatus =- New | Validated | Verified | Errored- deriving (Show, Eq)----------------------------------------------------------------------------------- | `BankAccountStatus` JSON instance-instance FromJSON BankAccountStatus where- parseJSON (String "new") = pure $ New- parseJSON (String "validated") = pure Validated- parseJSON (String "verified") = pure Verified- parseJSON (String "errored") = pure Errored- parseJSON _ = mzero----------------------------------------------------------------------------------- | Routing Number for Bank Account-newtype RoutingNumber =- RoutingNumber Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Country -newtype Country =- Country Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Account Number of a Bank Account-newtype AccountNumber =- AccountNumber Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Recipients----------------------------------------------------------------------------------- | `FirstName` of a `Recipient`-newtype FirstName = FirstName Text deriving (Show, Eq)----------------------------------------------------------------------------------- | `LastName` of a `Recipient`-newtype LastName = LastName Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Middle Initial of a `Recipient`-type MiddleInitial = Char----------------------------------------------------------------------------------- | `RecipientId` for a `Recipient`-data RecipientId =- RecipientId Text- | ExpandedRecipient Recipient- deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `RecipientId`-instance FromJSON RecipientId where- parseJSON (String x) = pure $ RecipientId x- parseJSON o@(Object _) = ExpandedRecipient <$> parseJSON o- parseJSON _ = mzero----------------------------------------------------------------------------------- | `TaxID` of `Recipient`-type TaxID = Text----------------------------------------------------------------------------------- | Type of `Recipient`-data RecipientType =- Individual- | Corporation deriving Eq----------------------------------------------------------------------------------- | `Show` instance for `RecipientType`-instance Show RecipientType where- show Individual = "individual"- show Corporation = "corporation"----------------------------------------------------------------------------------- | JSON Instance for `RecipientType`-instance FromJSON RecipientType where- parseJSON (String "individual") = pure Individual- parseJSON (String "corporation") = pure Corporation- parseJSON _ = mzero----------------------------------------------------------------------------------- | Recipient Object-data Recipient = Recipient {- recipientId :: RecipientId- , recipientObject :: Text- , recipientCreated :: UTCTime- , recipientLiveMode :: Bool- , recipientType :: RecipientType- , recipientDescription :: Maybe Description- , recipientEmail :: Maybe Email- , recipientName :: Name- , recipientVerified :: Bool- , recipientActiveAccount :: Maybe BankAccount- , recipientCards :: StripeList RecipientCard- , recipientDefaultCard :: Maybe RecipientCardId- } | DeletedRecipient {- deletedRecipient :: Maybe Bool- , deletedRecipientId :: RecipientId- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Recipient`-instance FromJSON Recipient where- parseJSON (Object o) =- (Recipient <$> (RecipientId <$> o .: "id")- <*> o .: "object"- <*> (fromSeconds <$> o .: "created")- <*> o .: "livemode"- <*> o .: "type"- <*> o .:? "description"- <*> (fmap Email <$> o .:? "email")- <*> o .: "name"- <*> o .: "verified"- <*> o .:? "active_account"- <*> o .: "cards"- <*> ((fmap RecipientCardId <$> o .:? "default_card")- <|> (fmap ExpandedRecipientCard <$> o .:? "default_card")))- <|> DeletedRecipient- <$> o .:? "deleted"- <*> (RecipientId <$> o .: "id")- - parseJSON _ = mzero----------------------------------------------------------------------------------- | ApplicationFee Object-data ApplicationFee = ApplicationFee {- applicationFeeId :: Text- , applicationFeeObjecet :: Text- , applicationFeeCreated :: UTCTime- , applicationFeeLiveMode :: Bool- , applicationFeeAmount :: Int- , applicationFeeCurrency :: Currency- , applicationFeeRefunded :: Bool- , applicationFeeAmountRefunded :: Int- , applicationFeeRefunds :: StripeList Refund- , applicationFeeBalanceTransaction :: TransactionId- , applicationFeeAccountId :: AccountId- , applicationFeeApplicationId :: ApplicationId- , applicationFeeChargeId :: ChargeId- , applicationFeeMetaData :: MetaData-} deriving (Show, Eq)----------------------------------------------------------------------------------- | `ApplicationId` object-newtype ApplicationId =- ApplicationId Text deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `ApplicationFee`-instance FromJSON ApplicationFee where- parseJSON (Object o) =- ApplicationFee <$> o .: "id"- <*> o .: "object"- <*> (fromSeconds <$> o .: "created")- <*> o .: "livemode"- <*> o .: "amount"- <*> o .: "currency"- <*> o .: "refunded"- <*> o .: "amount_refunded"- <*> o .: "refunds"- <*> ((TransactionId <$> o .: "balance_transaction")- <|> (ExpandedTransaction <$> o .: "balance_transaction"))- <*> ((AccountId <$> o .: "account")- <|> (ExpandedAccount <$> o .: "account"))- <*> (ApplicationId <$> o .: "application")- <*> ((ChargeId <$> o .: "charge")- <|> (ExpandedCharge <$> o .: "charge"))- <*> (H.toList <$> o .: "metadata")- parseJSON _ = mzero----------------------------------------------------------------------------------- | `FeeId` for objects with Fees-newtype FeeId =- FeeId Text- deriving (Show, Eq)----------------------------------------------------------------------------------- | Application Fee Refunds-data ApplicationFeeRefund = ApplicationFeeRefund {- applicationFeeRefundId :: RefundId- , applicationFeeRefundAmount :: Int- , applicationFeeRefundCurrency :: Currency- , applicationFeeRefundCreated :: UTCTime- , applicationFeeRefundObject :: Text- , applicationFeeRefundBalanceTransaction :: Maybe TransactionId- , applicationFeeRefundFee :: FeeId- , applicationFeeRefundMetaData :: MetaData- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `ApplicationFeeRefund`-instance FromJSON ApplicationFeeRefund where- parseJSON (Object o) = ApplicationFeeRefund- <$> (RefundId <$> o .: "id")- <*> o .: "amount"- <*> o .: "currency"- <*> (fromSeconds <$> o .: "created")- <*> o .: "object"- <*> ((fmap TransactionId <$> o .:? "balance_transaction")- <|> (fmap ExpandedTransaction <$> o .:? "balance_transaction"))- <*> (FeeId <$> o .: "fee")- <*> (H.toList <$> o .: "metadata")- parseJSON _ = mzero----------------------------------------------------------------------------------- | `AccountId` of an `Account`-data AccountId- = AccountId Text- | ExpandedAccount Account- deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `AccountId`-instance FromJSON AccountId where- parseJSON o@(Object _) = ExpandedAccount <$> parseJSON o- parseJSON (String aid) = pure $ AccountId aid- parseJSON _ = mzero----------------------------------------------------------------------------------- | `Account` Object-data Account = Account {- accountId :: AccountId- , accountEmail :: Email- , accountStatementDescriptor :: Maybe Description- , accountDisplayName :: Maybe Text- , accountTimeZone :: Text- , accountDetailsSubmitted :: Bool- , accountChargeEnabled :: Bool- , accountTransferEnabled :: Bool- , accountCurrenciesSupported :: [Currency]- , accountDefaultCurrency :: Currency- , accountCountry :: Text- , accountObject :: Text- , accountBusinessName :: Maybe Text- , accountBusinessURL :: Maybe Text- , accountBusinessLogo :: Maybe Text- , accountSupportPhone :: Maybe Text-} deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Account`-instance FromJSON Account where- parseJSON (Object o) =- Account <$> (AccountId <$> o .: "id")- <*> (Email <$> o .: "email")- <*> o .:? "statement_descriptor"- <*> o .: "display_name"- <*> o .: "timezone"- <*> o .: "details_submitted"- <*> o .: "charge_enabled"- <*> o .: "transfer_enabled"- <*> o .: "currencies_supported"- <*> o .: "default_currency"- <*> o .: "country"- <*> o .: "object"- <*> o .:? "business_name"- <*> o .:? "business_url"- <*> o .:? "business_logo"- <*> o .:? "support_phone"- parseJSON _ = mzero----------------------------------------------------------------------------------- | `Balance` Object-data Balance = Balance {- balancePending :: [BalanceAmount]- , balanceAvailable :: [BalanceAmount]- , balanceLiveMode :: Bool- , balanceObject :: Text- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Balance`-instance FromJSON Balance where- parseJSON (Object o) =- Balance <$> o .: "pending"- <*> o .: "available"- <*> o .: "livemode"- <*> o .: "object"- parseJSON _ = mzero----------------------------------------------------------------------------------- | `BalanceAmount` Object-data BalanceAmount = BalanceAmount {- balanceAmount :: Int- , balanceCurrency :: Currency- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `BalanceAmount`-instance FromJSON BalanceAmount where- parseJSON (Object o) =- BalanceAmount <$> o .: "amount"- <*> o .: "currency"- parseJSON _ = mzero----------------------------------------------------------------------------------- | `BalanceTransaction` Object-data BalanceTransaction = BalanceTransaction {- balanceTransactionId :: TransactionId- , balanceTransactionObject :: Text- , balanceTransactionAmount :: Amount- , balanceTransactionCurrency :: Currency- , balanceTransactionNet :: Int- , balanceTransactionType :: Text- , balanceTransactionCreated :: UTCTime- , balanceTransactionAvailableOn :: UTCTime- , balanceTransactionStatus :: Text- , balanceTransactionFee :: Int- , balanceTransactionFeeDetails :: [FeeDetails]- , balanceTransactionFeeSource :: ChargeId- , balanceTransactionFeeDescription :: Maybe Description- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `BalanceTransaction`-instance FromJSON BalanceTransaction where- parseJSON (Object o) =- BalanceTransaction <$> (TransactionId <$> o .: "id")- <*> o .: "object"- <*> o .: "amount"- <*> o .: "currency"- <*> o .: "net"- <*> o .: "type"- <*> (fromSeconds <$> o .: "created")- <*> (fromSeconds <$> o .: "available_on")- <*> o .: "status"- <*> o .: "fee"- <*> o .: "fee_details"- <*> ((ChargeId <$> o .: "source")- <|> (ExpandedCharge <$> o .: "source"))- <*> o .:? "description"- parseJSON _ = mzero----------------------------------------------------------------------------------- | `TransactionId` of a `Transaction`-data TransactionId = TransactionId Text- | ExpandedTransaction BalanceTransaction- deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `TransactionId`-instance FromJSON TransactionId where- parseJSON (String x) = pure (TransactionId x)- parseJSON v@(Object _) = ExpandedTransaction <$> parseJSON v- parseJSON _ = mzero----------------------------------------------------------------------------------- | `FeeDetails` Object-data FeeDetails = FeeDetails {- feeDetailsAmount :: Int- , feeDetailsCurrency :: Currency- , feeType :: Text- , feeDescription :: Maybe Description- , feeApplication :: Maybe Text-} deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `FeeDetails`-instance FromJSON FeeDetails where- parseJSON (Object o) =- FeeDetails <$> o .: "amount"- <*> o .: "currency"- <*> o .: "type"- <*> o .: "description"- <*> o .:? "application"- parseJSON _ = mzero----------------------------------------------------------------------------------- | `Event` Types-data EventType =- AccountUpdatedEvent- | AccountApplicationDeauthorizedEvent- | ApplicationFeeCreatedEvent- | ApplicationFeeRefundedEvent- | BalanceAvailableEvent- | ChargeSucceededEvent- | ChargeFailedEvent- | ChargeRefundedEvent- | ChargeCapturedEvent- | ChargeUpdatedEvent- | ChargeDisputeCreatedEvent- | ChargeDisputeUpdatedEvent- | ChargeDisputeClosedEvent- | ChargeDisputeFundsWithdrawnEvent- | ChargeDisputeFundsReinstatedEvent- | CustomerCreatedEvent- | CustomerUpdatedEvent- | CustomerDeletedEvent- | CustomerCardCreatedEvent- | CustomerCardUpdatedEvent- | CustomerCardDeletedEvent- | CustomerSubscriptionCreatedEvent- | CustomerSubscriptionUpdatedEvent- | CustomerSubscriptionDeletedEvent- | CustomerSubscriptionTrialWillEndEvent- | CustomerDiscountCreatedEvent- | CustomerDiscountUpdatedEvent- | CustomerDiscountDeletedEvent- | InvoiceCreatedEvent- | InvoiceUpdatedEvent- | InvoicePaymentSucceededEvent- | InvoicePaymentFailedEvent- | InvoiceItemCreatedEvent- | InvoiceItemUpdatedEvent- | InvoiceItemDeletedEvent- | PlanCreatedEvent- | PlanUpdatedEvent- | PlanDeletedEvent- | CouponCreatedEvent- | CouponUpdatedEvent- | CouponDeletedEvent- | RecipientCreatedEvent- | RecipientUpdatedEvent- | RecipientDeletedEvent- | TransferCreatedEvent- | TransferUpdatedEvent- | TransferCanceledEvent- | TransferPaidEvent- | TransferFailedEvent- | PingEvent- | UnknownEvent- deriving (Show, Eq)----------------------------------------------------------------------------------- | Event Types JSON Instance-instance FromJSON EventType where- parseJSON (String "account.updated") = pure AccountUpdatedEvent- parseJSON (String "account.application.deauthorized") = pure AccountApplicationDeauthorizedEvent- parseJSON (String "application_fee.created") = pure ApplicationFeeCreatedEvent- parseJSON (String "application_fee.refunded") = pure ApplicationFeeRefundedEvent- parseJSON (String "balance.available") = pure BalanceAvailableEvent- parseJSON (String "charge.succeeded") = pure ChargeSucceededEvent- parseJSON (String "chage.failed") = pure ChargeFailedEvent- parseJSON (String "charge.refunded") = pure ChargeRefundedEvent- parseJSON (String "charge.captured") = pure ChargeCapturedEvent- parseJSON (String "charge.updated") = pure ChargeUpdatedEvent- parseJSON (String "charge.dispute.created") = pure ChargeDisputeCreatedEvent- parseJSON (String "charge.dispute.updated") = pure ChargeDisputeUpdatedEvent- parseJSON (String "charge.dispute.closed") = pure ChargeDisputeClosedEvent- parseJSON (String "charge.dispute.funds_withdrawn") = pure ChargeDisputeFundsWithdrawnEvent- parseJSON (String "charge.dispute.funds_reinstated") = pure ChargeDisputeFundsReinstatedEvent- parseJSON (String "customer.created") = pure CustomerCreatedEvent- parseJSON (String "customer.updated") = pure CustomerUpdatedEvent- parseJSON (String "customer.deleted") = pure CustomerDeletedEvent- parseJSON (String "customer.card.created") = pure CustomerCardCreatedEvent- parseJSON (String "customer.card.updated") = pure CustomerCardUpdatedEvent- parseJSON (String "customer.card.deleted") = pure CustomerCardDeletedEvent- parseJSON (String "customer.subscription.created") = pure CustomerSubscriptionCreatedEvent- parseJSON (String "customer.subscription.updated") = pure CustomerSubscriptionUpdatedEvent- parseJSON (String "customer.subscription.deleted") = pure CustomerSubscriptionDeletedEvent- parseJSON (String "customer.subscription.trial_will_end") = pure CustomerSubscriptionTrialWillEndEvent- parseJSON (String "customer.discount.created") = pure CustomerDiscountCreatedEvent- parseJSON (String "customer.discount.updated") = pure CustomerDiscountUpdatedEvent- parseJSON (String "invoice.created") = pure InvoiceCreatedEvent- parseJSON (String "invoice.updated") = pure InvoiceUpdatedEvent- parseJSON (String "invoice.payment_succeeded") = pure InvoicePaymentSucceededEvent- parseJSON (String "invoice.payment_failed") = pure InvoicePaymentFailedEvent- parseJSON (String "invoiceitem.created") = pure InvoiceItemCreatedEvent- parseJSON (String "invoiceitem.updated") = pure InvoiceItemUpdatedEvent- parseJSON (String "invoiceitem.deleted") = pure InvoiceItemDeletedEvent- parseJSON (String "plan.created") = pure PlanCreatedEvent- parseJSON (String "plan.updated") = pure PlanUpdatedEvent- parseJSON (String "plan.deleted") = pure PlanDeletedEvent- parseJSON (String "coupon.created") = pure CouponCreatedEvent- parseJSON (String "coupon.updated") = pure CouponUpdatedEvent- parseJSON (String "coupon.deleted") = pure CouponDeletedEvent- parseJSON (String "recipient.created") = pure RecipientCreatedEvent- parseJSON (String "recipient.updated") = pure RecipientUpdatedEvent- parseJSON (String "recipient.deleted") = pure RecipientDeletedEvent- parseJSON (String "transfer.created") = pure TransferCreatedEvent- parseJSON (String "transfer.updated") = pure TransferUpdatedEvent- parseJSON (String "transfer.canceled") = pure TransferCanceledEvent- parseJSON (String "transfer.paid") = pure TransferPaidEvent- parseJSON (String "transfer.failed") = pure TransferFailedEvent- parseJSON (String "ping") = pure PingEvent- parseJSON _ = pure UnknownEvent----------------------------------------------------------------------------------- | `EventId` of an `Event`-newtype EventId = EventId Text deriving (Show, Eq)----------------------------------------------------------------------------------- | EventData-data EventData =- TransferEvent Transfer- | AccountEvent Account- | AccountApplicationEvent ConnectApp- | ApplicationFeeEvent ApplicationFee- | InvoiceEvent Invoice- | PlanEvent Plan- | RecipientEvent Recipient- | CouponEvent Coupon- | BalanceEvent Balance- | ChargeEvent Charge- | DisputeEvent Dispute- | CustomerEvent Customer- | CardEvent Card- | SubscriptionEvent Subscription- | DiscountEvent Discount- | InvoiceItemEvent InvoiceItem- | UnknownEventData- | Ping - deriving (Show, Eq)----------------------------------------------------------------------------------- | `Event` Object-data Event = Event {- eventId :: Maybe EventId- , eventCreated :: UTCTime- , eventLiveMode :: Bool- , eventType :: EventType- , eventData :: EventData- , eventObject :: Text- , eventPendingWebHooks :: Int- , eventRequest :: Maybe Text-} deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Event`-instance FromJSON Event where- parseJSON (Object o) = do- eventId <- fmap EventId <$> o .:? "id"- eventCreated <- fromSeconds <$> o .: "created"- eventLiveMode <- o .: "livemode"- eventType <- o .: "type"- String etype <- o .: "type" - obj <- o .: "data"- eventData <- - case etype of- "account.updated" -> AccountEvent <$> obj .: "object" - "account.application.deauthorized" -> AccountApplicationEvent <$> obj .: "object" - "application_fee.created" -> ApplicationFeeEvent <$> obj .: "object" - "application_fee.refunded" -> ApplicationFeeEvent <$> obj .: "object" - "balance.available" -> BalanceEvent <$> obj .: "object" - "charge.succeeded" -> ChargeEvent <$> obj .: "object" - "charge.failed" -> ChargeEvent <$> obj .: "object" - "charge.refunded" -> ChargeEvent <$> obj .: "object" - "charge.captured" -> ChargeEvent <$> obj .: "object" - "charge.updated" -> ChargeEvent <$> obj .: "object" - "charge.dispute.created" -> DisputeEvent <$> obj .: "object" - "charge.dispute.updated" -> DisputeEvent <$> obj .: "object" - "charge.dispute.closed" -> DisputeEvent <$> obj .: "object" - "charge.dispute.funds_withdrawn" -> DisputeEvent <$> obj .: "object" - "charge.dispute.funds_reinstated" -> DisputeEvent <$> obj .: "object" - "customer.created" -> CustomerEvent <$> obj .: "object" - "customer.updated" -> CustomerEvent <$> obj .: "object" - "customer.deleted" -> CustomerEvent <$> obj .: "object" - "customer.card.created" -> CardEvent <$> obj .: "object" - "customer.card.updated" -> CardEvent <$> obj .: "object" - "customer.card.deleted" -> CardEvent <$> obj .: "object" - "customer.subscription.created" -> SubscriptionEvent <$> obj .: "object" - "customer.subscription.updated" -> SubscriptionEvent <$> obj .: "object" - "customer.subscription.deleted" -> SubscriptionEvent <$> obj .: "object" - "customer.subscription.trial_will_end" -> SubscriptionEvent <$> obj .: "object" - "customer.discount.created" -> DiscountEvent <$> obj .: "object" - "customer.discount.updated" -> DiscountEvent <$> obj .: "object" - "customer.discount.deleted" -> DiscountEvent <$> obj .: "object" - "invoice.created" -> InvoiceEvent <$> obj .: "object" - "invoice.updated" -> InvoiceEvent <$> obj .: "object" - "invoice.payment_succeeded" -> InvoiceEvent <$> obj .: "object" - "invoice.payment_failed" -> InvoiceEvent <$> obj .: "object" - "invoiceitem.created" -> InvoiceItemEvent <$> obj .: "object" - "invoiceitem.updated" -> InvoiceItemEvent <$> obj .: "object" - "invoiceitem.deleted" -> InvoiceItemEvent <$> obj .: "object" - "plan.created" -> PlanEvent <$> obj .: "object" - "plan.updated" -> PlanEvent <$> obj .: "object" - "plan.deleted" -> PlanEvent <$> obj .: "object" - "coupon.created" -> CouponEvent <$> obj .: "object" - "coupon.updated" -> CouponEvent <$> obj .: "object" - "coupon.deleted" -> CouponEvent <$> obj .: "object" - "recipient.created" -> RecipientEvent <$> obj .: "object" - "recipient.updated" -> RecipientEvent <$> obj .: "object" - "recipient.deleted" -> RecipientEvent <$> obj .: "object" - "transfer.created" -> TransferEvent <$> obj .: "object" - "transfer.updated" -> TransferEvent <$> obj .: "object" - "transfer.canceled" -> TransferEvent <$> obj .: "object" - "transfer.paid" -> TransferEvent <$> obj .: "object" - "transfer.failed" -> TransferEvent <$> obj .: "object" - "ping" -> pure Ping- _ -> pure UnknownEventData- eventObject <- o .: "object"- eventPendingWebHooks <- o .: "pending_webhooks"- eventRequest <- o .:? "request"- return Event {..}- parseJSON _ = mzero----------------------------------------------------------------------------------- | Connect Application-data ConnectApp = ConnectApp {- connectAppId :: Maybe Text- , connectAppObject :: Text- , connectAppName :: Text- } deriving (Show, Eq)----------------------------------------------------------------------------------- | Connect Application JSON instance-instance FromJSON ConnectApp where- parseJSON (Object o) =- ConnectApp <$> o .:? "id"- <*> o .: "object"- <*> o .: "name"- parseJSON _ = mzero----------------------------------------------------------------------------------- | `TokenId` of a `Token`-newtype TokenId =- TokenId Text- deriving (Show, Eq)----------------------------------------------------------------------------------- | Type of `Token`-data TokenType = TokenCard- | TokenBankAccount- deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `TokenType`-instance FromJSON TokenType where- parseJSON (String "bank_account") = pure TokenBankAccount- parseJSON (String "card") = pure TokenCard- parseJSON _ = mzero----------------------------------------------------------------------------------- | `Token` Object-data Token a = Token {- tokenId :: TokenId- , tokenLiveMode :: Bool- , tokenCreated :: UTCTime- , tokenUsed :: Bool- , tokenObject :: Text- , tokenType :: TokenType- , tokenData :: a-} deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `Token`-instance FromJSON a => FromJSON (Token a) where- parseJSON (Object o) = do- tokenId <- TokenId <$> o .: "id"- Bool tokenLiveMode <- o .: "livemode"- tokenCreated <- fromSeconds <$> o .: "created"- Bool tokenUsed <- o .: "used"- String tokenObject <- o .: "object"- String typ <- o .: "type"- tokenType <- pure $ case typ of- "card" -> TokenCard- "bank_account" -> TokenBankAccount- _ -> error "unspecified type"- tokenData <-- case typ of- "bank_account" -> o .: "bank_account"- "card" -> o .: "card"- _ -> mzero- return Token {..}- parseJSON _ = mzero----------------------------------------------------------------------------------- | Generic handling of Stripe JSON arrays-data StripeList a = StripeList {- list :: [a]- , stripeUrl :: Text- , object :: Text- , totalCount :: Maybe Int- , hasMore :: Bool- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `StripeList`-instance FromJSON a => FromJSON (StripeList a) where- parseJSON (Object o) =- StripeList <$> o .: "data"- <*> o .: "url"- <*> o .: "object"- <*> o .:? "total_count"- <*> o .: "has_more"- parseJSON _ = mzero----------------------------------------------------------------------------------- | Pagination Option for `StripeList`-type Limit = Maybe Int----------------------------------------------------------------------------------- | Pagination Option for `StripeList`-type StartingAfter a = Maybe a----------------------------------------------------------------------------------- | Pagination Option for `StripeList`-type EndingBefore a = Maybe a----------------------------------------------------------------------------------- | JSON returned from a `Stripe` deletion request-data StripeDeleteResult = StripeDeleteResult {- deleted :: Bool- , deletedId :: Maybe Text- } deriving (Show, Eq)----------------------------------------------------------------------------------- | JSON Instance for `StripeDeleteResult`-instance FromJSON StripeDeleteResult where- parseJSON (Object o) =- StripeDeleteResult <$> o .: "deleted"- <*> o .:? "id" - parseJSON _ = mzero----------------------------------------------------------------------------------- | Type of MetaData for use on `Stripe` objects-type MetaData = [ (Text,Text) ]----------------------------------------------------------------------------------- | Type of Expansion Parameters for use on `Stripe` objects-type ExpandParams = [Text]----------------------------------------------------------------------------------- | Generic ID for use in constructing API Calls-type ID = Text----------------------------------------------------------------------------------- | Generic URL for use in constructing API Calls-type URL = Text----------------------------------------------------------------------------------- | Generic URL for use in constructing API Calls-type Name = Text----------------------------------------------------------------------------------- | Generic Description for use in constructing API Calls-type Description = Text----------------------------------------------------------------------------------- | Generic `Quantity` type to be used with `Customer`,--- `Subscription` and `InvoiceLineItem` API requests-newtype Quantity = Quantity Int deriving (Show, Eq)----------------------------------------------------------------------------------- | `Email` associated with a `Customer`, `Recipient` or `Charge`-newtype Email = Email Text deriving (Show, Eq)----------------------------------------------------------------------------------- | Stripe supports 138 currencies -data Currency =- 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- deriving (Show, Eq)----------------------------------------------------------------------------------- | `Currency` JSON instances-instance FromJSON Currency where- parseJSON (String "aed") = pure AED- parseJSON (String "afn") = pure AFN- parseJSON (String "all") = pure ALL- parseJSON (String "amd") = pure AMD- parseJSON (String "ang") = pure ANG- parseJSON (String "aoa") = pure AOA- parseJSON (String "ars") = pure ARS- parseJSON (String "aud") = pure AUD- parseJSON (String "awg") = pure AWG- parseJSON (String "azn") = pure AZN- parseJSON (String "bam") = pure BAM- parseJSON (String "bbd") = pure BBD- parseJSON (String "bdt") = pure BDT- parseJSON (String "bgn") = pure BGN- parseJSON (String "bif") = pure BIF- parseJSON (String "bmd") = pure BMD- parseJSON (String "bnd") = pure BND- parseJSON (String "bob") = pure BOB- parseJSON (String "brl") = pure BRL- parseJSON (String "bsd") = pure BSD- parseJSON (String "bwp") = pure BWP- parseJSON (String "bzd") = pure BZD- parseJSON (String "cad") = pure CAD- parseJSON (String "cdf") = pure CDF- parseJSON (String "chf") = pure CHF- parseJSON (String "clp") = pure CLP- parseJSON (String "cny") = pure CNY- parseJSON (String "cop") = pure COP- parseJSON (String "crc") = pure CRC- parseJSON (String "cve") = pure CVE- parseJSON (String "czk") = pure CZK- parseJSON (String "djf") = pure DJF- parseJSON (String "dkk") = pure DKK- parseJSON (String "dop") = pure DOP- parseJSON (String "dzd") = pure DZD- parseJSON (String "eek") = pure EEK- parseJSON (String "egp") = pure EGP- parseJSON (String "etb") = pure ETB- parseJSON (String "eur") = pure EUR- parseJSON (String "fjd") = pure FJD- parseJSON (String "fkp") = pure FKP- parseJSON (String "gbp") = pure GBP- parseJSON (String "gel") = pure GEL- parseJSON (String "gip") = pure GIP- parseJSON (String "gmd") = pure GMD- parseJSON (String "gnf") = pure GNF- parseJSON (String "gtq") = pure GTQ- parseJSON (String "gyd") = pure GYD- parseJSON (String "hkd") = pure HKD- parseJSON (String "hnl") = pure HNL- parseJSON (String "hrk") = pure HRK- parseJSON (String "htg") = pure HTG- parseJSON (String "huf") = pure HUF- parseJSON (String "idr") = pure IDR- parseJSON (String "ils") = pure ILS- parseJSON (String "inr") = pure INR- parseJSON (String "isk") = pure ISK- parseJSON (String "jmd") = pure JMD- parseJSON (String "jpy") = pure JPY- parseJSON (String "kes") = pure KES- parseJSON (String "kgs") = pure KGS- parseJSON (String "khr") = pure KHR- parseJSON (String "kmf") = pure KMF- parseJSON (String "krw") = pure KRW- parseJSON (String "kyd") = pure KYD- parseJSON (String "kzt") = pure KZT- parseJSON (String "lak") = pure LAK- parseJSON (String "lbp") = pure LBP- parseJSON (String "lkr") = pure LKR- parseJSON (String "lrd") = pure LRD- parseJSON (String "lsl") = pure LSL- parseJSON (String "ltl") = pure LTL- parseJSON (String "lvl") = pure LVL- parseJSON (String "mad") = pure MAD- parseJSON (String "mdl") = pure MDL- parseJSON (String "mga") = pure MGA- parseJSON (String "mkd") = pure MKD- parseJSON (String "mnt") = pure MNT- parseJSON (String "mop") = pure MOP- parseJSON (String "mro") = pure MRO- parseJSON (String "mur") = pure MUR- parseJSON (String "mvr") = pure MVR- parseJSON (String "mwk") = pure MWK- parseJSON (String "mxn") = pure MXN- parseJSON (String "myr") = pure MYR- parseJSON (String "mzn") = pure MZN- parseJSON (String "nad") = pure NAD- parseJSON (String "ngn") = pure NGN- parseJSON (String "nio") = pure NIO- parseJSON (String "nok") = pure NOK- parseJSON (String "npr") = pure NPR- parseJSON (String "nzd") = pure NZD- parseJSON (String "pab") = pure PAB- parseJSON (String "pen") = pure PEN- parseJSON (String "pgk") = pure PGK- parseJSON (String "php") = pure PHP- parseJSON (String "pkr") = pure PKR- parseJSON (String "pln") = pure PLN- parseJSON (String "pyg") = pure PYG- parseJSON (String "qar") = pure QAR- parseJSON (String "ron") = pure RON- parseJSON (String "rsd") = pure RSD- parseJSON (String "rub") = pure RUB- parseJSON (String "rwf") = pure RWF- parseJSON (String "sar") = pure SAR- parseJSON (String "sbd") = pure SBD- parseJSON (String "scr") = pure SCR- parseJSON (String "sek") = pure SEK- parseJSON (String "sgd") = pure SGD- parseJSON (String "shp") = pure SHP- parseJSON (String "sll") = pure SLL- parseJSON (String "sos") = pure SOS- parseJSON (String "srd") = pure SRD- parseJSON (String "std") = pure STD- parseJSON (String "svc") = pure SVC- parseJSON (String "szl") = pure SZL- parseJSON (String "thb") = pure THB- parseJSON (String "tjs") = pure TJS- parseJSON (String "top") = pure TOP- parseJSON (String "try") = pure TRY- parseJSON (String "ttd") = pure TTD- parseJSON (String "twd") = pure TWD- parseJSON (String "tzs") = pure TZS- parseJSON (String "uah") = pure UAH- parseJSON (String "ugx") = pure UGX- parseJSON (String "usd") = pure USD- parseJSON (String "uyu") = pure UYU- parseJSON (String "uzs") = pure UZS- parseJSON (String "vnd") = pure VND- parseJSON (String "vuv") = pure VUV- parseJSON (String "wst") = pure WST- parseJSON (String "xaf") = pure XAF- parseJSON (String "xcd") = pure XCD- parseJSON (String "xof") = pure XOF- parseJSON (String "xpf") = pure XPF- parseJSON (String "yer") = pure YER- parseJSON (String "zar") = pure ZAR- parseJSON (String "zmw") = pure ZMW- parseJSON _ = pure UnknownCurrency----------------------------------------------------------------------------------- | BTC ReceiverObject-data BitcoinReceiver = BitcoinReceiver {- btcId :: BitcoinReceiverId- , btcObject :: Text- , btcCreated :: UTCTime- , btcLiveMode :: Bool- , btcActive :: Bool- , btcAmount :: Integer- , btcAmountReceived :: Integer- , btcBitcoinAmount :: Integer- , btcBitcoinAmountReceived :: Integer- , btcBitcoinUri :: Text- , btcCurrency :: Currency- , btcFilled :: Bool- , btcInboundAddress :: Text- , btcUncapturedFunds :: Bool- , btcDescription :: Maybe Text- , btcEmail :: Text- , btcMetadata :: MetaData- , btcRefundAddress :: Maybe Text- , btcTransactions :: Maybe Transactions- , btcPayment :: Maybe PaymentId - , btcCustomer :: Maybe CustomerId- } deriving (Show, Eq)----------------------------------------------------------------------------------- | FromJSON for BitcoinReceiverId-instance FromJSON BitcoinReceiver where- parseJSON (Object o) =- BitcoinReceiver <$> (BitcoinReceiverId <$> o .: "id")- <*> o .: "object" - <*> (fromSeconds <$> o .: "created") - <*> o .: "livemode" - <*> o .: "active" - <*> o .: "amount" - <*> o .: "amount_received" - <*> o .: "bitcoin_amount" - <*> o .: "bitcoin_amount_received" - <*> o .: "bitcoin_uri" - <*> o .: "currency" - <*> o .: "filled" - <*> o .: "inbound_address" - <*> o .: "uncaptured_funds" - <*> o .:? "description" - <*> o .: "email" - <*> (H.toList <$> o .: "metadata")- <*> o .:? "refund_address" - <*> o .:? "transactions"- <*> (fmap PaymentId <$> o .:? "payment")- <*> (fmap CustomerId <$> o .:? "customer")- parseJSON _ = mzero----------------------------------------------------------------------------------- | Bitcoin Transactions-data Transactions = Transactions {- transactionsObject :: Text- , transactionsTotalCount :: Integer- , transactionsHasMore :: Bool- , transactionsURL :: Text- , transactions :: [BitcoinTransaction]- } deriving (Show, Eq)----------------------------------------------------------------------------------- | Bitcoin Transactions data-instance FromJSON Transactions where- parseJSON (Object o) =- Transactions <$> o .: "object" - <*> o .: "total_count" - <*> o .: "has_more" - <*> o .: "url" - <*> o .: "data" - parseJSON _ = mzero----------------------------------------------------------------------------------- | Bitcoin Transaction-data BitcoinTransaction = BitcoinTransaction {- btcTransactionId :: BitcoinTransactionId- , btcTransactionObject :: Text- , btcTransactionCreated :: UTCTime- , btcTransactionAmount :: Integer- , btcTransactionBitcoinAmount :: Integer- , btcTransactionCurrency :: Currency- , btcTransactionReceiver :: BitcoinReceiverId- } deriving (Show, Eq)----------------------------------------------------------------------------------- | FromJSON BitcoinTransaction-instance FromJSON BitcoinTransaction where- parseJSON (Object o) =- BitcoinTransaction <$> o .: "id"- <*> o .: "object"- <*> (fromSeconds <$> o .: "created")- <*> o .: "amount"- <*> o .: "bitcoin_amount"- <*> o .: "currency"- <*> o .: "receiver"- parseJSON _ = mzero----------------------------------------------------------------------------------- | BitcoinTransactionId-newtype BitcoinTransactionId =- BitcoinTransactionId Text- deriving (Show, Eq)----------------------------------------------------------------------------------- | FromJSON BitcoinTransactionId-instance FromJSON BitcoinTransactionId where- parseJSON (String o) = pure $ BitcoinTransactionId o- parseJSON _ = mzero----------------------------------------------------------------------------------- | BTC ReceiverId-newtype BitcoinReceiverId = BitcoinReceiverId Text- deriving (Show, Eq)----------------------------------------------------------------------------------- | FromJSON for BitcoinReceiverId-instance FromJSON BitcoinReceiverId where- parseJSON (String x) = pure $ BitcoinReceiverId x- parseJSON _ = mzero----------------------------------------------------------------------------------- | BTC PaymentId-newtype PaymentId = PaymentId Text- deriving (Show, Eq)----------------------------------------------------------------------------------- | FromJSON for PaymentId-instance FromJSON PaymentId where- parseJSON (String x) = pure $ PaymentId x- parseJSON _ = mzero
− src/Web/Stripe/Types/Util.hs
@@ -1,85 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}--- |--- Module : Web.Stripe.Types.Util--- Copyright : (c) David Johnson, 2014--- Maintainer : djohnson.m@gmail.com--- Stability : experimental--- Portability : POSIX-module Web.Stripe.Types.Util- ( -- * Getters- getTransactionId- , getCustomerId- , getCardId- , getRecipientCardId- , getRecipientId- , getAccountId- , getChargeId- , getInvoiceId- , getInvoiceItemId- ) where--import Data.Text (Text)-import Web.Stripe.Types---------------------------------------------------------------------------------- | Helper for retrieving `TransactionId`-getTransactionId :: TransactionId -> Text-getTransactionId (TransactionId x) = x-getTransactionId (ExpandedTransaction BalanceTransaction { balanceTransactionId = TransactionId x }) = x-getTransactionId _ = ""----------------------------------------------------------------------------------- | Helper for retrieving `CustomerId`-getCustomerId :: CustomerId -> Text-getCustomerId (CustomerId x) = x-getCustomerId (ExpandedCustomer Customer { customerId = CustomerId x }) = x-getCustomerId _ = ""----------------------------------------------------------------------------------- | Helper for retrieving `CardId`-getCardId :: CardId -> Text-getCardId (CardId x) = x-getCardId (ExpandedCard Card { cardId = CardId x }) = x-getCardId _ = ""----------------------------------------------------------------------------------- | Helper for retrieving `RecipientCardId`-getRecipientCardId :: RecipientCardId -> Text-getRecipientCardId (RecipientCardId x) = x-getRecipientCardId (ExpandedRecipientCard RecipientCard { recipientCardId = RecipientCardId x }) = x-getRecipientCardId _ = ""----------------------------------------------------------------------------------- | Helper for retrieiving `RecipientId`-getRecipientId :: RecipientId -> Text-getRecipientId (RecipientId x) = x-getRecipientId (ExpandedRecipient Recipient { recipientId = RecipientId x }) = x-getRecipientId _ = ""----------------------------------------------------------------------------------- | Helper for retrieving `AccountId`-getAccountId :: AccountId -> Text-getAccountId (AccountId x) = x-getAccountId (ExpandedAccount Account { accountId = AccountId x }) = x-getAccountId _ = ""----------------------------------------------------------------------------------- | Helper for retrieving `CardId`-getChargeId :: ChargeId -> Text-getChargeId (ChargeId x) = x-getChargeId (ExpandedCharge Charge { chargeId = ChargeId x }) = x-getChargeId _ = ""----------------------------------------------------------------------------------- | Helper for retrieving `InvoiceId`-getInvoiceId :: InvoiceId -> Text-getInvoiceId (InvoiceId x) = x-getInvoiceId (ExpandedInvoice Invoice { invoiceId = Nothing }) = ""-getInvoiceId (ExpandedInvoice Invoice { invoiceId = Just (InvoiceId x) }) = x-getInvoiceId _ = ""----------------------------------------------------------------------------------- | Helper for retrieving `InvoiceItemId`-getInvoiceItemId :: InvoiceItemId -> Text-getInvoiceItemId (InvoiceItemId x) = x-getInvoiceItemId (ExpandedInvoiceItem InvoiceItem { invoiceItemId = InvoiceItemId x }) = x-getInvoiceItemId _ = ""
stripe-haskell.cabal view
@@ -1,52 +1,50 @@ name: stripe-haskell-version: 0.1.4.3+version: 2.0.0 synopsis: Stripe API for Haskell license: MIT license-file: LICENSE author: David Johnson maintainer: djohnson.m@gmail.com-copyright: Copyright (c) 2015 David M. Johnson+copyright: Copyright (c) 2015 David M. Johnson, Jeremy Shaw homepage: https://github.com/dmjio/stripe bug-reports: https://github.com/dmjio/stripe/issues category: Web build-type: Simple cabal-version: >=1.10-Description: +Description: . <<https://stripe.com/img/navigation/logo@2x.png>> .- [100% Stripe API Coverage - <https://stripe.com/docs/api>]+ [Stripe API Coverage - <https://stripe.com/docs/api>] All Stripe commands are supported, including but not limited to Charges, Refunds, Customers, Cards,- Subscriptions, Plans, Coupons, Discounts, Invoices, Invoice Items,+ Subscriptions, Plans, Coupons, Discounts, Invoices, Invoice Items, Bitcoin, Disputes, Transfers, Recipients, Application Fees, Application Fee Refunds, Account, Balance, Events and Tokens. .- [100% Haddock Coverage]- All code written for this library is documented to completion with the haddock documentation tool- .- [100+ Hspec Tests] Thoroughly unit-tested with hspec.- All API commands are unit-tested before inclusion into the API (see the tests directory).+ [Hspec Tests] Thoroughly unit-tested with hspec.+ All API commands are unit-tested before inclusion into the API (see the stripe-tests package). To run the tests, perform the following: . > cabal clean && cabal configure --enable-tests && cabal build tests && dist/build/tests/tests -- You will be prompted to enter your *TEST* key . [Pagination - <https://stripe.com/docs/api#pagination>]- Pagination is possible on all API calls that return a JSON array. + Pagination is possible on all API calls that return a JSON array. Any API call that returns a `StripeList` is eligible for pagination. To use in practice do the following: .+ > {-# LANGUAGE OverloadedStrings #-} > import Web.Stripe > import Web.Stripe.Customer > > main :: IO () > main = do- > let config = StripeConfig "secret key"- > result <- stripe config $ getCustomers - > (Just 30 :: Maybe Limit) -- Defaults to 10 if Nothing, 100 is Max- > (StartingAfter $ CustomerId "customer_id0")- > (EndingBefore $ CustomerId "customer_id30")+ > let config = StripeConfig (StripeKey "secret key")+ > result <- stripe config $ getCustomers+ > -&- (Limit 30) -- Defaults to 10 if Nothing, 100 is Max+ > -&- (StartingAfter $ CustomerId "customer_id0")+ > -&- (EndingBefore $ CustomerId "customer_id30") > case result of > Right stripelist -> print (list stripelist :: [Customer]) > Left stripeError -> print stripeError@@ -54,30 +52,31 @@ . [Versioning - <https://stripe.com/docs/api#versioning>] All versioning is hard-coded (for safety).- Stripe API versions specified in the HTTP headers of Stripe requests take precedence - over the API version specified in your Stripe Dashboard. In an attempt to ensure- API consistency and correct parsing of returned JSON, all Stripe versions are hard-coded, and are- inaccessible to the end-users of this library. When a new Stripe API version is released + Stripe API versions specified in the HTTP headers of Stripe requests take precedence+ over the API version specified in your Stripe Dashboard (with the `Events` being an excpetion). In an attempt to ensure+ API consistency and correct parsing of returned JSON, all Stripe versions are hard-coded into the request, and are+ inaccessible to the end-users of this library. When a new Stripe API version is released this library will increment the hard-coded API version. . [Expansion - <https://stripe.com/docs/api#expansion>] Object expansion is supported on Stripe objects eligible for expansion though the `ExpandParams` type.- Object expansion allows normal Stripe API calls to return expanded objects inside of other objects. + Object expansion allows normal Stripe API calls to return expanded objects inside of other objects. For example, a `Customer` object contains a Card ID hash on the default_card field. This default_card hash can be expanded into a full `Card` object inside a `Customer` object. As an example: .+ > {-# LANGUAGE OverloadedStrings #-} > import Web.Stripe > import Web.Stripe.Customer > > main :: IO () > main = do- > let config = StripeConfig "secret key"- > result <- stripe config $ getCustomerExpandable + > let config = StripeConfig (StripeKey "secret key")+ > result <- stripe config $ getCustomerExpandable > (CustomerId "customerid")- > (["default_card"] :: ExpandParams)+ > -&- ExpandParams ["default_card"] > case result of- > Right customer -> print (defaultCard customer) -- Will be an `ExpandedCard`+ > Right customer -> print (defaultCard customer) -- Will be an `Expanded` `Card` > Left stripeError -> print stripeError > .@@ -86,16 +85,18 @@ Stripe objects allow the embedding of arbitrary metadata. Any Stripe object that supports the embedding of metadata is available via this API. As an example:- . + .+ > {-# LANGUAGE OverloadedStrings #-} > import Web.Stripe > import Web.Stripe.Coupon > > main :: IO () > main = do- > let config = StripeConfig "secret key"- > result <- stripe config $ updateCoupon (CouponId "couponid") [("key1", "value2"), ("key2", "value2")]+ > let config = StripeConfig (StripeKey "secret key")+ > result <- stripe config $ updateCoupon (CouponId "couponid")+ -&- MetaData [("key1", "value2"), ("key2", "value2")] > case result of- > Right coupon -> print $ couponMetaData coupon+ > Right coupon -> print $ couponMetaData coupon > Left stripeError -> print stripeError . [Issues - <https://github.com/dmjio/stripe-haskell/issues>]@@ -103,101 +104,20 @@ Pull requests welcome! . -extra-source-files:- README.md- -Test-Suite tests- type: exitcode-stdio-1.0- main-is: Main.hs- hs-source-dirs: tests- build-depends: aeson == 0.9.*- , base >=4.6 && < 5- , bytestring == 0.10.*- , either == 4.4.*- , hspec == 2.2.*- , http-streams == 0.8.*- , HsOpenSSL == 0.11.*- , random == 1.1.*- , stripe-haskell- , text == 1.2.*- , time == 1.5.*- , transformers == 0.4.*- default-language: Haskell2010- other-modules:- Test.Account- Test.ApplicationFee- Test.ApplicationFeeRefund- Test.Balance- Test.Bitcoin- Test.Card- Test.Charge- Test.Config- Test.Coupon- Test.Customer- Test.Discount- Test.Dispute- Test.Event- Test.Invoice- Test.InvoiceItem- Test.Plan- Test.Raw- Test.Recipient- Test.Refund- Test.Subscription- Test.Token- Test.Transfer- Test.Util- - ghc-options: -Wall -threaded -rtsopts+library+ hs-source-dirs: src src-http-streams+ build-depends: base >= 4 && < 5,+ stripe-core >= 2.0 && < 2.1,+ stripe-http-streams >= 2.0 && < 2.1 -library - hs-source-dirs: src- build-depends: aeson == 0.9.*- , base >=4.6 && < 5- , bytestring == 0.10.*- , either == 4.4.*- , http-streams == 0.8.*- , HsOpenSSL == 0.11.*- , random == 1.1.*- , io-streams == 1.3.*- , mtl == 2.2.*- , text == 1.2.*- , time == 1.5.*- , transformers == 0.4.*- , unordered-containers == 0.2.*- default-language: Haskell2010- other-modules: Web.Stripe.Client- Web.Stripe.Client.Internal- Web.Stripe.Client.Error- Web.Stripe.Client.Types- Web.Stripe.Client.Util- Web.Stripe.Types- Web.Stripe.Types.Util- exposed-modules: + exposed-modules: Web.Stripe- Web.Stripe.Account- Web.Stripe.ApplicationFee- Web.Stripe.ApplicationFeeRefund- Web.Stripe.Balance- Web.Stripe.Bitcoin- Web.Stripe.Card- Web.Stripe.Charge- Web.Stripe.Coupon- Web.Stripe.Customer- Web.Stripe.Discount- Web.Stripe.Dispute- Web.Stripe.Event- Web.Stripe.Invoice- Web.Stripe.InvoiceItem- Web.Stripe.Plan- Web.Stripe.Recipient- Web.Stripe.Refund- Web.Stripe.Subscription- Web.Stripe.Token- Web.Stripe.Transfer- ghc-options: -Wall -rtsopts+ Web.Stripe.Client.Stripe + ghc-options: -Wall+ source-repository head type: git location: git://github.com/dmjio/stripe.git+ subdir: stripe
− tests/Main.hs
@@ -1,62 +0,0 @@-{-# LANGUAGE LambdaCase #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}-module Main where--import Test.Hspec (hspec,parallel)-import Test.Config (getConfig)-import Test.Account (accountTests)-import Test.ApplicationFee (applicationFeeTests)-import Test.ApplicationFeeRefund (applicationFeeRefundTests)-import Test.Balance (balanceTests)-import Test.Charge (chargeTests)-import Test.Card (cardTests)-import Test.Coupon (couponTests)-import Test.Customer (customerTests)-import Test.Discount (discountTests)-import Test.Dispute (disputeTests)-import Test.Invoice (invoiceTests)-import Test.InvoiceItem (invoiceItemTests)-import Test.Plan (planTests)-import Test.Recipient (recipientTests)-import Test.Refund (refundTests)-import Test.Subscription (subscriptionTests)-import Test.Token (tokenTests)-import Test.Transfer (transferTests)-import Test.Raw (rawTest)-import Test.Event (eventTests)-import Test.Bitcoin (bitcoinTests)----------------------------------------------------------------------------------- | Main test function entry point-main :: IO ()-main = do- let msg = "You must export STRIPEKEY in order to run the tests, returning Success"- getConfig >>= \case- Nothing -> putStrLn msg- Just config -> do- hspec $ parallel $ do- rawTest config- bitcoinTests config- chargeTests config- refundTests config- customerTests config- cardTests config- subscriptionTests config- planTests config- couponTests config- discountTests config- invoiceTests config- invoiceItemTests config- disputeTests config- transferTests config- recipientTests config- applicationFeeTests config- applicationFeeRefundTests config- accountTests config- balanceTests config- tokenTests config- eventTests config---
− tests/Test/Account.hs
@@ -1,15 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-module Test.Account where--import Data.Either-import Test.Hspec-import Web.Stripe-import Web.Stripe.Account--accountTests :: StripeConfig -> Spec-accountTests config = do- describe "Account tests" $ do- it "Succesfully retrieves account information" $ do- result <- stripe config getAccountDetails- result `shouldSatisfy` isRight-
− tests/Test/ApplicationFee.hs
@@ -1,17 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-module Test.ApplicationFee where--import Test.Hspec-import Web.Stripe.ApplicationFee-import Web.Stripe-import Data.Either--applicationFeeTests :: StripeConfig -> Spec -applicationFeeTests config = do- describe "Application Fee tests" $ do- it "Succesfully fails to retrieve an unknown application fee" $ do- result <- stripe config $ getApplicationFee (FeeId "fee_unknown")- result `shouldSatisfy` isLeft- it "Succesfully retrieves all application fees" $ do- result <- stripe config $ getApplicationFees Nothing Nothing Nothing- result `shouldSatisfy` isRight
− tests/Test/ApplicationFeeRefund.hs
@@ -1,24 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}-module Test.ApplicationFeeRefund where--import Data.Either-import Test.Hspec-import Web.Stripe-import Web.Stripe.ApplicationFeeRefund--applicationFeeRefundTests :: StripeConfig -> Spec-applicationFeeRefundTests config = do- describe "Application Fee Refund tests" $ do- it "Succesfully fails to refund an unknown application fee" $ do- result <- stripe config $ createApplicationFeeRefund (FeeId "blah") Nothing []- result `shouldSatisfy` isLeft- it "Succesfully fails to retrieve a Application ID with an unknown Refund id" $ do- result <- stripe config $ getApplicationFeeRefund (FeeId "blah") (RefundId "adsf")- result `shouldSatisfy` isLeft- it "Succesfully fails to update an ApplicationRefund for an Invalid Fee ID" $ do- result <- stripe config $ updateApplicationFeeRefund (FeeId "blah") (RefundId "blah") []- result `shouldSatisfy` isLeft- it "Succesfully fails to retrieve all ApplicationRefunds for an Invalid Fee ID" $ do- result <- stripe config $ getApplicationFeeRefunds (FeeId "blah") Nothing Nothing Nothing- result `shouldSatisfy` isLeft
− tests/Test/Balance.hs
@@ -1,50 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-module Test.Balance where--import Control.Monad-import Data.Either-import Test.Hspec--import Web.Stripe-import Web.Stripe.Balance-import Web.Stripe.Charge-import Web.Stripe.Customer--balanceTests :: StripeConfig -> Spec-balanceTests config = do- describe "Balance tests" $ do- it "Succesfully retrieves a Balance" $ do- result <- stripe config getBalance- result `shouldSatisfy` isRight- it "Succesfully retrieves a Balance Transaction" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeBalanceTransaction = Just txid } <-- chargeCustomer cid USD 100 Nothing- balance <- getBalanceTransaction txid- void $ deleteCustomer cid- return balance- result `shouldSatisfy` isRight- it "Succesfully retrieves an Expanded Balance Transaction" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeBalanceTransaction = Just txid- } <- chargeCustomer cid USD 100 Nothing- result <- getBalanceTransactionExpandable txid ["source"]- void $ deleteCustomer cid- return result- result `shouldSatisfy` isRight- it "Succesfully retrieves Balance Transaction History" $ do- result <- stripe config $ getBalanceTransactionHistory Nothing Nothing Nothing- result `shouldSatisfy` isRight- where- cn = CardNumber "4242424242424242"- em = ExpMonth 12- ey = ExpYear 2015- cvc = CVC "123"------
− tests/Test/Bitcoin.hs
@@ -1,22 +0,0 @@-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE OverloadedStrings #-}-module Test.Bitcoin ( bitcoinTests ) where--import Data.Either-import Test.Hspec-import Web.Stripe-import Web.Stripe.Bitcoin--bitcoinTests :: StripeConfig -> Spec-bitcoinTests config = do- describe "Bitcoin tests" $ do- result <- runIO $ stripe config $ createReceiver 10 (Email "fake@gmail.com")- it "Succesfully creates a bitcoin receiver" $ do- result `shouldSatisfy` isRight- it "Succesfully retrieves a bitcoin receiver" $ do- let Right BitcoinReceiver {..} = result- result <- stripe config $ getReceiver btcId- result `shouldSatisfy` isRight- it "Succesfully lists bitcoin receivers" $ do- result <- stripe config $ listReceivers Nothing Nothing Nothing- result `shouldSatisfy` isRight
− tests/Test/Card.hs
@@ -1,223 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}--module Test.Card where--import Control.Monad-import Data.Either-import Data.Maybe--import Test.Hspec--import Web.Stripe-import Web.Stripe.Card-import Web.Stripe.Customer-import Web.Stripe.Recipient-import Web.Stripe.Token--cardTests :: StripeConfig -> Spec-cardTests config = do- describe "Card tests" $ do- it "Can create a Customer Card by CardNumber" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- card <- createCustomerCard cid credit em ey cvc- void $ deleteCustomer cid- return card- result `shouldSatisfy` isRight- it "Can create a Customer Card by TokenId" $ do- result <- stripe config $ do- Token { tokenId = tkid } <- createCardToken credit em ey cvc- Customer { customerId = cid } <- createEmptyCustomer- card <- createCustomerCardByToken cid tkid- void $ deleteCustomer cid- return card- result `shouldSatisfy` isRight- it "Can retrieve a Customer Card" $ do- result <- stripe config $ do- Customer { customerId = customerid- , customerCards = StripeList { list = [ Card { cardId = cardid } ] }- } <- createCustomerByCard credit em ey cvc- card <- getCustomerCard customerid cardid- void $ deleteCustomer customerid- return card- result `shouldSatisfy` isRight- let Right Card{..} = result- cardLastFour `shouldBe` "4242"- cardExpMonth `shouldBe` em- cardExpYear `shouldBe` ey- it "Can retrieve a Customer's Card with expansion" $ do- result <- stripe config $ do- Customer { customerId = customerid- , customerCards = StripeList { list = [ Card { cardId = cardid } ] }- } <- createCustomerByCard credit em ey cvc- card <- getCustomerCardExpandable customerid cardid ["customer"]- void $ deleteCustomer customerid- return card- result `shouldSatisfy` isRight- let Right Card{..} = result- cardLastFour `shouldBe` "4242"- cardExpMonth `shouldBe` em- cardExpYear `shouldBe` ey- it "Can retrieve a Customer's Cards" $ do- result <- stripe config $ do- Customer { customerId = customerid- } <- createCustomerByCard credit em ey cvc- card <- getCustomerCards customerid Nothing Nothing Nothing- void $ deleteCustomer customerid- return card- result `shouldSatisfy` isRight- it "Can retrieve a Customer's Cards with Expansion" $ do- result <- stripe config $ do- Customer { customerId = customerid- } <- createCustomerByCard credit em ey cvc- card <- getCustomerCardsExpandable customerid Nothing Nothing Nothing ["data.customer"]- void $ deleteCustomer customerid- return card- result `shouldSatisfy` isRight- it "Can delete a Customer's Cards" $ do- result <- stripe config $ do- Customer { customerId = customerid- , customerDefaultCard = Just cardid- } <- createCustomerByCard credit em ey cvc- result <- deleteCustomerCard customerid cardid- void $ deleteCustomer customerid- return result- result `shouldSatisfy` isRight- it "Can update a Customer's Card" $ do- result <- stripe config $ do- Customer { customerId = customerid- , customerDefaultCard = Just cardid- } <- createCustomerByCard credit em ey cvc- result <- updateCustomerCard customerid cardid- cardname- cardcity- cardcountry- cardaddressOne- cardaddressTwo- cardaddressState- cardzip- void $ deleteCustomer customerid- return result- result `shouldSatisfy` isRight- let Right Card{..} = result- cardName `shouldBe` cardname- cardAddressCity `shouldBe` cardcity- cardAddressCountry `shouldBe` cardcountry- cardAddressLine1 `shouldBe` cardaddressOne- cardAddressLine2 `shouldBe` cardaddressTwo- cardAddressState `shouldBe` cardaddressState- cardAddressZip `shouldBe` cardzip- describe "Recipient Card tests" $ do- it "Can create a RecipientCard by CardNumber" $ do- result <- stripe config $ do- r@Recipient{..} <- createRecipientByCard firstname lastname Nothing Individual debit em ey cvc- void $ deleteRecipient recipientId- return r- result `shouldSatisfy` isRight- let Right Recipient {..} = result- length (list recipientCards) `shouldBe` 1- it "Can create a RecipientCard by Card TokenId" $ do- result <- stripe config $ do- Token { tokenId = tkid } <- createCardToken debit em ey cvc- Recipient { recipientId = rid } <- createRecipient firstname lastname (Just 'M') Individual- rcard <- createRecipientCardByToken rid tkid- void $ deleteRecipient rid- return rcard- result `shouldSatisfy` isRight- it "Fails to create a RecipientCard by BankAccount TokenId" $ do- result <- stripe config $ do- Token { tokenId = tkid } <- createBankAccountToken country routingnumber accountnumber- Recipient { recipientId = rid } <- createRecipient firstname lastname (Just 'M') Corporation- rcard <- createRecipientCardByToken rid tkid- void $ deleteRecipient rid- return rcard- result `shouldSatisfy` isLeft- it "Can retrieve a RecipientCard" $ do- result <- stripe config $ do- Recipient{..} <- createRecipientByCard firstname lastname Nothing Individual debit em ey cvc- rcard <- getRecipientCard recipientId (fromJust recipientDefaultCard)- void $ deleteRecipient recipientId- return rcard- result `shouldSatisfy` isRight- it "Can retrieve a RecipientCard Expanded" $ do- result <- stripe config $ do- Recipient{..} <- createRecipientByCard firstname lastname Nothing Individual debit em ey cvc- rcard <- getRecipientCardExpandable recipientId (fromJust recipientDefaultCard) ["recipient"]- void $ deleteRecipient recipientId- return rcard- result `shouldSatisfy` isRight- it "Can retrieve a Recipient's Cards" $ do- result <- stripe config $ do- Recipient{..} <- createRecipientByCard firstname lastname Nothing Individual debit em ey cvc- rcard <- getRecipientCards recipientId Nothing Nothing Nothing- void $ deleteRecipient recipientId- return rcard- result `shouldSatisfy` isRight- it "Can retrieve a Recipient's Cards Expanded" $ do- result <- stripe config $ do- Recipient{..} <- createRecipientByCard firstname lastname Nothing Individual debit em ey cvc- rcard <- getRecipientCardsExpandable recipientId Nothing Nothing Nothing ["data.recipient"]- void $ deleteRecipient recipientId- return rcard- result `shouldSatisfy` isRight- it "Can delete a Recipient Card Expanded" $ do- result <- stripe config $ do- Recipient{..} <- createRecipientByCard firstname lastname Nothing Individual debit em ey cvc- rcard <- deleteRecipientCard recipientId (fromJust recipientDefaultCard)- void $ deleteRecipient recipientId- return rcard- result `shouldSatisfy` isRight- it "Can update a Recipient's Card" $ do- result <- stripe config $ do- Recipient{..} <- createRecipientByCard firstname lastname Nothing Individual debit em ey cvc- rcard@RecipientCard{..} <-- updateRecipientCard- recipientId- (fromJust recipientDefaultCard)- cardname- cardcity- cardcountry- cardaddressOne- cardaddressTwo- cardaddressState- cardzip- void $ deleteRecipient recipientId- return rcard- result `shouldSatisfy` isRight- let Right RecipientCard{..} = result- recipientCardName `shouldBe` cardname- recipientCardAddressCity `shouldBe` cardcity- recipientCardAddressCountry `shouldBe` cardcountry- recipientCardAddressLine1 `shouldBe` cardaddressOne- recipientCardAddressLine2 `shouldBe` cardaddressTwo- recipientCardAddressState `shouldBe` cardaddressState- recipientCardAddressZip `shouldBe` cardzip-- it "Fails to add a Credit Card to a Recipient" $ do- result <- stripe config $ - createRecipientByCard firstname lastname Nothing Individual credit em ey cvc- result `shouldSatisfy` isLeft-- where- credit = CardNumber "4242424242424242"- debit = CardNumber "4000056655665556"- em = ExpMonth 12- ey = ExpYear 2015- cvc = CVC "123"- country = Country "US"- routingnumber = RoutingNumber "110000000"- accountnumber = AccountNumber "000123456789"- firstname = FirstName "David"- lastname = LastName "Johnson"- cardname = Just "cardName"- cardcity = Just (AddressCity "Chicago")- cardcountry = Just (AddressCountry "US")- cardaddressOne = Just (AddressLine1 "123 Fake Street")- cardaddressTwo = Just (AddressLine2 "456 Fake Street")- cardaddressState = Just (AddressState "IL")- cardzip = Just (AddressZip "60610")----
− tests/Test/Charge.hs
@@ -1,82 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}-module Test.Charge where--import Control.Monad-import Data.Either-import Data.Text (Text)-import Test.Hspec-import Web.Stripe-import Web.Stripe.Charge-import Web.Stripe.Customer--chargeTests :: StripeConfig -> Spec-chargeTests config =- describe "Charge tests" $ do- chargeCustomerTest- retrieveChargeTest- updateChargeTest- retrieveExpandedChargeTest- retrieveAllChargesTest- captureChargeTest- where- cn = CardNumber "4242424242424242"- em = ExpMonth 12- ey = ExpYear 2015- cvc = CVC "123"- chargeCustomerTest = - it "Charges a customer succesfully" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- charge <- chargeCustomer cid USD 100 Nothing- void $ deleteCustomer cid- return charge- result `shouldSatisfy` isRight- retrieveChargeTest = - it "Retrieves a charge succesfully" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- result <- getCharge chid- void $ deleteCustomer cid- return result- result `shouldSatisfy` isRight- updateChargeTest =- it "Updates a charge succesfully" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- _ <- updateCharge chid "Cool" [("hi", "there")]- result <- getCharge chid- void $ deleteCustomer cid- return result- result `shouldSatisfy` isRight- let Right Charge { chargeMetaData = cmd, chargeDescription = desc } = result- cmd `shouldBe` [("hi", "there")]- desc `shouldSatisfy` (==(Just "Cool" :: Maybe Text))- retrieveExpandedChargeTest =- it "Retrieves an expanded charge succesfully" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- result <- getChargeExpandable chid ["balance_transaction", "customer", "invoice"]- void $ deleteCustomer cid- return result- result `shouldSatisfy` isRight- retrieveAllChargesTest =- it "Retrieves all charges" $ do- result <- stripe config $ getCharges Nothing Nothing Nothing- result `shouldSatisfy` isRight- captureChargeTest = - it "Captures a charge - 2 Step Payment Flow" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeBase 100 USD Nothing (Just cid)- Nothing Nothing Nothing False - Nothing Nothing Nothing Nothing []- result <- captureCharge chid Nothing Nothing- void $ deleteCustomer cid- return result- result `shouldSatisfy` isRight- let Right Charge { chargeCaptured = captured } = result- captured `shouldBe` True
− tests/Test/Config.hs
@@ -1,27 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}-module Test.Config where--import qualified Data.ByteString.Char8 as B8-import Control.Applicative ((<$>))-import Web.Stripe-import Web.Stripe.Balance-import System.Exit-import System.Environment--getConfig :: IO (Maybe StripeConfig)-getConfig = foundKey =<< lookupEnv "STRIPEKEY"- where- foundKey Nothing = return Nothing- foundKey (Just str) = do- let config = StripeConfig (B8.pack str)- result <- stripe config getBalance- case result of- Left err -> print err >> exitFailure- Right Balance{..} ->- case balanceLiveMode of- False -> return (Just config)- True -> do putStrLn "You entered your production credentials, woops :)" - exitFailure--
− tests/Test/Coupon.hs
@@ -1,91 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-module Test.Coupon where--import Control.Monad-import Data.Either-import Test.Hspec-import Test.Util--import Web.Stripe-import Web.Stripe.Coupon--couponTests :: StripeConfig -> Spec-couponTests config = do- describe "Coupon tests" $ do- it "Succesfully create a coupon" $ do- couponName <- makeCouponId- result <- stripe config $ do- c@(Coupon { couponId = cid }) <-- createCoupon- (Just couponName)- Once- (Just $ AmountOff 1)- (Just USD)- Nothing- Nothing- Nothing- Nothing- []- void $ deleteCoupon cid- return c- result `shouldSatisfy` isRight- it "Succesfully retrieve a coupon" $ do- couponName <- makeCouponId- result <- stripe config $ do- Coupon { couponId = cid } <- createCoupon- (Just couponName)- Once- (Just $ AmountOff 1)- (Just USD)- Nothing- Nothing- Nothing- Nothing- []- res <- getCoupon cid- void $ deleteCoupon cid- return res- result `shouldSatisfy` isRight- it "Succesfully delete a coupon" $ do- couponName <- makeCouponId- result <- stripe config $ do- Coupon { couponId = cid } <- createCoupon- (Just couponName)- Once- (Just $ AmountOff 1)- (Just USD)- Nothing- Nothing- Nothing- Nothing- []- deleteCoupon cid- result `shouldSatisfy` isRight- it "Succesfully update a coupon" $ do- couponName <- makeCouponId- result <- stripe config $ do- Coupon { couponId = cid } <- createCoupon- (Just couponName)- Once- (Just $ AmountOff 1)- (Just USD)- Nothing- Nothing- Nothing- Nothing- []- r <- updateCoupon cid [("hi", "there")]- void $ deleteCoupon cid- return r- result `shouldSatisfy` isRight- let Right (Coupon { couponMetaData = cmd }) = result- cmd `shouldBe` [("hi", "there")]- it "Succesfully retrieves all coupons" $ do- result <- stripe config $ getCoupons Nothing Nothing Nothing- result `shouldSatisfy` isRight------
− tests/Test/Customer.hs
@@ -1,76 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}-module Test.Customer where--import Data.Either-import Data.Maybe-import Test.Hspec-import Web.Stripe-import Web.Stripe.Customer--customerTests :: StripeConfig -> Spec-customerTests config =- describe "Customer tests" $ do- it "Creates an empty customer" $ do- result <- stripe config $ do- c@Customer{..} <- createEmptyCustomer- _ <- deleteCustomer customerId- return c- result `shouldSatisfy` isRight- it "Deletes a customer" $ do- result <- stripe config $ do- c@Customer{..} <- createEmptyCustomer- _ <- deleteCustomer customerId- return c- result `shouldSatisfy` isRight- it "Gets a customer" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- customer <- getCustomer cid- _ <- deleteCustomer cid- return customer- result `shouldSatisfy` isRight- it "Gets a customer expandable" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- customer <- getCustomerExpandable cid ["default_card"]- _ <- deleteCustomer cid- return customer- result `shouldSatisfy` isRight- it "Gets customers" $ do- result <- stripe config $ getCustomers (Just 100) Nothing Nothing - result `shouldSatisfy` isRight- it "Gets customers expandable" $ do- result <- stripe config $ getCustomersExpandable- Nothing Nothing Nothing ["data.default_card"]- result `shouldSatisfy` isRight- it "Updates a customer" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- customer <- updateCustomerBase cid- bal- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing- desc - email- meta- _ <- deleteCustomer cid- return customer- result `shouldSatisfy` isRight- let Right Customer{..} = result- customerAccountBalance `shouldBe` (fromJust bal)- customerDescription `shouldBe` desc- customerEmail `shouldBe` email- customerMetaData `shouldBe` meta- where- bal = Just 100- desc = Just "hey"- email = Just $ Email "djohnson.m@gmail.com"- meta = [("hey","there")]- -
− tests/Test/Discount.hs
@@ -1,106 +0,0 @@-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE OverloadedStrings #-}-module Test.Discount where--import Control.Monad (void)-import Data.Either-import Test.Hspec-import Test.Util--import Web.Stripe-import Web.Stripe.Coupon-import Web.Stripe.Customer-import Web.Stripe.Discount-import Web.Stripe.Plan-import Web.Stripe.Subscription--discountTests :: StripeConfig -> Spec-discountTests config = do- describe "Discount tests" $ do- it "Succesfully deletes a discount from a Customer" $ do- coupon <- makeCouponId- result <- stripe config $ do- Coupon { couponId = couponid } <-- createCoupon- (Just coupon)- Once- (Just $ AmountOff 1)- (Just USD)- Nothing- Nothing- Nothing- Nothing- []- Customer { customerId = customerid } <-- createCustomerBase- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing- (Just coupon)- Nothing- Nothing- Nothing- Nothing- Nothing- []- r <- deleteCustomerDiscount customerid- c <- getCustomer customerid- void $ deleteCustomer customerid- void $ deleteCoupon couponid- return (r,c)- result `shouldSatisfy` isRight- let Right (_, Customer{..}) = result- customerDiscount `shouldBe` Nothing- it "Succesfully deletes a discount from a Subscription" $ do- coupon <- makeCouponId- plan <- makePlanId- result <- stripe config $ do- Plan { planId = planid } <-- createPlan plan- 0 -- free plan- USD- Month- "sample plan"- []- Coupon { couponId = couponid } <-- createCoupon- (Just coupon)- Once- (Just $ AmountOff 1)- (Just USD)- Nothing- Nothing- Nothing- Nothing- []- Customer { customerId = customerid } <-- createCustomerBase- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing- (Just coupon)- Nothing- Nothing- Nothing- Nothing- Nothing- []- Subscription { subscriptionId = sid } <-- createSubscription customerid plan []- void $ updateSubscription customerid sid (Just coupon) Nothing []- result <- deleteSubscriptionDiscount customerid sid- void $ deletePlan planid- void $ deleteCustomer customerid- void $ deleteCoupon couponid- return result- result `shouldSatisfy` isRight----
− tests/Test/Dispute.hs
@@ -1,99 +0,0 @@-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE OverloadedStrings #-}-module Test.Dispute where--import Data.Either (isRight)-import Control.Monad (void)-import Control.Concurrent (threadDelay)-import Control.Monad.IO.Class (liftIO)--import Test.Hspec-import Test.Util--import Web.Stripe-import Web.Stripe.Dispute-import Web.Stripe.Charge-import Web.Stripe.Customer--disputeTests :: StripeConfig -> Spec-disputeTests config = do- describe "Dispute Tests" $ do- it "Creates a Dispute" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- liftIO $ threadDelay (secs 20) -- Sleep the thread to allow the dispute to happen- Charge { chargeDispute = cd } <- getCharge chid- void $ deleteCustomer cid- return cd- result `shouldSatisfy` isRight- let Right (Just Dispute{..}) = result - disputeStatus `shouldBe` NeedsResponse- it "Makes Dispute Under Review" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- liftIO $ threadDelay (secs 10)- void $ updateDispute chid evi meta- liftIO $ threadDelay (secs 10)- Charge { chargeDispute = Just dispute } <- getCharge chid- void $ deleteCustomer cid- return dispute- result `shouldSatisfy` isRight- let Right Dispute {..} = result - disputeMetaData `shouldBe` meta- disputeEvidence `shouldBe` evi- disputeStatus `shouldBe` UnderReview- it "Wins a Dispute" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- liftIO $ threadDelay (secs 10)- void $ updateDispute chid win meta- liftIO $ threadDelay (secs 10)- Charge { chargeDispute = Just dispute } <- getCharge chid- void $ deleteCustomer cid- return dispute- result `shouldSatisfy` isRight- let Right Dispute {..} = result - disputeMetaData `shouldBe` meta- disputeEvidence `shouldBe` win- disputeStatus `shouldBe` Won- it "Loses a Dispute" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- liftIO $ threadDelay (secs 10) -- Sleep to allow the thread to dispute to happen- void $ updateDispute chid lose meta- liftIO $ threadDelay (secs 10)- Charge { chargeDispute = Just dispute } <- getCharge chid- void $ deleteCustomer cid- return dispute- result `shouldSatisfy` isRight- let Right Dispute {..} = result - disputeMetaData `shouldBe` meta- disputeEvidence `shouldBe` lose- disputeStatus `shouldBe` Lost- it "Closes a Dispute" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- liftIO $ threadDelay (secs 10) -- Sleep to allow the thread to dispute to happen- dispute <- closeDispute chid- void $ deleteCustomer cid- return dispute- result `shouldSatisfy` isRight- let Right Dispute {..} = result - disputeStatus `shouldBe` Lost- where- cn = CardNumber "4000000000000259"- em = ExpMonth 12- ey = ExpYear 2015- cvc = CVC "123"- win = Just $ Evidence "winning_evidence"- lose = Just $ Evidence "losing_evidence"- evi = Just $ Evidence "some evidence"- meta = [ ("some", "metadata") ]---
− tests/Test/Event.hs
@@ -1,18 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-module Test.Event where--import Data.Either--import Test.Hspec--import Web.Stripe-import Web.Stripe.Event--eventTests :: StripeConfig -> Spec-eventTests config = do- describe "Event tests" $ do- it "Succesfully retrieves events" $ do- result <- stripe config $ getEvents Nothing Nothing Nothing- result `shouldSatisfy` isRight--
− tests/Test/Invoice.hs
@@ -1,98 +0,0 @@-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE OverloadedStrings #-}-module Test.Invoice where--import Data.Either--import Control.Monad (void)-import Test.Util -import Test.Hspec--import Web.Stripe-import Web.Stripe.Invoice-import Web.Stripe.Plan-import Web.Stripe.Customer-import Web.Stripe.InvoiceItem--invoiceTests :: StripeConfig -> Spec-invoiceTests config = do- describe "Invoice tests" $ do- it "Create an Invoice via Invoice item on a Customer" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- InvoiceItem { } <- createInvoiceItem cid 100 USD Nothing Nothing Nothing []- i <- createInvoice cid meta - void $ deleteCustomer cid- return i- result `shouldSatisfy` isRight- it "Retrieve an Invoice" $ do- planid <- makePlanId- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- Plan { } <- createPlan planid 20 USD Day "testplan" []- InvoiceItem { } <- createInvoiceItem cid 100 USD Nothing Nothing Nothing []- Invoice { invoiceId = Just iid } <- createInvoice cid meta - getInvoice iid- result `shouldSatisfy` isRight- it "Retrieve an Invoice Expanded" $ do- planid <- makePlanId- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- Plan { } <- createPlan planid 20 USD Day "testplan" []- InvoiceItem { } <- createInvoiceItem cid 100 USD Nothing Nothing Nothing []- Invoice { invoiceId = Just iid } <- createInvoice cid meta - getInvoiceExpandable iid ["customer", "charge"]- result `shouldSatisfy` isRight- it "Retrieve an Invoice's Line Items" $ do- planid <- makePlanId- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- Plan { } <- createPlan planid 20 USD Day "testplan" []- InvoiceItem { } <- createInvoiceItem cid 100 USD Nothing Nothing Nothing []- Invoice { invoiceId = Just iid } <- createInvoice cid meta - getInvoiceLineItems iid Nothing Nothing Nothing- result `shouldSatisfy` isRight- it "Retrieve Invoices" $ do- result <- stripe config $ getInvoices Nothing Nothing Nothing - result `shouldSatisfy` isRight- it "Retrieve Invoices Expandable" $ do- result <- stripe config $ getInvoicesExpandable Nothing Nothing Nothing- ["data.customer", "data.charge"]- result `shouldSatisfy` isRight- it "Updates an Invoice" $ do- planid <- makePlanId- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- Plan { } <- createPlan planid 20 USD Day "testplan" []- InvoiceItem { } <- createInvoiceItem cid 100 USD Nothing Nothing Nothing []- Invoice { invoiceId = Just iid } <- createInvoice cid meta - updateInvoice iid [("some", "thing")]- result `shouldSatisfy` isRight- let Right Invoice {..} = result- invoiceMetaData `shouldBe` [("some", "thing")]- it "Retrieve an Upcoming Invoice" $ do- planid <- makePlanId- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- Plan { } <- createPlan planid 20 USD Day "testplan" []- InvoiceItem { } <- createInvoiceItem cid 100 USD Nothing Nothing Nothing []- getUpcomingInvoice cid- result `shouldSatisfy` isRight- it "Pay an Invoice" $ do- planid <- makePlanId- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard credit em ey cvc- Plan { } <- createPlan planid 20 USD Day "testplan" []- InvoiceItem { } <- createInvoiceItem cid 100 USD Nothing Nothing Nothing []- Invoice { invoiceId = Just iid } <- createInvoice cid meta - payInvoice iid- result `shouldSatisfy` isRight- let Right Invoice{..} = result - invoicePaid `shouldBe` True- where- meta = [ ("some","metadata") ]- credit = CardNumber "4242424242424242"- em = ExpMonth 12- ey = ExpYear 2015- cvc = CVC "123"-
− tests/Test/InvoiceItem.hs
@@ -1,83 +0,0 @@-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE OverloadedStrings #-}-module Test.InvoiceItem where--import Data.Either--import Test.Hspec--import Web.Stripe-import Web.Stripe.InvoiceItem-import Web.Stripe.Customer--invoiceItemTests :: StripeConfig -> Spec-invoiceItemTests config = do- describe "Invoice item tests" $ do- it "Succesfully creates an invoice item" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- ii <- createInvoiceItem cid 100 USD Nothing Nothing (Just "hey") []- _ <- deleteCustomer cid- return ii- result `shouldSatisfy` isRight- it "Succesfully retrieves an existing invoice item" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- InvoiceItem { invoiceItemId = iid } <-- createInvoiceItem cid 100 USD Nothing Nothing (Just "hey") []- ii <- getInvoiceItem iid- _ <- deleteCustomer cid- return ii - result `shouldSatisfy` isRight- it "Succesfully retrieves an existing invoice item expandable" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- InvoiceItem { invoiceItemId = iid } <-- createInvoiceItem cid 100 USD Nothing Nothing (Just "hey") []- ii <- getInvoiceItemExpandable iid ["customer"]- _ <- deleteCustomer cid- return ii- result `shouldSatisfy` isRight- it "Succesfully retrieves invoice items" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- InvoiceItem { } <-- createInvoiceItem cid 100 USD Nothing Nothing (Just "hey") []- ii <- getInvoiceItems Nothing Nothing Nothing Nothing - _ <- deleteCustomer cid- return ii- result `shouldSatisfy` isRight- it "Succesfully retrieves invoice items with expansion" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- InvoiceItem { } <-- createInvoiceItem cid 100 USD Nothing Nothing (Just "hey") []- ii <- getInvoiceItemsExpandable Nothing Nothing Nothing Nothing ["data.customer"]- _ <- deleteCustomer cid- return ii- result `shouldSatisfy` isRight- it "Succesfully updates an existing invoice item" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- InvoiceItem { invoiceItemId = iid } <-- createInvoiceItem cid 100 USD Nothing Nothing (Just "hey") []- ii <- updateInvoiceItem iid (Just 200) (Just "description") [("some","thing")]- _ <- deleteCustomer cid- return ii- result `shouldSatisfy` isRight- let Right InvoiceItem{..} = result- invoiceItemMetaData `shouldBe` [("some","thing")]- invoiceItemDescription `shouldBe` Just "description"- invoiceItemAmount `shouldBe` 200- it "Succesfully deletes an invoice item" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- InvoiceItem { invoiceItemId = iid } <-- createInvoiceItem cid 100 USD Nothing Nothing (Just "hey") []- result <- deleteInvoiceItem iid- _ <- deleteCustomer cid- return result- result `shouldSatisfy` isRight---
− tests/Test/Plan.hs
@@ -1,114 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-module Test.Plan where--import Control.Monad (void)-import Data.Either (isRight)-import Data.Time--import Test.Hspec-import Test.Util (makePlanId)--import Web.Stripe-import Web.Stripe.Plan-import Web.Stripe.Customer--planTests :: StripeConfig -> Spec-planTests config = do- describe "Plan tests" $ do- it "Succesfully creates a Plan" $ do- planid <- makePlanId- result <- stripe config $ do- p <- createPlan planid- 0 -- free plan- USD- Month- "sample plan"- []- void $ deletePlan planid- return p- result `shouldSatisfy` isRight- it "Succesfully deletes a Plan" $ do- planid <- makePlanId- result <- stripe config $ do- Plan { planId = pid } <-- createPlan planid- 0 -- free plan- USD- Month- "sample plan"- []- deletePlan pid- result `shouldSatisfy` isRight- it "Succesfully updates a Plan" $ do- planid <- makePlanId- result <- stripe config $ do- Plan { planId = pid } <-- createPlan planid- 0 -- free plan- USD- Month- "sample plan"- []- r <- updatePlanBase pid (Just "cookie")- (Just "test")- [("key","value")]- void $ deletePlan pid- return r- result `shouldSatisfy` isRight- let Right Plan { planMetaData = pm- , planName = pname- , planDescription = pdesc- } = result- pm `shouldBe` [("key", "value")]- pname `shouldBe` "cookie"- pdesc `shouldBe` Just "test"- it "Succesfully creates a Plan with a TrialPeriod" $ do- planid <- makePlanId- today <- getCurrentTime- let trialPeriod = UTCTime (addDays 14 $ utctDay today) (utctDayTime today)- result <- stripe config $ do- p <- createPlan planid- 100 -- lets charge for it- USD- Month- "sample 100 plan"- []- c <- createCustomerBase Nothing- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing -- couponId- Nothing- (Just $ Email "test@example.com")- (Just planid)- Nothing- (Just $ TrialPeriod trialPeriod)- []- void $ deletePlan planid- void $ deleteCustomer $ customerId c- return (p, c)- result `shouldSatisfy` isRight-- it "Succesfully retrieves a Plan" $ do- planid <- makePlanId- result <- stripe config $ do- Plan { planId = pid } <-- createPlan planid- 0 -- free plan- USD- Month- "sample plan"- []- r <- getPlan pid- void $ deletePlan pid- return r- result `shouldSatisfy` isRight- it "Succesfully retrieves a list of Plans" $ do- result <- stripe config $ getPlans Nothing Nothing Nothing- result `shouldSatisfy` isRight----
− tests/Test/Raw.hs
@@ -1,37 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-module Test.Raw (rawTest) where--import Data.Aeson-import Data.Either-import Data.Monoid ((<>))-import Data.Text (Text)-import qualified Data.Text.Encoding as T-import Network.Http.Client-import Test.Hspec-import Web.Stripe--rawTest :: StripeConfig -> Spec-rawTest config = do- describe "Raw tests" $ do- it "Succesfully retrieves account information" $ do- result <- (stripeRaw config req) :: IO (Either StripeError Value)- result `shouldSatisfy` isRight- it "Succesfully encodes x-www-form-urlencoded data" $ do- let pid = "encoded"- -- Add form data to the request with special characters- result <- (stripeRaw config (req2 pid)) :: IO (Either StripeError Value)- result `shouldSatisfy` isRight- del <- (stripeRaw config (delReq2 pid)) :: IO (Either StripeError Value)- del `shouldSatisfy` isRight- where- req :: StripeRequest- req = StripeRequest GET "events" []- req2 :: Text -> StripeRequest- req2 pid = StripeRequest POST "plans" [ ("amount", "2000")- , ("interval", "month")- , ("name","<Acme & Co. Gold Plan+>" )- , ("currency","usd" )- , ("id", T.encodeUtf8 pid)- ]- delReq2 :: Text -> StripeRequest- delReq2 pid = StripeRequest DELETE ("plans/" <> pid) []
− tests/Test/Recipient.hs
@@ -1,116 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}-module Test.Recipient where--import Data.Either-import Test.Hspec-import Control.Monad--import Web.Stripe-import Web.Stripe.Recipient--recipientTests :: StripeConfig -> Spec-recipientTests config = do- describe "Recipient tests" $ do- it "Succesfully creates an Individual Recipient" $ do- result <- stripe config $ do- recipient@Recipient { recipientId = rid } <- createRecipient- firstName- lastName- initial- Individual- void $ deleteRecipient rid- return recipient- result `shouldSatisfy` isRight- let Right Recipient {..} = result- recipientType `shouldBe` Individual - it "Succesfully creates a Corporation Recipient" $ do- result <- stripe config $ do- recipient@Recipient { recipientId = rid } <-- createRecipient- firstName- lastName- initial- Corporation- void $ deleteRecipient rid- return recipient- result `shouldSatisfy` isRight- let Right Recipient {..} = result- recipientType `shouldBe` Corporation- it "Succesfully retrieves a Recipient" $ do- result <- stripe config $ do- Recipient { recipientId = rid } <-- createRecipient- firstName- lastName- initial- Corporation- recipient <- getRecipient rid- void $ deleteRecipient rid- return recipient- result `shouldSatisfy` isRight- let Right Recipient {..} = result- recipientType `shouldBe` Corporation- it "Succesfully retrieves a Recipient" $ do- result <- stripe config $ do- Recipient { recipientId = rid } <-- createRecipient- firstName- lastName- initial- Corporation- recipient <- getRecipient rid- void $ deleteRecipient rid- return recipient- result `shouldSatisfy` isRight- let Right Recipient {..} = result- recipientType `shouldBe` Corporation- it "Succesfully updates a Recipient" $ do- result <- stripe config $ do- Recipient { recipientId = rid } <-- createRecipient- firstName- lastName- initial- Corporation- recipient <- updateRecipientBase rid- (Just firstName)- (Just lastName)- initial- taxid- country- routingnumber- accountnumber- Nothing Nothing Nothing Nothing Nothing- Nothing email description meta- void $ deleteRecipient rid- return recipient- result `shouldSatisfy` isRight- let Right Recipient {..} = result- recipientType `shouldBe` Corporation- recipientName `shouldBe` "david M johnson"- recipientDescription `shouldBe` description- recipientEmail `shouldBe` email- it "Succesfully deletes a Recipient" $ do- result <- stripe config $ do- Recipient { recipientId = rid } <-- createRecipient- firstName- lastName- initial- Corporation- deleteRecipient rid- result `shouldSatisfy` isRight--- where firstName = FirstName "david"- lastName = LastName "johnson"- initial = Just 'M'- meta = [("this", "thing")]- email = Just $ Email "djohnson.m@gmail.com"- country = Just $ Country "US"- description = Just "description"- routingnumber = Just $ RoutingNumber "110000000"- accountnumber = Just $ AccountNumber "000123456789"- taxid = Just "000000000"-
− tests/Test/Refund.hs
@@ -1,96 +0,0 @@-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE OverloadedStrings #-}-module Test.Refund where--import Control.Monad-import Data.Either--import Test.Hspec--import Web.Stripe-import Web.Stripe.Charge-import Web.Stripe.Customer-import Web.Stripe.Refund----------------------------------------------------------------------------------- | Card Info-cn :: CardNumber-cn = CardNumber "4242424242424242"--em :: ExpMonth-em = ExpMonth 12--ey :: ExpYear-ey = ExpYear 2015--cvc :: CVC-cvc = CVC "123"----------------------------------------------------------------------------------- | Refund Tests-refundTests :: StripeConfig -> Spec-refundTests config = do- describe "Refund Tests" $ do- it "Creates a refund succesfully" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- refund <- createRefund chid []- void $ deleteCustomer cid- return refund- result `shouldSatisfy` isRight- it "Retrieves a refund succesfully" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- Refund { refundId = rid } <- createRefund chid []- void $ deleteCustomer cid- getRefund chid rid- result `shouldSatisfy` isRight- it "Retrieves a refund succesfully with expansion" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- Refund { refundId = rid } <- createRefund chid []- r <- getRefundExpandable chid rid ["balance_transaction"]- void $ deleteCustomer cid - return r- result `shouldSatisfy` isRight- it "Updates a refund succesfully" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- Refund { refundId = rid } <- createRefund chid []- ref <- updateRefund chid rid [("hello","there")]- void $ deleteCustomer cid- return ref- result `shouldSatisfy` isRight- let Right Refund{..} = result- refundMetaData `shouldBe` [("hello","there")]- it "Retrieves all refunds for a Charge" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- Refund { } <- createRefund chid []- r <- getRefunds chid Nothing Nothing Nothing- void $ deleteCustomer cid- return r- result `shouldSatisfy` isRight- let Right StripeList {..} = result- length list `shouldBe` 1- it "Retrieves all refunds for a Charge with expansion" $ do- result <- stripe config $ do- Customer { customerId = cid } <- createCustomerByCard cn em ey cvc- Charge { chargeId = chid } <- chargeCustomer cid USD 100 Nothing- Refund { } <- createRefund chid []- r <- getRefundsExpandable chid Nothing Nothing Nothing ["data.balance_transaction"]- void $ deleteCustomer cid- return r- result `shouldSatisfy` isRight- let Right StripeList {..} = result- length list `shouldBe` 1-----
− tests/Test/Subscription.hs
@@ -1,157 +0,0 @@-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE OverloadedStrings #-}-module Test.Subscription where--import Data.Either-import Control.Monad-import Data.Maybe--import Test.Hspec-import Test.Util--import Web.Stripe-import Web.Stripe.Subscription-import Web.Stripe.Customer-import Web.Stripe.Plan-import Web.Stripe.Coupon--subscriptionTests :: StripeConfig -> Spec-subscriptionTests config = do- describe "Subscription tests" $ do- it "Succesfully creates a Subscription" $ do- planid <- makePlanId- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- void $ createPlan planid- 0 -- free plan- USD- Month- "sample plan"- []- sub <- createSubscription cid planid []- void $ deletePlan planid- void $ deleteCustomer cid- return sub- result `shouldSatisfy` isRight- it "Succesfully retrieves a Subscription" $ do- planid <- makePlanId- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- void $ createPlan planid- 0 -- free plan- USD- Month- "sample plan"- []- Subscription { subscriptionId = sid } <- createSubscription cid planid []- sub <- getSubscription cid sid- void $ deletePlan planid- void $ deleteCustomer cid- return sub- result `shouldSatisfy` isRight- it "Succesfully retrieves a Subscription expanded" $ do- planid <- makePlanId- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- void $ createPlan planid- 0 -- free plan- USD- Month- "sample plan"- []- Subscription { subscriptionId = sid } <- createSubscription cid planid []- sub <- getSubscriptionExpandable cid sid ["customer"]- void $ deletePlan planid- void $ deleteCustomer cid- return sub- result `shouldSatisfy` isRight- it "Succesfully retrieves a Customer's Subscriptions expanded" $ do- planid <- makePlanId- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- void $ createPlan planid- 0 -- free plan- USD- Month- "sample plan"- []- void $ createSubscription cid planid []- sub <- getSubscriptionsExpandable cid Nothing Nothing Nothing ["data.customer"]- void $ deletePlan planid- void $ deleteCustomer cid- return sub- result `shouldSatisfy` isRight- it "Succesfully retrieves a Customer's Subscriptions" $ do- planid <- makePlanId- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- void $ createPlan planid- 0 -- free plan- USD- Month- "sample plan"- []- void $ createSubscription cid planid []- sub <- getSubscriptions cid Nothing Nothing Nothing - void $ deletePlan planid- void $ deleteCustomer cid- return sub- result `shouldSatisfy` isRight- it "Succesfully updates a Customer's Subscriptions" $ do- planid <- makePlanId- secondPlanid <- makePlanId- couponid <- makeCouponId- result <- stripe config $ do- Coupon { } <-- createCoupon- (Just couponid)- Once- (Just $ AmountOff 1)- (Just USD)- Nothing- Nothing- Nothing- Nothing- []- Customer { customerId = cid } <- createEmptyCustomer- void $ createPlan planid- 0 -- free plan- USD- Month- "sample plan"- []- void $ createPlan secondPlanid- 0 -- free plan- USD- Year- "second sample plan"- []- Subscription { subscriptionId = sid } <- createSubscription cid planid []- _ <- updateSubscription cid sid (Just couponid) Nothing [("hi","there")]- sub <- updateSubscription cid sid (Just couponid) (Just secondPlanid) [("hi","there")]- void $ deletePlan planid- void $ deletePlan secondPlanid- void $ deleteCustomer cid- return sub- result `shouldSatisfy` isRight- let Right Subscription {..} = result- subscriptionMetaData `shouldBe` [("hi", "there")]- subscriptionDiscount `shouldSatisfy` isJust- it "Succesfully cancels a Customer's Subscription" $ do- planid <- makePlanId- result <- stripe config $ do- Customer { customerId = cid } <- createEmptyCustomer- void $ createPlan planid- 0 -- free plan- USD- Month- "sample plan"- []- Subscription { subscriptionId = sid } <- createSubscription cid planid []- sub <- cancelSubscription cid sid False- void $ deletePlan planid- void $ deleteCustomer cid- return sub- result `shouldSatisfy` isRight- let Right Subscription {..} = result- subscriptionStatus `shouldBe` Canceled
− tests/Test/Token.hs
@@ -1,44 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}-module Test.Token where--import Data.Either-import Test.Hspec-import Web.Stripe-import Web.Stripe.Token--tokenTests :: StripeConfig -> Spec-tokenTests config = do- describe "Token tests" $ do- it "Can create a Card Token" $ do- result <- stripe config $ createCardToken cn em ey cvc- result `shouldSatisfy` isRight- it "Can create a Bank Account Token" $ do- result <- stripe config $ createBankAccountToken- (Country "US")- (RoutingNumber "110000000")- (AccountNumber "000123456789")- result `shouldSatisfy` isRight- it "Can retrieve an Existing Card Token" $ do- result <- stripe config $ do- Token { tokenId = tkid } <- createCardToken cn em ey cvc- getCardToken tkid- result `shouldSatisfy` isRight- it "Can retrieve an Existing Bank Account Token" $ do- result <- stripe config $ do- Token { tokenId = tkid } <- createBankAccountToken- (Country "US")- (RoutingNumber "110000000")- (AccountNumber "000123456789")- getBankAccountToken tkid- result `shouldSatisfy` isRight- where- cn = CardNumber "4242424242424242"- em = ExpMonth 12- ey = ExpYear 2015- cvc = CVC "123"--- - -
− tests/Test/Transfer.hs
@@ -1,117 +0,0 @@-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE OverloadedStrings #-}-module Test.Transfer where--import Data.Either-import Control.Monad-import Test.Hspec--import Web.Stripe-import Web.Stripe.Recipient-import Web.Stripe.Transfer--transferTests :: StripeConfig -> Spec-transferTests config = do- describe "Transfer tests" $ do- it "Create a new transfer" $ do- result <- stripe config $ do- Recipient { recipientId = rid } <-- createRecipientByBank- firstname- lastname- Nothing- Individual- country- routingnumber- accountnumber- transfer <- createTransfer rid (100 :: Amount) USD []- void $ deleteRecipient rid- return transfer- result `shouldSatisfy` isRight- it "Retrieves a transfer" $ do- result <- stripe config $ do- Recipient { recipientId = rid } <-- createRecipientByBank- firstname- lastname- Nothing- Individual- country- routingnumber- accountnumber- Transfer { transferId = tid }- <- createTransfer rid (100 :: Amount) USD []- t <- getTransfer tid- void $ deleteRecipient rid- return t- result `shouldSatisfy` isRight- it "Retrieves a transfer expandable" $ do- result <- stripe config $ do- Recipient { recipientId = rid } <-- createRecipientByBank- firstname- lastname- Nothing- Individual- country- routingnumber- accountnumber- Transfer { transferId = tid }- <- createTransfer rid (100 :: Amount) USD []- t <- getTransferExpandable tid ["recipient", "balance_transaction"]- void $ deleteRecipient rid- return t- result `shouldSatisfy` isRight- it "Retrieves transfers" $ do- result <- stripe config $ getTransfers Nothing Nothing Nothing - result `shouldSatisfy` isRight- it "Retrieves transfers expandable" $ do- result <- stripe config $ getTransfersExpandable Nothing Nothing Nothing- [ "data.recipient"- , "data.balance_transaction"- ]- result `shouldSatisfy` isRight- it "Updates a transfer" $ do- result <- stripe config $ do- Recipient { recipientId = rid } <-- createRecipientByBank- firstname- lastname- Nothing- Individual- country- routingnumber- accountnumber- Transfer { transferId = tid }- <- createTransfer rid (100 :: Amount) USD []- t <- updateTransfer tid (Just "hey there") [("hey", "there")]- void $ deleteRecipient rid- return t- result `shouldSatisfy` isRight- let Right Transfer {..} = result- transferMetaData `shouldBe` [("hey", "there")] - transferDescription `shouldBe` Just "hey there"- it "Can't Cancel a committed transfer" $ do- result <- stripe config $ do- Recipient { recipientId = rid } <-- createRecipientByBank- firstname- lastname- Nothing- Individual- country- routingnumber- accountnumber- Transfer { transferId = tid }- <- createTransfer rid (100 :: Amount) USD []- t <- cancelTransfer tid - void $ deleteRecipient rid- return t- result `shouldSatisfy` isLeft- where- country = Country "US"- routingnumber = RoutingNumber "110000000"- accountnumber = AccountNumber "000123456789"- firstname = FirstName "David"- lastname = LastName "Johnson"-
− tests/Test/Util.hs
@@ -1,36 +0,0 @@-module Test.Util- ( -- * Helpers- makePlanId- , makeCouponId- , secs- ) where--import System.Random-import Control.Applicative-import qualified Data.Text as T-import Data.Text (Text)-import Control.Monad--import Web.Stripe.Plan-import Web.Stripe.Coupon----------------------------------------------------------------------------------- | `PlanId` creation helper-makePlanId :: IO PlanId-makePlanId = PlanId <$> makeGuid----------------------------------------------------------------------------------- | `CouponId` creation helper-makeCouponId :: IO CouponId-makeCouponId = CouponId <$> makeGuid----------------------------------------------------------------------------------- | Guid Creation Helper-makeGuid :: IO Text-makeGuid = T.pack <$> replicateM 10 (randomRIO ('a', 'z'))----------------------------------------------------------------------------------- | Seconds-secs :: Int -> Int-secs = (*1000000)-