| Copyright | (c) David Johnson, 2014 |
|---|---|
| Maintainer | djohnson.m@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Web.Stripe.Recipient
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
- createRecipient :: FirstName -> LastName -> Maybe MiddleInitial -> RecipientType -> Stripe Recipient
- createRecipientByCard :: FirstName -> LastName -> Maybe MiddleInitial -> RecipientType -> CardNumber -> ExpMonth -> ExpYear -> CVC -> Stripe Recipient
- createRecipientByToken :: FirstName -> LastName -> Maybe MiddleInitial -> RecipientType -> TokenId -> Stripe Recipient
- createRecipientByBank :: FirstName -> LastName -> Maybe MiddleInitial -> RecipientType -> Country -> RoutingNumber -> AccountNumber -> Stripe Recipient
- createRecipientBase :: FirstName -> LastName -> Maybe MiddleInitial -> RecipientType -> Maybe TaxID -> Maybe Country -> Maybe RoutingNumber -> Maybe AccountNumber -> Maybe TokenId -> Maybe CardNumber -> Maybe ExpMonth -> Maybe ExpYear -> Maybe CVC -> Maybe Email -> Maybe Description -> MetaData -> Stripe Recipient
- getRecipient :: RecipientId -> Stripe Recipient
- getRecipientExpandable :: RecipientId -> ExpandParams -> Stripe Recipient
- getRecipients :: Limit -> StartingAfter RecipientId -> EndingBefore RecipientId -> Stripe (StripeList Recipient)
- getRecipientsExpandable :: Limit -> StartingAfter RecipientId -> EndingBefore RecipientId -> ExpandParams -> Stripe (StripeList Recipient)
- updateRecipientName :: RecipientId -> FirstName -> LastName -> MiddleInitial -> Stripe Recipient
- updateRecipientTaxID :: RecipientId -> TaxID -> Stripe Recipient
- updateRecipientBankAccount :: RecipientId -> Country -> RoutingNumber -> AccountNumber -> Stripe Recipient
- updateRecipientTokenID :: RecipientId -> TokenId -> Stripe Recipient
- updateRecipientDefaultCard :: RecipientId -> CardId -> Stripe Recipient
- updateRecipientEmail :: RecipientId -> Email -> Stripe Recipient
- updateRecipientDescription :: RecipientId -> Description -> Stripe Recipient
- updateRecipientMetaData :: RecipientId -> MetaData -> Stripe Recipient
- updateRecipientBase :: RecipientId -> Maybe FirstName -> Maybe LastName -> Maybe MiddleInitial -> Maybe TaxID -> Maybe Country -> Maybe RoutingNumber -> Maybe AccountNumber -> Maybe TokenId -> Maybe CardNumber -> Maybe ExpMonth -> Maybe ExpYear -> Maybe CVC -> Maybe CardId -> Maybe Email -> Maybe Description -> MetaData -> Stripe Recipient
- deleteRecipient :: RecipientId -> Stripe StripeDeleteResult
- data Recipient
- = Recipient {
- recipientId :: RecipientId
- recipientObject :: Text
- recipientCreated :: UTCTime
- recipientLiveMode :: Bool
- recipientType :: RecipientType
- recipientDescription :: Maybe Description
- recipientEmail :: Maybe Email
- recipientName :: Name
- recipientVerified :: Bool
- recipientActiveAccount :: Maybe BankAccount
- recipientCards :: StripeList RecipientCard
- recipientDefaultCard :: Maybe RecipientCardId
- | DeletedRecipient { }
- = Recipient {
- data RecipientId
- newtype FirstName = FirstName Text
- newtype LastName = LastName Text
- type MiddleInitial = Char
- data RecipientType
- type TaxID = Text
- data BankAccount = BankAccount {}
- data TokenId
- data CardNumber
- data ExpMonth
- newtype Email = Email Text
- data ExpYear
- data CVC
- type Description = Text
- type Limit = Maybe Int
- data StripeDeleteResult = StripeDeleteResult {}
- newtype RoutingNumber = RoutingNumber Text
- newtype AccountNumber = AccountNumber Text
- newtype Country = Country Text
- newtype AddressCity = AddressCity Text
- newtype AddressCountry = AddressCountry Text
- newtype AddressLine1 = AddressLine1 Text
- newtype AddressLine2 = AddressLine2 Text
- newtype AddressState = AddressState Text
- newtype AddressZip = AddressZip Text
- newtype BankAccountId = BankAccountId Text
- data BankAccountStatus
API
Arguments
| :: FirstName | First Name of |
| -> LastName | Last Name of |
| -> Maybe MiddleInitial | Middle Initial of |
| -> RecipientType | |
| -> Stripe Recipient |
Create a Recipient
Arguments
| :: FirstName | First Name of |
| -> LastName | Last Name of |
| -> Maybe MiddleInitial | Middle Initial of |
| -> RecipientType | |
| -> CardNumber |
|
| -> ExpMonth | Expiration Month |
| -> ExpYear | Expiration Year |
| -> CVC |
|
| -> Stripe Recipient |
Create a Recipient by a Card
Arguments
| :: FirstName | First Name of |
| -> LastName | Last Name of |
| -> Maybe MiddleInitial | Middle Initial of |
| -> RecipientType | |
| -> Country | |
| -> RoutingNumber |
|
| -> AccountNumber |
|
| -> Stripe Recipient |
Create a Recipient with a BankAccount
Arguments
| :: FirstName | First Name of |
| -> LastName | Last Name of |
| -> Maybe MiddleInitial | Middle Initial of |
| -> RecipientType | |
| -> Maybe TaxID | SSN for |
| -> Maybe Country | |
| -> Maybe RoutingNumber |
|
| -> Maybe AccountNumber |
|
| -> Maybe TokenId |
|
| -> Maybe CardNumber |
|
| -> Maybe ExpMonth | Expiration Month of |
| -> Maybe ExpYear | Expiration Year of |
| -> Maybe CVC | CVC of Card |
| -> Maybe Email | |
| -> Maybe Description | Create |
| -> MetaData | |
| -> Stripe Recipient |
Base Request for issues create Recipient requests
Arguments
| :: RecipientId | The |
| -> Stripe Recipient |
Retrieve a Recipient
Arguments
| :: RecipientId | The |
| -> ExpandParams |
|
| -> Stripe Recipient |
Retrieve a Recipient
Arguments
| :: Limit | Defaults to 10 if |
| -> StartingAfter RecipientId | Paginate starting after the following |
| -> EndingBefore RecipientId | Paginate ending before the following |
| -> Stripe (StripeList Recipient) |
Retrieve multiple Recipients
getRecipientsExpandable Source
Arguments
| :: Limit | Defaults to 10 if |
| -> StartingAfter RecipientId | Paginate starting after the following |
| -> EndingBefore RecipientId | Paginate ending before the following |
| -> ExpandParams |
|
| -> Stripe (StripeList Recipient) |
Retrieve multiple Recipients with ExpandParams
Arguments
| :: RecipientId | The |
| -> FirstName | First Name of |
| -> LastName | Last Name of |
| -> MiddleInitial | Middle Initial of |
| -> Stripe Recipient |
Update a Recipient FirstName, LastName and/or MiddleInitial
Arguments
| :: RecipientId | The |
| -> TaxID | |
| -> Stripe Recipient |
updateRecipientBankAccount Source
Arguments
| :: RecipientId | The |
| -> Country | |
| -> RoutingNumber |
|
| -> AccountNumber |
|
| -> Stripe Recipient |
Update a Recipient BankAccount
runStripe config $ updateRecipient (RecipientId "rp_4lpjaLFB5ecSks") BankAccount {
bankAccountCountry = Country "us"
, bankAccountRoutingNumber = RoutingNumber "071000013"
, bankAccountNumber = AccountNumber "293058719045"
}Arguments
| :: RecipientId | The |
| -> TokenId | |
| -> Stripe Recipient |
updateRecipientDefaultCard Source
Arguments
| :: RecipientId | The |
| -> CardId |
|
| -> 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 = 117updateRecipientDefaultCard
:: 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")
Arguments
| :: RecipientId | The |
| -> Stripe Recipient |
updateRecipientDescription Source
Arguments
| :: RecipientId | The |
| -> Description |
|
| -> Stripe Recipient |
Update a Recipient Description
runStripe config $ updateRecipientDescription (RecipientId "rp_4lpjaLFB5ecSks") (Email "name@domain.com")
updateRecipientMetaData Source
Arguments
| :: RecipientId | The |
| -> MetaData | |
| -> Stripe Recipient |
Arguments
| :: RecipientId | The |
| -> Maybe FirstName | First Name of |
| -> Maybe LastName | Last Name of |
| -> Maybe MiddleInitial | Middle Initial of |
| -> Maybe TaxID | SSN for |
| -> Maybe Country | |
| -> Maybe RoutingNumber |
|
| -> Maybe AccountNumber |
|
| -> Maybe TokenId | |
| -> Maybe CardNumber |
|
| -> Maybe ExpMonth | Expiration Month of |
| -> Maybe ExpYear | Expiration Year of |
| -> Maybe CVC | CVC of Card |
| -> Maybe CardId | The Default |
| -> Maybe Email | |
| -> Maybe Description | Create |
| -> MetaData | |
| -> Stripe Recipient |
Arguments
| :: RecipientId |
|
| -> Stripe StripeDeleteResult |
Delete a Recipient
>>>runStripe config $ deleteRecipient (RecipientId "rp_4lpjaLFB5ecSks")
Types
Recipient Object
Constructors
data RecipientId Source
RecipientId for a Recipient
Constructors
| RecipientId Text | |
| ExpandedRecipient Recipient |
Instances
| Eq RecipientId | |
| Show RecipientId | |
| FromJSON RecipientId | JSON Instance for |
type MiddleInitial = Char Source
Middle Initial of a Recipient
data RecipientType Source
Type of Recipient
Constructors
| Individual | |
| Corporation |
Instances
| Eq RecipientType | |
| Show RecipientType |
|
| FromJSON RecipientType | JSON Instance for |
data BankAccount Source
BankAccount Object
Constructors
| BankAccount | |
Instances
| Eq BankAccount | |
| Show BankAccount | |
| FromJSON BankAccount |
|
type Description = Text Source
Generic Description for use in constructing API Calls
Pagination Option for StripeList
data StripeDeleteResult Source
JSON returned from a Stripe deletion request
Instances
| Eq StripeDeleteResult | |
| Show StripeDeleteResult | |
| FromJSON StripeDeleteResult | JSON Instance for |
newtype AccountNumber Source
Account Number of a Bank Account
Constructors
| AccountNumber Text |
Instances