stripe-haskell-0.1.0.1: Stripe API for Haskell

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

Web.Stripe.Recipient

Contents

Description

https://stripe.com/docs/api#recipients

import Web.Stripe         
import Web.Stripe.Recipient

main :: IO ()
main = do
  let config = SecretKey "secret_key"
  result <- stripe config $ 
      createRecipient (FirstName "simon")
                      (LastName "marlow")
                      Nothing -- what is Simon Marlow's middle initial?
                      (Invidiual :: RecipientType)
  case result of
    Right recipient  -> print recipient
    Left stripeError -> print stripeError

Synopsis

API

createRecipientByCard Source

Arguments

:: FirstName

First Name of Recipient

-> LastName

Last Name of Recipient

-> Maybe MiddleInitial

Middle Initial of Recipient

-> RecipientType

Individual or Corporation

-> CardNumber

Card Number

-> ExpMonth

Expiration Month

-> ExpYear

Expiration Year

-> CVC

CVC (i.e. 117)

-> Stripe Recipient 

Create a Recipient by a Card

createRecipientByToken Source

Arguments

:: FirstName

First Name of Recipient

-> LastName

Last Name of Recipient

-> Maybe MiddleInitial

Middle Initial of Recipient

-> RecipientType

Individual or Corporation

-> TokenId

TokenId received from stripe.js or Token API

-> Stripe Recipient 

Create a Recipient by specifying a TokenId

createRecipientByBank Source

Arguments

:: FirstName

First Name of Recipient

-> LastName

Last Name of Recipient

-> Maybe MiddleInitial

Middle Initial of Recipient

-> RecipientType

Individual or Corporation

-> Country

Country of BankAccount to attach to Recipient

-> RoutingNumber

RoutingNumber of BankAccount to attach to Recipient

-> AccountNumber

AccountNumber of BankAccount to attach to Recipient

-> Stripe Recipient 

Create a Recipient with a BankAccount

createRecipientBase Source

Arguments

:: FirstName

First Name of Recipient

-> LastName

Last Name of Recipient

-> Maybe MiddleInitial

Middle Initial of Recipient

-> RecipientType

Individual or Corporation

-> Maybe TaxID

SSN for Individual, EIN for Corporation

-> Maybe Country

Country of BankAccount to attach to Recipient

-> Maybe RoutingNumber

RoutingNumber of BankAccount to attach to Recipient

-> Maybe AccountNumber

AccountNumber of BankAccount to attach to Recipient

-> Maybe TokenId

TokenId of Card or BankAccount to attach to a Recipient

-> Maybe CardNumber

CardNumber to attach to Card of Recipient

-> Maybe ExpMonth

Expiration Month of Card

-> Maybe ExpYear

Expiration Year of Card

-> Maybe CVC

CVC of Card

-> Maybe Email

Create Email with Recipient

-> Maybe Description

Create Description with Recipient

-> MetaData

The MetaData associated with the Recipient

-> Stripe Recipient 

Base Request for issues create Recipient requests

getRecipient Source

Arguments

:: RecipientId

The RecipientId of the Recipient to be retrieved

-> Stripe Recipient 

Retrieve a Recipient

getRecipientExpandable Source

Arguments

:: RecipientId

The RecipientId of the Recipient to be retrieved

-> ExpandParams

ExpandParams of the object to be expanded

-> Stripe Recipient 

Retrieve a Recipient

getRecipients Source

Arguments

:: Limit

Defaults to 10 if Nothing specified

-> StartingAfter RecipientId

Paginate starting after the following RecipientId

-> EndingBefore RecipientId

Paginate ending before the following RecipientId

-> Stripe (StripeList Recipient) 

Retrieve multiple Recipients

getRecipientsExpandable Source

Arguments

:: Limit

Defaults to 10 if Nothing specified

-> StartingAfter RecipientId

Paginate starting after the following RecipientId

-> EndingBefore RecipientId

Paginate ending before the following RecipientId

-> ExpandParams

ExpandParams of the object to be expanded

-> Stripe (StripeList Recipient) 

Retrieve multiple Recipients with ExpandParams

updateRecipientName Source

Arguments

:: RecipientId

The RecipientId of the Recipient to be updated

-> FirstName

First Name of Recipient

-> LastName

Last Name of Recipient

-> MiddleInitial

Middle Initial of Recipient

-> Stripe Recipient 

updateRecipientTaxID Source

Arguments

:: RecipientId

The RecipientId of the Recipient to be updated

-> TaxID

TaxID of Recipient to be updated

-> Stripe Recipient 

Update a Recipient TaxID

runStripe config $ updateRecipientTaxID (RecipientId "rp_4lpjaLFB5ecSks") "SampleTaxID"

updateRecipientBankAccount Source

Arguments

:: RecipientId

The RecipientId of the Recipient to be updated

-> Country

Country of BankAccount to attach to Recipient

-> RoutingNumber

RoutingNumber of BankAccount to attach to Recipient

-> AccountNumber

AccountNumber of BankAccount to attach to Recipient

-> Stripe Recipient 

Update a Recipient BankAccount

runStripe config $ updateRecipient (RecipientId "rp_4lpjaLFB5ecSks") BankAccount {
    bankAccountCountry = Country "us"
  , bankAccountRoutingNumber = RoutingNumber "071000013"
  , bankAccountNumber = AccountNumber "293058719045"
 }

updateRecipientTokenID Source

Arguments

