Copyright | (c) David Johnson, 2014 |
---|---|
Maintainer | djohnson.m@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
https://stripe.com/docs/api#customers
{-# LANGUAGE OverloadedStrings #-} import Web.Stripe import Web.Stripe.Customer main :: IO () main = do let config = StripeConfig (StripeKey "secret_key") result <- stripe config createCustomer case result of Right customer -> print customer Left stripeError -> print stripeError
- data CreateCustomer
- createCustomer :: StripeRequest CreateCustomer
- data GetCustomer
- getCustomer :: CustomerId -> StripeRequest GetCustomer
- data UpdateCustomer
- updateCustomer :: CustomerId -> StripeRequest UpdateCustomer
- data DeleteCustomer
- deleteCustomer :: CustomerId -> StripeRequest DeleteCustomer
- data GetCustomers
- getCustomers :: StripeRequest GetCustomers
- newtype AccountBalance = AccountBalance Int
- newtype CardId = CardId Text
- newtype CardNumber = CardNumber Text
- newtype CouponId = CouponId Text
- newtype Created = Created UTCTime
- 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 (Expandable CardId)
- customerMetaData :: MetaData
- | DeletedCustomer { }
- = Customer {
- newtype CustomerId = CustomerId Text
- newtype CVC = CVC Text
- newtype Description = Description Text
- newtype Email = Email Text
- newtype EndingBefore a = EndingBefore a
- newtype ExpandParams = ExpandParams {
- getExpandParams :: [Text]
- newtype ExpMonth = ExpMonth Int
- newtype ExpYear = ExpYear Int
- newtype Limit = Limit Int
- newtype MetaData = MetaData [(Text, Text)]
- mkNewCard :: CardNumber -> ExpMonth -> ExpYear -> NewCard
- data NewCard = NewCard {
- newCardCardNumber :: CardNumber
- newCardExpMonth :: ExpMonth
- newCardExpYear :: ExpYear
- newCardCVC :: Maybe CVC
- newCardName :: Maybe Name
- newCardAddressLine1 :: Maybe AddressLine1
- newCardAddressLine2 :: Maybe AddressLine2
- newCardAddressCity :: Maybe AddressCity
- newCardAddressZip :: Maybe AddressZip
- newCardAddressState :: Maybe AddressState
- newCardAddressCountry :: Maybe AddressCountry
- newtype PlanId = PlanId Text
- newtype Quantity = Quantity Int
- newtype StartingAfter a = StartingAfter a
- data StripeDeleteResult = StripeDeleteResult {}
- data StripeList a = StripeList {}
- newtype TokenId = TokenId Text
- newtype TrialEnd = TrialEnd UTCTime
API
data CreateCustomer Source
createCustomer :: StripeRequest CreateCustomer Source
Create a customer
data GetCustomer Source
:: CustomerId |
|
-> StripeRequest GetCustomer |
Retrieve a customer
data UpdateCustomer Source
:: CustomerId |
|
-> StripeRequest UpdateCustomer |
Update a Customer
data DeleteCustomer Source
Deletes the specified Customer
:: CustomerId | The |
-> StripeRequest DeleteCustomer |
data GetCustomers Source
getCustomers :: StripeRequest GetCustomers Source
Retrieve up to 100 customers at a time
Types
newtype AccountBalance Source
AccountBalance for a Customer
CardId for a Customer
newtype CardNumber Source
Number associated with a Card
Customer
object
newtype CustomerId Source
CustomerId
for a Customer
CVC for a Card
newtype Description Source
Generic Description for use in constructing API Calls
newtype EndingBefore a Source
Pagination Option for StripeList
newtype ExpandParams Source
Type of Expansion Parameters for use on Stripe
objects
Expiration Month for a Card
Expiration Year for a Card
Pagination Option for StripeList
Type of MetaData for use on Stripe
objects
mkNewCard :: CardNumber -> ExpMonth -> ExpYear -> NewCard Source
create a NewCard
with only the required fields
Generic Quantity
type to be used with Customer
,
Subscription
and InvoiceLineItem
API requests
newtype StartingAfter a Source
Pagination Option for StripeList
data StripeDeleteResult Source
JSON returned from a Stripe
deletion request
data StripeList a Source
Generic handling of Stripe JSON arrays
Eq a => Eq (StripeList a) Source | |
Data a => Data (StripeList a) Source | |
Ord a => Ord (StripeList a) Source | |
Read a => Read (StripeList a) Source | |
Show a => Show (StripeList a) Source | |
FromJSON a => FromJSON (StripeList a) Source | JSON Instance for |
TrialEnd
for a Plan