pinxs v0.1.1 PINXS.Customers.Customer View Source

Provides functions for working with customers

Required Fields

When creating a Customer, the following fields must be provided

  • email

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

Adds a card to a customer

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

Retreives a customer

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

Updates a customer