stripe-haskell-0.1.4.2: Stripe API for Haskell

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

Web.Stripe.Card

Contents

Description

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

Synopsis

API

Customers

Create Customer Card

createCustomerCard Source

Arguments

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

Add a Card on a Customer

createCustomerCardByToken Source

Arguments

:: CustomerId

The Customer to which the card will be added

-> TokenId

The Token representative of the card

-> Stripe Card 

Create a Customer card using a Token

Get Customer Card(s)

getCustomerCard Source

Arguments

:: CustomerId

CustomerId of the Card to retrieve

-> CardId

CardId of the card to retrieve

-> Stripe Card 

Get card by CustomerId and CardId

getCustomerCardExpandable Source

Arguments

:: CustomerId

CustomerId of the Card to retrieve

-> CardId

CardId of the card to retrieve

-> ExpandParams

ExpandParams of the card to retrieve

-> Stripe Card 

Get card by CustomerId and CardId with ExpandParams

getCustomerCards Source

Arguments

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

Retrieve all cards associated with a Customer

getCustomerCardsExpandable Source

Arguments

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

Retrieve all cards associated with a Customer

Update Customer Card

updateCustomerCard Source

Arguments

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

Update a Customer Card

Delete Card

deleteCustomerCard Source

Arguments

:: CustomerId

CustomerId of the Card to retrieve

-> CardId

CardId associated with Card to be deleted

-> Stripe StripeDeleteResult 

Removes a card from a Customer

Recipients

Create Recipient Card

createRecipientCard Source

Arguments

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

createRecipientCardByToken Source

Arguments

:: RecipientId

The Customer to which the card will be added

-> TokenId

The Token representative of the card

-> Stripe RecipientCard 

Create a Recipient card using a Token

Get Recipient Card(s)

getRecipientCard Source

Arguments

:: RecipientId

RecipientId of the Card to retrieve

-> RecipientCardId

CardId of the Recipient Card to retrieve

-> Stripe RecipientCard 

Get card by RecipientId and CardId

getRecipientCards Source

Arguments

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

Retrieve all cards associated with a Recipient

getRecipientCardsExpandable Source

Arguments

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

Retrieve all cards associated with a Recipient

Updated Recipient Card

updateRecipientCard Source

Arguments

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

Update a Recipient Card

Delete Recipient Card

deleteRecipientCard Source

Arguments

:: RecipientId

The RecipientId associated with the Card to be removed

-> RecipientCardId

The CardId of the Card to be removed

-> Stripe StripeDeleteResult 

Removes a card from a Customer

Types

data Brand Source

Credit / Debit Card Brand

Instances

Eq Brand 
Show Brand 
FromJSON Brand

JSON Instance for Brand

data CardId Source

CardId for a Customer

Constructors

CardId Text 
ExpandedCard Card 

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

type Name = Text Source

Generic URL for use in constructing API Calls

newtype AddressLine1 Source

Address Line One for a Card

Constructors

AddressLine1 Text 

newtype AddressLine2 Source

Address Line Two for a Card

Constructors

AddressLine2 Text 

newtype AddressCity Source

City address for a Card

Constructors

AddressCity Text 

newtype AddressCountry Source

Country address for a Card

Constructors

AddressCountry Text 

newtype AddressState Source

Address State for a Card

Constructors

AddressState Text 

newtype AddressZip Source

Address Zip Code for a Card

Constructors

AddressZip Text