stripe-haskell-0.1.4.1: Stripe API for Haskell

Copyright(c) David Johnson, 2014
Maintainerdjohnson.m@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Web.Stripe.Customer

Contents

Description

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

Synopsis

API

createEmptyCustomer :: Stripe Customer Source

Creates a blank customer

createCustomerByEmail Source

Arguments

:: Email

The Email of the Customer to create

-> Stripe Customer 

Creates a customer by his/her email

createCustomerByToken Source

Arguments

:: TokenId

The TokenId of the Customer to create

-> Stripe Customer 

Creates a customer by a Token created from stripe.js or the stripe API.

createCustomerByCard Source

Arguments

:: CardNumber

Card Number

-> ExpMonth

Card Expiration Month

-> ExpYear

Card Expiration Year

-> CVC

Card CVC

-> Stripe Customer 

Creates a Customer with a Card

createCustomerBase Source

Arguments

:: 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 

The base request for customer creation

updateCustomerBase Source

Arguments

:: 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 

Updates a customer

updateCustomerAccountBalance Source

Arguments

:: CustomerId

CustomerId associated with the Customer to update

-> AccountBalance

AccountBalance associated

-> Stripe Customer 

Update Customer Account Balance

updateCustomerDefaultCard Source

Arguments

:: CustomerId

CustomerId associated with the Customer to update

-> CardId

CardId to become default card

-> Stripe Customer 

Update Customer Account Balance

deleteCustomer Source

Arguments

:: CustomerId

The CustomerId of the Customer to delete

-> Stripe StripeDeleteResult 

Deletes the specified customer

getCustomer Source

Arguments

:: CustomerId

The CustomerId of the Customer to retrieve

-> Stripe Customer 

Retrieves a customer by his/her ID.

getCustomerExpandable Source

Arguments

:: CustomerId

The CustomerId of the Customer to retrieve

-> ExpandParams

The ExpandParams of the object to expand

-> Stripe Customer 

Retrieves a customer by his/her CustomerID with ExpandParams

getCustomers Source

Arguments

:: 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) 

Retrieve up to 100 customers at a time

getCustomersExpandable Source

Arguments

:: 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) 

Retrieve up to 100 customers at a time

Types

data CardId Source

CardId for a Customer

Constructors

CardId Text 
ExpandedCard Card 

Instances

data StripeList a Source

Generic handling of Stripe JSON arrays

Constructors

StripeList 

Fields

list :: [a]
 
stripeUrl :: Text
 
object :: Text
 
totalCount :: Maybe Int
 
hasMore :: Bool
 

Instances

Eq a => Eq (StripeList a) 
Show a => Show (StripeList a) 
FromJSON a => FromJSON (StripeList a)

JSON Instance for StripeList

newtype TokenId Source

Constructors

TokenId Text 

Instances

newtype CardNumber Source

Number associated with a Card

Constructors

CardNumber Text 

newtype ExpMonth Source

Expiration Month for a Card

Constructors

ExpMonth Int 

Instances

newtype ExpYear Source

Expiration Year for a Card

Constructors

ExpYear Int 

Instances

newtype CVC Source

CVC for a Card

Constructors

CVC Text 

Instances

newtype CouponId Source

Constructors

CouponId Text 

Instances

newtype Email Source

Email associated with a Customer, Recipient or Charge

Constructors

Email Text 

Instances

newtype PlanId Source

PlanId for a Plan

Constructors

PlanId Text 

Instances

newtype Quantity Source

Generic Quantity type to be used with Customer, Subscription and InvoiceLineItem API requests

Constructors

Quantity Int 

Instances

data StripeDeleteResult Source

JSON returned from a Stripe deletion request

Constructors

StripeDeleteResult 

newtype TrialPeriod Source

TrialPeriod for a Plan

Constructors

TrialPeriod UTCTime 

type Description = Text Source

Generic Description for use in constructing API Calls

type AccountBalance = Int Source

AccountBalance for a Customer

type Limit = Maybe Int Source

Pagination Option for StripeList