Safe Haskell | None |
---|---|
Language | Haskell2010 |
Stripe.Client
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.
Arguments
:: 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.
Constructors
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
Constructors
TimeStamp | |
Fields |
Instances
Eq TimeStamp | |
Show TimeStamp | |
ToJSON TimeStamp | |
Defined in Stripe.Resources | |
FromJSON TimeStamp | |
ToHttpApiData TimeStamp | |
Defined in Stripe.Resources Methods 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.
Constructors
StripeList | |
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 #
Constructors
CustomerId | |
Fields
|
Instances
Eq CustomerId | |
Defined in Stripe.Resources | |
Show CustomerId | |
Defined in Stripe.Resources Methods showsPrec :: Int -> CustomerId -> ShowS # show :: CustomerId -> String # showList :: [CustomerId] -> ShowS # | |
ToJSON CustomerId | |
Defined in Stripe.Resources Methods toJSON :: CustomerId -> Value # toEncoding :: CustomerId -> Encoding # toJSONList :: [CustomerId] -> Value # toEncodingList :: [CustomerId] -> Encoding # | |
FromJSON CustomerId | |
Defined in Stripe.Resources | |
ToHttpApiData CustomerId | |
Defined in Stripe.Resources Methods toUrlPiece :: CustomerId -> Text # toEncodedUrlPiece :: CustomerId -> Builder # toHeader :: CustomerId -> ByteString # toQueryParam :: CustomerId -> Text # |
Constructors
Customer | |
data CustomerCreate #
Instances
data CustomerUpdate #
Instances
Product catalog
Constructors
ProductId | |
Fields
|
Instances
Eq ProductId | |
Show ProductId | |
ToJSON ProductId | |
Defined in Stripe.Resources | |
FromJSON ProductId | |
ToHttpApiData ProductId | |
Defined in Stripe.Resources Methods 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 Methods toUrlPiece :: PriceId -> Text # toEncodedUrlPiece :: PriceId -> Builder # toHeader :: PriceId -> ByteString # toQueryParam :: PriceId -> Text # |
Constructors
Product | |
Constructors
Price | |
data PriceRecurring #
Constructors
PriceRecurring | |
Fields
|
Instances
Eq PriceRecurring | |
Defined in Stripe.Resources Methods (==) :: PriceRecurring -> PriceRecurring -> Bool # (/=) :: PriceRecurring -> PriceRecurring -> Bool # | |
Show PriceRecurring | |
Defined in Stripe.Resources Methods showsPrec :: Int -> PriceRecurring -> ShowS # show :: PriceRecurring -> String # showList :: [PriceRecurring] -> ShowS # | |
ToJSON PriceRecurring | |
Defined in Stripe.Resources Methods toJSON :: PriceRecurring -> Value # toEncoding :: PriceRecurring -> Encoding # toJSONList :: [PriceRecurring] -> Value # toEncodingList :: [PriceRecurring] -> Encoding # | |
FromJSON PriceRecurring | |
Defined in Stripe.Resources Methods parseJSON :: Value -> Parser PriceRecurring # parseJSONList :: Value -> Parser [PriceRecurring] # |
data ProductCreate #
Constructors
ProductCreate | |
Fields
|
Instances
Eq ProductCreate | |
Defined in Stripe.Resources Methods (==) :: ProductCreate -> ProductCreate -> Bool # (/=) :: ProductCreate -> ProductCreate -> Bool # | |
Show ProductCreate | |
Defined in Stripe.Resources Methods showsPrec :: Int -> ProductCreate -> ShowS # show :: ProductCreate -> String # showList :: [ProductCreate] -> ShowS # | |
Generic ProductCreate | |
Defined in Stripe.Resources Associated Types type Rep ProductCreate :: Type -> Type # | |
ToForm ProductCreate | |
Defined in Stripe.Resources Methods toForm :: ProductCreate -> Form # | |
type Rep ProductCreate | |
Defined in Stripe.Resources type Rep ProductCreate = D1 ('MetaData "ProductCreate" "Stripe.Resources" "stripe-servant-0.3.0.0-BDZ8cVxXkVLAWAtVr94due" 'False) (C1 ('MetaCons "ProductCreate" 'PrefixI 'True) (S1 ('MetaSel ('Just "prcName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "prcDescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) |
data PriceCreate #
Constructors
PriceCreate | |
Fields |
Instances
data PriceCreateRecurring #
Constructors
PriceCreateRecurring | |
Fields
|
Instances
Eq PriceCreateRecurring | |
Defined in Stripe.Resources Methods (==) :: PriceCreateRecurring -> PriceCreateRecurring -> Bool # (/=) :: PriceCreateRecurring -> PriceCreateRecurring -> Bool # | |
Show PriceCreateRecurring | |
Defined in Stripe.Resources Methods 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 #
Constructors
SubscriptionId | |
Fields |
Instances
Eq SubscriptionId | |
Defined in Stripe.Resources Methods (==) :: SubscriptionId -> SubscriptionId -> Bool # (/=) :: SubscriptionId -> SubscriptionId -> Bool # | |
Show SubscriptionId | |
Defined in Stripe.Resources Methods showsPrec :: Int -> SubscriptionId -> ShowS # show :: SubscriptionId -> String # showList :: [SubscriptionId] -> ShowS # | |
ToJSON SubscriptionId | |
Defined in Stripe.Resources Methods toJSON :: SubscriptionId -> Value # toEncoding :: SubscriptionId -> Encoding # toJSONList :: [SubscriptionId] -> Value # toEncodingList :: [SubscriptionId] -> Encoding # | |
FromJSON SubscriptionId | |
Defined in Stripe.Resources Methods parseJSON :: Value -> Parser SubscriptionId # parseJSONList :: Value -> Parser [SubscriptionId] # | |
ToHttpApiData SubscriptionId | |
Defined in Stripe.Resources Methods toUrlPiece :: SubscriptionId -> Text # toEncodedUrlPiece :: SubscriptionId -> Builder # toHeader :: SubscriptionId -> ByteString # toQueryParam :: SubscriptionId -> Text # |
newtype SubscriptionItemId #
Constructors
SubscriptionItemId | |
Fields |
Instances
data Subscription #
Constructors
Subscription | |
Fields |
Instances
Eq Subscription | |
Defined in Stripe.Resources | |
Show Subscription | |
Defined in Stripe.Resources Methods showsPrec :: Int -> Subscription -> ShowS # show :: Subscription -> String # showList :: [Subscription] -> ShowS # | |
ToJSON Subscription | |
Defined in Stripe.Resources Methods toJSON :: Subscription -> Value # toEncoding :: Subscription -> Encoding # toJSONList :: [Subscription] -> Value # toEncodingList :: [Subscription] -> Encoding # | |
FromJSON Subscription | |
Defined in Stripe.Resources |
data SubscriptionItem #
Constructors
SubscriptionItem | |
Fields
|
Instances
Eq SubscriptionItem | |
Defined in Stripe.Resources Methods (==) :: SubscriptionItem -> SubscriptionItem -> Bool # (/=) :: SubscriptionItem -> SubscriptionItem -> Bool # | |
Show SubscriptionItem | |
Defined in Stripe.Resources Methods showsPrec :: Int -> SubscriptionItem -> ShowS # show :: SubscriptionItem -> String # showList :: [SubscriptionItem] -> ShowS # | |
ToJSON SubscriptionItem | |
Defined in Stripe.Resources Methods toJSON :: SubscriptionItem -> Value # toEncoding :: SubscriptionItem -> Encoding # toJSONList :: [SubscriptionItem] -> Value # toEncodingList :: [SubscriptionItem] -> Encoding # | |
FromJSON SubscriptionItem | |
Defined in Stripe.Resources Methods parseJSON :: Value -> Parser SubscriptionItem # parseJSONList :: Value -> Parser [SubscriptionItem] # |
data SubscriptionCreate #
Constructors
SubscriptionCreate | |
Fields |
Instances
data SubscriptionCreateItem #
Constructors
SubscriptionCreateItem | |
Fields
|
Instances
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 #
Constructors
CustomerPortalId | |
Fields |
Instances
Eq CustomerPortalId | |
Defined in Stripe.Resources Methods (==) :: CustomerPortalId -> CustomerPortalId -> Bool # (/=) :: CustomerPortalId -> CustomerPortalId -> Bool # | |
Show CustomerPortalId | |
Defined in Stripe.Resources Methods showsPrec :: Int -> CustomerPortalId -> ShowS # show :: CustomerPortalId -> String # showList :: [CustomerPortalId] -> ShowS # | |
ToJSON CustomerPortalId | |
Defined in Stripe.Resources Methods toJSON :: CustomerPortalId -> Value # toEncoding :: CustomerPortalId -> Encoding # toJSONList :: [CustomerPortalId] -> Value # toEncodingList :: [CustomerPortalId] -> Encoding # | |
FromJSON CustomerPortalId | |
Defined in Stripe.Resources Methods parseJSON :: Value -> Parser CustomerPortalId # parseJSONList :: Value -> Parser [CustomerPortalId] # | |
ToHttpApiData CustomerPortalId | |
Defined in Stripe.Resources Methods toUrlPiece :: CustomerPortalId -> Text # toEncodedUrlPiece :: CustomerPortalId -> Builder # toHeader :: CustomerPortalId -> ByteString # toQueryParam :: CustomerPortalId -> Text # |
data CustomerPortal #
Constructors
CustomerPortal | |
Fields
|
Instances
Eq CustomerPortal | |
Defined in Stripe.Resources Methods (==) :: CustomerPortal -> CustomerPortal -> Bool # (/=) :: CustomerPortal -> CustomerPortal -> Bool # | |
Show CustomerPortal | |
Defined in Stripe.Resources Methods showsPrec :: Int -> CustomerPortal -> ShowS # show :: CustomerPortal -> String # showList :: [CustomerPortal] -> ShowS # | |
ToJSON CustomerPortal | |
Defined in Stripe.Resources Methods toJSON :: CustomerPortal -> Value # toEncoding :: CustomerPortal -> Encoding # toJSONList :: [CustomerPortal] -> Value # toEncodingList :: [CustomerPortal] -> Encoding # | |
FromJSON CustomerPortal | |
Defined in Stripe.Resources Methods parseJSON :: Value -> Parser CustomerPortal # parseJSONList :: Value -> Parser [CustomerPortal] # |
data CustomerPortalCreate #
Constructors
CustomerPortalCreate | |
Fields |
Instances
createCustomerPortal :: StripeClient -> CustomerPortalCreate -> IO (Either ClientError CustomerPortal) Source #
Checkout
newtype CheckoutSessionId #
Constructors
CheckoutSessionId | |
Fields |
Instances
data CheckoutSession #
Constructors
CheckoutSession | |
Fields |
Instances
Eq CheckoutSession | |
Defined in Stripe.Resources Methods (==) :: CheckoutSession -> CheckoutSession -> Bool # (/=) :: CheckoutSession -> CheckoutSession -> Bool # | |
Show CheckoutSession | |
Defined in Stripe.Resources Methods showsPrec :: Int -> CheckoutSession -> ShowS # show :: CheckoutSession -> String # showList :: [CheckoutSession] -> ShowS # | |
ToJSON CheckoutSession | |
Defined in Stripe.Resources Methods toJSON :: CheckoutSession -> Value # toEncoding :: CheckoutSession -> Encoding # toJSONList :: [CheckoutSession] -> Value # toEncodingList :: [CheckoutSession] -> Encoding # | |
FromJSON CheckoutSession | |
Defined in Stripe.Resources Methods parseJSON :: Value -> Parser CheckoutSession # parseJSONList :: Value -> Parser [CheckoutSession] # |
data CheckoutSessionCreate #
Constructors
CheckoutSessionCreate | |
Fields |
Instances
data CheckoutSessionCreateLineItem #
Constructors
CheckoutSessionCreateLineItem | |
Fields |
Instances
Eq CheckoutSessionCreateLineItem | |
Defined in Stripe.Resources | |
Show CheckoutSessionCreateLineItem | |
Defined in Stripe.Resources Methods showsPrec :: Int -> CheckoutSessionCreateLineItem -> ShowS # show :: CheckoutSessionCreateLineItem -> String # showList :: [CheckoutSessionCreateLineItem] -> ShowS # | |
Generic CheckoutSessionCreateLineItem | |
Defined in Stripe.Resources Associated Types 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 Methods toUrlPiece :: EventId -> Text # toEncodedUrlPiece :: EventId -> Builder # toHeader :: EventId -> ByteString # toQueryParam :: EventId -> Text # |
Constructors
Event | |