Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type ApiKey = Text
- data StripeClient
- makeStripeClient :: ApiKey -> Manager -> Int -> StripeClient
- data ClientError
- newtype TimeStamp = TimeStamp {}
- data StripeList a = StripeList {}
- createCustomer :: StripeClient -> CustomerCreate -> IO (Either ClientError Customer)
- retrieveCustomer :: StripeClient -> CustomerId -> IO (Either ClientError Customer)
- updateCustomer :: StripeClient -> CustomerId -> CustomerUpdate -> IO (Either ClientError Customer)
- listCustomers :: StripeClient -> Maybe CustomerId -> IO (Either ClientError (StripeList Customer))
- newtype CustomerId = CustomerId {
- unCustomerId :: Text
- data Customer = Customer {}
- data CustomerCreate = CustomerCreate {}
- data CustomerUpdate = CustomerUpdate {}
- newtype ProductId = ProductId {
- unProductId :: Text
- newtype PriceId = PriceId {}
- data Product = Product {}
- data Price = Price {}
- data PriceRecurring = PriceRecurring {
- prInterval :: Text
- prIntervalCount :: Int
- data ProductCreate = ProductCreate {
- prcName :: Text
- prcDescription :: Maybe Text
- data PriceCreate = PriceCreate {}
- data PriceCreateRecurring = PriceCreateRecurring {}
- createProduct :: StripeClient -> ProductCreate -> IO (Either ClientError Product)
- retrieveProduct :: StripeClient -> ProductId -> IO (Either ClientError Product)
- createPrice :: StripeClient -> PriceCreate -> IO (Either ClientError Price)
- retrievePrice :: StripeClient -> PriceId -> IO (Either ClientError Price)
- listPrices :: StripeClient -> Maybe Text -> IO (Either ClientError (StripeList Price))
- newtype SubscriptionId = SubscriptionId {}
- newtype SubscriptionItemId = SubscriptionItemId {}
- data Subscription = Subscription {}
- data SubscriptionItem = SubscriptionItem {}
- data SubscriptionCreate = SubscriptionCreate {}
- data SubscriptionCreateItem = SubscriptionCreateItem {
- sciPrice :: PriceId
- sciQuantity :: Maybe Int
- createSubscription :: StripeClient -> SubscriptionCreate -> IO (Either ClientError Subscription)
- retrieveSubscription :: StripeClient -> SubscriptionId -> IO (Either ClientError Subscription)
- listSubscriptions :: StripeClient -> Maybe CustomerId -> IO (Either ClientError (StripeList Subscription))
- newtype CustomerPortalId = CustomerPortalId {}
- data CustomerPortal = CustomerPortal {}
- data CustomerPortalCreate = CustomerPortalCreate {}
- createCustomerPortal :: StripeClient -> CustomerPortalCreate -> IO (Either ClientError CustomerPortal)
- newtype CheckoutSessionId = CheckoutSessionId {}
- data CheckoutSession = CheckoutSession {}
- data CheckoutSessionCreate = CheckoutSessionCreate {}
- data CheckoutSessionCreateLineItem = CheckoutSessionCreateLineItem {}
- createCheckoutSession :: StripeClient -> CheckoutSessionCreate -> IO (Either ClientError CheckoutSession)
- retrieveCheckoutSession :: StripeClient -> CheckoutSessionId -> IO (Either ClientError CheckoutSession)
- retrieveEvent :: StripeClient -> EventId -> IO (Either ClientError Event)
- listEvents :: StripeClient -> Maybe EventId -> IO (Either ClientError (StripeList Event))
- newtype EventId = EventId {}
- data Event = Event {}
- data EventData = EventData {}
Basics
data StripeClient Source #
Holds a Manager
and your API key.
:: ApiKey | |
-> Manager | |
-> Int | Number of automatic retries the library should attempt. See also Stripe Error Handling |
-> StripeClient |
Construct a StripeClient
. Note that the passed Manager
must support https (e.g. via http-client-tls
)
data ClientError #
A type representing possible errors in a request
Note that this type substantially changed in 0.12.
FailureResponse (RequestF () (BaseUrl, ByteString)) Response | The server returned an error response including the
failing request. |
DecodeFailure Text Response | The body could not be decoded at the expected type |
UnsupportedContentType MediaType Response | The content-type of the response is not supported |
InvalidContentTypeHeader Response | The content-type header is invalid |
ConnectionError SomeException | There was a connection error, and no response was received |
Instances
Helper types
A UTCTime
wrapper that has unix timestamp JSON representation
Instances
Eq TimeStamp | |
Show TimeStamp | |
ToJSON TimeStamp | |
Defined in Stripe.Resources | |
FromJSON TimeStamp | |
ToHttpApiData TimeStamp | |
Defined in Stripe.Resources toUrlPiece :: TimeStamp -> Text # toEncodedUrlPiece :: TimeStamp -> Builder # toHeader :: TimeStamp -> ByteString # toQueryParam :: TimeStamp -> Text # |
data StripeList a #
A Vector
wrapper with an indication is there are more items available through pagination.
Instances
Customers
createCustomer :: StripeClient -> CustomerCreate -> IO (Either ClientError Customer) Source #
retrieveCustomer :: StripeClient -> CustomerId -> IO (Either ClientError Customer) Source #
updateCustomer :: StripeClient -> CustomerId -> CustomerUpdate -> IO (Either ClientError Customer) Source #
listCustomers :: StripeClient -> Maybe CustomerId -> IO (Either ClientError (StripeList Customer)) Source #
newtype CustomerId #
Instances
Eq CustomerId | |
Defined in Stripe.Resources (==) :: CustomerId -> CustomerId -> Bool # (/=) :: CustomerId -> CustomerId -> Bool # | |
Show CustomerId | |
Defined in Stripe.Resources showsPrec :: Int -> CustomerId -> ShowS # show :: CustomerId -> String # showList :: [CustomerId] -> ShowS # | |
ToJSON CustomerId | |
Defined in Stripe.Resources toJSON :: CustomerId -> Value # toEncoding :: CustomerId -> Encoding # toJSONList :: [CustomerId] -> Value # toEncodingList :: [CustomerId] -> Encoding # | |
FromJSON CustomerId | |
Defined in Stripe.Resources parseJSON :: Value -> Parser CustomerId # parseJSONList :: Value -> Parser [CustomerId] # | |
ToHttpApiData CustomerId | |
Defined in Stripe.Resources toUrlPiece :: CustomerId -> Text # toEncodedUrlPiece :: CustomerId -> Builder # toHeader :: CustomerId -> ByteString # toQueryParam :: CustomerId -> Text # |
data CustomerCreate #
Instances
data CustomerUpdate #
Instances
Product catalog
Instances
Eq ProductId | |
Show ProductId | |
ToJSON ProductId | |
Defined in Stripe.Resources | |
FromJSON ProductId | |
ToHttpApiData ProductId | |
Defined in Stripe.Resources toUrlPiece :: ProductId -> Text # toEncodedUrlPiece :: ProductId -> Builder # toHeader :: ProductId -> ByteString # toQueryParam :: ProductId -> Text # |
Instances
Eq PriceId | |
Show PriceId | |
ToJSON PriceId | |
Defined in Stripe.Resources | |
FromJSON PriceId | |
ToHttpApiData PriceId | |
Defined in Stripe.Resources toUrlPiece :: PriceId -> Text # toEncodedUrlPiece :: PriceId -> Builder # toHeader :: PriceId -> ByteString # toQueryParam :: PriceId -> Text # |
data PriceRecurring #
Instances
Eq PriceRecurring | |
Defined in Stripe.Resources (==) :: PriceRecurring -> PriceRecurring -> Bool # (/=) :: PriceRecurring -> PriceRecurring -> Bool # | |
Show PriceRecurring | |
Defined in Stripe.Resources showsPrec :: Int -> PriceRecurring -> ShowS # show :: PriceRecurring -> String # showList :: [PriceRecurring] -> ShowS # | |
ToJSON PriceRecurring | |
Defined in Stripe.Resources toJSON :: PriceRecurring -> Value # toEncoding :: PriceRecurring -> Encoding # toJSONList :: [PriceRecurring] -> Value # toEncodingList :: [PriceRecurring] -> Encoding # | |
FromJSON PriceRecurring | |
Defined in Stripe.Resources parseJSON :: Value -> Parser PriceRecurring # parseJSONList :: Value -> Parser [PriceRecurring] # |
data ProductCreate #
Instances
data PriceCreate #
Instances
data PriceCreateRecurring #
Instances
Eq PriceCreateRecurring | |
Defined in Stripe.Resources (==) :: PriceCreateRecurring -> PriceCreateRecurring -> Bool # (/=) :: PriceCreateRecurring -> PriceCreateRecurring -> Bool # | |
Show PriceCreateRecurring | |
Defined in Stripe.Resources showsPrec :: Int -> PriceCreateRecurring -> ShowS # show :: PriceCreateRecurring -> String # showList :: [PriceCreateRecurring] -> ShowS # |
createProduct :: StripeClient -> ProductCreate -> IO (Either ClientError Product) Source #
retrieveProduct :: StripeClient -> ProductId -> IO (Either ClientError Product) Source #
createPrice :: StripeClient -> PriceCreate -> IO (Either ClientError Price) Source #
retrievePrice :: StripeClient -> PriceId -> IO (Either ClientError Price) Source #
listPrices :: StripeClient -> Maybe Text -> IO (Either ClientError (StripeList Price)) Source #
Subscriptions
newtype SubscriptionId #
Instances
Eq SubscriptionId | |
Defined in Stripe.Resources (==) :: SubscriptionId -> SubscriptionId -> Bool # (/=) :: SubscriptionId -> SubscriptionId -> Bool # | |
Show SubscriptionId | |
Defined in Stripe.Resources showsPrec :: Int -> SubscriptionId -> ShowS # show :: SubscriptionId -> String # showList :: [SubscriptionId] -> ShowS # | |
ToJSON SubscriptionId | |
Defined in Stripe.Resources toJSON :: SubscriptionId -> Value # toEncoding :: SubscriptionId -> Encoding # toJSONList :: [SubscriptionId] -> Value # toEncodingList :: [SubscriptionId] -> Encoding # | |
FromJSON SubscriptionId | |
Defined in Stripe.Resources parseJSON :: Value -> Parser SubscriptionId # parseJSONList :: Value -> Parser [SubscriptionId] # | |
ToHttpApiData SubscriptionId | |
Defined in Stripe.Resources toUrlPiece :: SubscriptionId -> Text # toEncodedUrlPiece :: SubscriptionId -> Builder # toHeader :: SubscriptionId -> ByteString # toQueryParam :: SubscriptionId -> Text # |
newtype SubscriptionItemId #
Instances
Eq SubscriptionItemId | |
Defined in Stripe.Resources (==) :: SubscriptionItemId -> SubscriptionItemId -> Bool # (/=) :: SubscriptionItemId -> SubscriptionItemId -> Bool # | |
Show SubscriptionItemId | |
Defined in Stripe.Resources showsPrec :: Int -> SubscriptionItemId -> ShowS # show :: SubscriptionItemId -> String # showList :: [SubscriptionItemId] -> ShowS # | |
ToJSON SubscriptionItemId | |
Defined in Stripe.Resources toJSON :: SubscriptionItemId -> Value # toEncoding :: SubscriptionItemId -> Encoding # toJSONList :: [SubscriptionItemId] -> Value # toEncodingList :: [SubscriptionItemId] -> Encoding # | |
FromJSON SubscriptionItemId | |
Defined in Stripe.Resources parseJSON :: Value -> Parser SubscriptionItemId # parseJSONList :: Value -> Parser [SubscriptionItemId] # | |
ToHttpApiData SubscriptionItemId | |
Defined in Stripe.Resources |
data Subscription #
Instances
Eq Subscription | |
Defined in Stripe.Resources (==) :: Subscription -> Subscription -> Bool # (/=) :: Subscription -> Subscription -> Bool # | |
Show Subscription | |
Defined in Stripe.Resources showsPrec :: Int -> Subscription -> ShowS # show :: Subscription -> String # showList :: [Subscription] -> ShowS # | |
ToJSON Subscription | |
Defined in Stripe.Resources toJSON :: Subscription -> Value # toEncoding :: Subscription -> Encoding # toJSONList :: [Subscription] -> Value # toEncodingList :: [Subscription] -> Encoding # | |
FromJSON Subscription | |
Defined in Stripe.Resources parseJSON :: Value -> Parser Subscription # parseJSONList :: Value -> Parser [Subscription] # |
data SubscriptionItem #
SubscriptionItem | |
|
Instances
Eq SubscriptionItem | |
Defined in Stripe.Resources (==) :: SubscriptionItem -> SubscriptionItem -> Bool # (/=) :: SubscriptionItem -> SubscriptionItem -> Bool # | |
Show SubscriptionItem | |
Defined in Stripe.Resources showsPrec :: Int -> SubscriptionItem -> ShowS # show :: SubscriptionItem -> String # showList :: [SubscriptionItem] -> ShowS # | |
ToJSON SubscriptionItem | |
Defined in Stripe.Resources toJSON :: SubscriptionItem -> Value # toEncoding :: SubscriptionItem -> Encoding # toJSONList :: [SubscriptionItem] -> Value # toEncodingList :: [SubscriptionItem] -> Encoding # | |
FromJSON SubscriptionItem | |
Defined in Stripe.Resources parseJSON :: Value -> Parser SubscriptionItem # parseJSONList :: Value -> Parser [SubscriptionItem] # |
data SubscriptionCreate #
Instances
data SubscriptionCreateItem #
Instances
Eq SubscriptionCreateItem | |
Defined in Stripe.Resources | |
Show SubscriptionCreateItem | |
Defined in Stripe.Resources showsPrec :: Int -> SubscriptionCreateItem -> ShowS # show :: SubscriptionCreateItem -> String # showList :: [SubscriptionCreateItem] -> ShowS # | |
Generic SubscriptionCreateItem | |
Defined in Stripe.Resources type Rep SubscriptionCreateItem :: Type -> Type # | |
type Rep SubscriptionCreateItem | |
Defined in Stripe.Resources type Rep SubscriptionCreateItem = D1 ('MetaData "SubscriptionCreateItem" "Stripe.Resources" "stripe-servant-0.3.0.0-BDZ8cVxXkVLAWAtVr94due" 'False) (C1 ('MetaCons "SubscriptionCreateItem" 'PrefixI 'True) (S1 ('MetaSel ('Just "sciPrice") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PriceId) :*: S1 ('MetaSel ('Just "sciQuantity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int)))) |
createSubscription :: StripeClient -> SubscriptionCreate -> IO (Either ClientError Subscription) Source #
retrieveSubscription :: StripeClient -> SubscriptionId -> IO (Either ClientError Subscription) Source #
listSubscriptions :: StripeClient -> Maybe CustomerId -> IO (Either ClientError (StripeList Subscription)) Source #
Customer Portal
newtype CustomerPortalId #
Instances
Eq CustomerPortalId | |
Defined in Stripe.Resources (==) :: CustomerPortalId -> CustomerPortalId -> Bool # (/=) :: CustomerPortalId -> CustomerPortalId -> Bool # | |
Show CustomerPortalId | |
Defined in Stripe.Resources showsPrec :: Int -> CustomerPortalId -> ShowS # show :: CustomerPortalId -> String # showList :: [CustomerPortalId] -> ShowS # | |
ToJSON CustomerPortalId | |
Defined in Stripe.Resources toJSON :: CustomerPortalId -> Value # toEncoding :: CustomerPortalId -> Encoding # toJSONList :: [CustomerPortalId] -> Value # toEncodingList :: [CustomerPortalId] -> Encoding # | |
FromJSON CustomerPortalId | |
Defined in Stripe.Resources parseJSON :: Value -> Parser CustomerPortalId # parseJSONList :: Value -> Parser [CustomerPortalId] # | |
ToHttpApiData CustomerPortalId | |
Defined in Stripe.Resources toUrlPiece :: CustomerPortalId -> Text # toEncodedUrlPiece :: CustomerPortalId -> Builder # toHeader :: CustomerPortalId -> ByteString # toQueryParam :: CustomerPortalId -> Text # |
data CustomerPortal #
CustomerPortal | |
|
Instances
Eq CustomerPortal | |
Defined in Stripe.Resources (==) :: CustomerPortal -> CustomerPortal -> Bool # (/=) :: CustomerPortal -> CustomerPortal -> Bool # | |
Show CustomerPortal | |
Defined in Stripe.Resources showsPrec :: Int -> CustomerPortal -> ShowS # show :: CustomerPortal -> String # showList :: [CustomerPortal] -> ShowS # | |
ToJSON CustomerPortal | |
Defined in Stripe.Resources toJSON :: CustomerPortal -> Value # toEncoding :: CustomerPortal -> Encoding # toJSONList :: [CustomerPortal] -> Value # toEncodingList :: [CustomerPortal] -> Encoding # | |
FromJSON CustomerPortal | |
Defined in Stripe.Resources parseJSON :: Value -> Parser CustomerPortal # parseJSONList :: Value -> Parser [CustomerPortal] # |
data CustomerPortalCreate #
Instances
createCustomerPortal :: StripeClient -> CustomerPortalCreate -> IO (Either ClientError CustomerPortal) Source #
Checkout
newtype CheckoutSessionId #
Instances
Eq CheckoutSessionId | |
Defined in Stripe.Resources (==) :: CheckoutSessionId -> CheckoutSessionId -> Bool # (/=) :: CheckoutSessionId -> CheckoutSessionId -> Bool # | |
Show CheckoutSessionId | |
Defined in Stripe.Resources showsPrec :: Int -> CheckoutSessionId -> ShowS # show :: CheckoutSessionId -> String # showList :: [CheckoutSessionId] -> ShowS # | |
ToJSON CheckoutSessionId | |
Defined in Stripe.Resources toJSON :: CheckoutSessionId -> Value # toEncoding :: CheckoutSessionId -> Encoding # toJSONList :: [CheckoutSessionId] -> Value # toEncodingList :: [CheckoutSessionId] -> Encoding # | |
FromJSON CheckoutSessionId | |
Defined in Stripe.Resources parseJSON :: Value -> Parser CheckoutSessionId # parseJSONList :: Value -> Parser [CheckoutSessionId] # | |
ToHttpApiData CheckoutSessionId | |
Defined in Stripe.Resources toUrlPiece :: CheckoutSessionId -> Text # toEncodedUrlPiece :: CheckoutSessionId -> Builder # toHeader :: CheckoutSessionId -> ByteString # toQueryParam :: CheckoutSessionId -> Text # |
data CheckoutSession #
Instances
Eq CheckoutSession | |
Defined in Stripe.Resources (==) :: CheckoutSession -> CheckoutSession -> Bool # (/=) :: CheckoutSession -> CheckoutSession -> Bool # | |
Show CheckoutSession | |
Defined in Stripe.Resources showsPrec :: Int -> CheckoutSession -> ShowS # show :: CheckoutSession -> String # showList :: [CheckoutSession] -> ShowS # | |
ToJSON CheckoutSession | |
Defined in Stripe.Resources toJSON :: CheckoutSession -> Value # toEncoding :: CheckoutSession -> Encoding # toJSONList :: [CheckoutSession] -> Value # toEncodingList :: [CheckoutSession] -> Encoding # | |
FromJSON CheckoutSession | |
Defined in Stripe.Resources parseJSON :: Value -> Parser CheckoutSession # parseJSONList :: Value -> Parser [CheckoutSession] # |
data CheckoutSessionCreate #
Instances
data CheckoutSessionCreateLineItem #
Instances
Eq CheckoutSessionCreateLineItem | |
Defined in Stripe.Resources | |
Show CheckoutSessionCreateLineItem | |
Defined in Stripe.Resources showsPrec :: Int -> CheckoutSessionCreateLineItem -> ShowS # show :: CheckoutSessionCreateLineItem -> String # showList :: [CheckoutSessionCreateLineItem] -> ShowS # | |
Generic CheckoutSessionCreateLineItem | |
Defined in Stripe.Resources type Rep CheckoutSessionCreateLineItem :: Type -> Type # | |
type Rep CheckoutSessionCreateLineItem | |
Defined in Stripe.Resources type Rep CheckoutSessionCreateLineItem = D1 ('MetaData "CheckoutSessionCreateLineItem" "Stripe.Resources" "stripe-servant-0.3.0.0-BDZ8cVxXkVLAWAtVr94due" 'False) (C1 ('MetaCons "CheckoutSessionCreateLineItem" 'PrefixI 'True) (S1 ('MetaSel ('Just "cscliPrice") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PriceId) :*: S1 ('MetaSel ('Just "cscliQuantity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer))) |
createCheckoutSession :: StripeClient -> CheckoutSessionCreate -> IO (Either ClientError CheckoutSession) Source #
retrieveCheckoutSession :: StripeClient -> CheckoutSessionId -> IO (Either ClientError CheckoutSession) Source #
Events
retrieveEvent :: StripeClient -> EventId -> IO (Either ClientError Event) Source #
listEvents :: StripeClient -> Maybe EventId -> IO (Either ClientError (StripeList Event)) Source #
Instances
Eq EventId | |
Show EventId | |
ToJSON EventId | |
Defined in Stripe.Resources | |
FromJSON EventId | |
ToHttpApiData EventId | |
Defined in Stripe.Resources toUrlPiece :: EventId -> Text # toEncodedUrlPiece :: EventId -> Builder # toHeader :: EventId -> ByteString # toQueryParam :: EventId -> Text # |