:: RecipientId

The RecipientId of the Recipient to be updated

-> TokenId

TaxID of Recipient to be updated

-> Stripe Recipient 

Update a Recipient Card by TokenId

runStripe config $ updateRecipientTokenId (RecipientId "rp_4lpjaLFB5ecSks") (TokenId "tok_aksdjfh9823")

updateRecipientDefaultCard Source

Arguments

:: RecipientId

The RecipientId of the Recipient to be updated

-> CardId

CardId of Card to be made default

-> Stripe Recipient 

Update a Recipient Card

runStripe config $ updateRecipientCard (RecipientId "rp_4lpjaLFB5ecSks") number month year cvc
  where
    number = CardNumber "4242424242424242"
    month  = ExpMonth 12
    year   = ExpYear 2018
    cvc    = 117

updateRecipientDefaultCard :: RecipientId -- ^ The RecipientId of the Recipient to be updated -> CardNumber -- ^ CardNumber to attach to Card of Recipient -> ExpMonth -- ^ Expiration Month of Card -> ExpYear -- ^ Expiration Year of Card -> CVC -- ^ CVC of Card -> Stripe Recipient updateRecipientCard recipientid cardNumber expMonth expYear cvc = updateRecipientBase recipientid Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing (Just cardNumber) (Just expMonth) (Just expYear) (Just cvc) Nothing Nothing Nothing []

Update default Card of Recipient

runStripe config $ updateRecipientDefaultCard (RecipientId "rp_4lpjaLFB5ecSks") (CardId "card_4jQs35jE5wFOor")

updateRecipientEmail Source

Arguments

:: RecipientId

The RecipientId of the Recipient to be updated

-> Email

Email of Recipient to be updated

-> Stripe Recipient 

Update a Recipient Email Address

runStripe config $ updateRecipientEmail (RecipientId "rp_4lpjaLFB5ecSks") (Email "name@domain.com")

updateRecipientDescription Source

Arguments

:: RecipientId

The RecipientId of the Recipient to be updated

-> Description

Description of Recipient to be updated

-> Stripe Recipient 

Update a Recipient Description

runStripe config $ updateRecipientDescription (RecipientId "rp_4lpjaLFB5ecSks") (Email "name@domain.com")

updateRecipientMetaData Source

Arguments

:: RecipientId

The RecipientId of the Recipient to be updated

-> MetaData

The MetaData associated with the Recipient

-> Stripe Recipient 

Update a Recipient MetaData

runStripe config $ updateRecipientMetaData (RecipientId "rp_4lpjaLFB5ecSks") [("key", "value")]

updateRecipientBase Source

Arguments

:: RecipientId

The RecipientId of the Recipient to be updated

-> Maybe FirstName

First Name of Recipient

-> Maybe LastName

Last Name of Recipient

-> Maybe MiddleInitial

Middle Initial of Recipient

-> Maybe TaxID

SSN for Individual, EIN for Corporation

-> Maybe Country

Country of BankAccount to attach to Recipient

-> Maybe RoutingNumber

RoutingNumber of BankAccount to attach to Recipient

-> Maybe AccountNumber

AccountNumber of BankAccount to attach to Recipient

-> Maybe TokenId

TokenId of Card to attach to a Recipient

-> Maybe CardNumber

CardNumber to attach to Card of Recipient

-> Maybe ExpMonth

Expiration Month of Card

-> Maybe ExpYear

Expiration Year of Card

-> Maybe CVC

CVC of Card

-> Maybe CardId

The Default Card for this Recipient to use

-> Maybe Email

Create Email with Recipient

-> Maybe Description

Create Description with Recipient

-> MetaData

The MetaData associated with the Recipient

-> Stripe Recipient 

Base Request for updating a Recipient, useful for creating custom Recipient update functions

deleteRecipient Source

Arguments

:: RecipientId

RecipiendId of Recipient to delete

-> Stripe StripeDeleteResult 

Delete a Recipient

>>> runStripe config $ deleteRecipient (RecipientId "rp_4lpjaLFB5ecSks")

Types

newtype FirstName Source

Recipients

FirstName of a Recipient

Constructors

FirstName Text 

newtype LastName Source

Constructors

LastName Text 

Instances

type MiddleInitial = Char Source

Middle Initial of a Recipient

data CardNumber Source

Number associated with a Card

data ExpMonth Source

Expiration Month for a Card

Instances

newtype Email Source

Email associated with a Customer, Recipient or Charge

Constructors

Email Text 

Instances

data ExpYear Source

Expiration Year for a Card

Instances

data CVC Source

CVC for a Card

Instances

type Description = Text Source

Generic Description for use in constructing API Calls

type Limit = Maybe Int Source

Pagination Option for StripeList

data StripeDeleteResult Source

JSON returned from a Stripe deletion request

Constructors

StripeDeleteResult 

newtype RoutingNumber Source

Routing Number for Bank Account

Constructors

RoutingNumber Text 

newtype AccountNumber Source

Account Number of a Bank Account

Constructors

AccountNumber Text 

newtype Country Source

Country

Constructors

Country Text 

Instances

newtype AddressCity Source

City address for a Card

Constructors

AddressCity Text 

newtype AddressCountry Source

Country address for a Card

Constructors

AddressCountry Text 

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 AddressState Source

Address State for a Card

Constructors

AddressState Text 

newtype AddressZip Source

Address Zip Code for a Card

Constructors

AddressZip Text