pinxs v0.1.2 PINXS.Customers.Customer View Source
Provides functions for working with customers
Required Fields
When creating a Customer, the following fields must be provided
and one of
- card
- card_token
Link to this section Summary
Functions
Adds a card to a customer
Creates a customer
Deletes a customer
Deletes a card belonging to a customer
Retreives a customer
Retrieves a paginated list of customers
Retreives a specific page of customers
Retrieves all cards for the given customer
Retrieves all charges for customer
Updates a customer
Link to this section Types
Link to this type
t()
View Source
t() :: %PINXS.Customers.Customer{ card: nil | PINXS.Cards.Card.t(), card_token: nil | String.t(), email: String.t(), token: nil | String.t() }
Link to this section Functions
Link to this function
add_card(customer, card)
View Source
add_card(PINXS.Customers.Customer.t(), PINXS.Cards.Card.t()) :: {:ok, PINXS.Cards.Card.t()} | {:error, PINXS.Error.t()}
Adds a card to a customer
Link to this function
create(customer)
View Source
create(PINXS.Customers.Customer.t()) :: {:ok, PINXS.Customers.Customer.t()} | {:error | PINXS.Error.t()}
Creates a customer
Link to this function
delete(customer)
View Source
delete(PINXS.Customers.Customer.t()) :: {:ok, true} | {:error, PINXS.Error.t()}
Deletes a customer
Link to this function
delete_card(customer, card_token)
View Source
delete_card(PINXS.Customers.Customer.t(), String.t()) :: {:ok, PINXS.Customers.Customer.t()} | {:error, PINXS.Error.t()}
Deletes a card belonging to a customer
Link to this function
get(token)
View Source
get(String.t()) :: {:ok, PINXS.Customers.Customer.t()} | {:error, PINXS.Error.t()}
Retreives a customer
Link to this function
get_all()
View Source
get_all() :: {:ok, [PINXS.Customers.Customer.t()]} | {:error, PINXS.Error.t()}
Retrieves a paginated list of customers
Link to this function
get_all(page)
View Source
get_all(integer()) :: {:ok, [PINXS.Customers.Customer.t()]} | {:error, PINXS.Error.t()}
Retreives a specific page of customers
Link to this function
get_cards(customer)
View Source
get_cards(PINXS.Customers.Customer.t()) :: {:ok, [PINXS.Cards.Card.t()]} | {:error, PINXS.Error.t()}
Retrieves all cards for the given customer
Link to this function
get_charges(customer)
View Source
get_charges(PINXS.Customers.Customer.t()) :: {:ok, [PINXS.Charges.Charge.t()]} | {:error, PINXS.Error.t()}
Retrieves all charges for customer
Link to this function
update(customer, params)
View Source
update(PINXS.Customers.Customer.t(), map()) :: {:ok, PINXS.Customers.Customer.t()} | {:error, PINXS.Error.t()}
Updates a customer