View Source Stripe.Terminal.Reader (Striped v0.2.0)

A Reader represents a physical device for accepting payment details.

Related guide: Connecting to a Reader.

Link to this section Summary

Types

Simulated data for the card_present payment method

Cart

Configuration overrides

t()

The terminal.reader type.

Functions

Cancels the current reader action.

Creates a new Reader object.

Deletes a Reader object.

Returns a list of Reader objects.

Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.

Initiates a payment flow on a Reader.

Initiates a setup intent flow on a Reader.

Retrieves a Reader object.

Sets reader display to show cart details.

Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Link to this section Types

@type card_present() :: %{optional(:number) => :string}

Simulated data for the card_present payment method

@type cart() :: %{
  optional(:currency) => :string,
  optional(:line_items) => [:object],
  optional(:tax) => :integer,
  optional(:total) => :integer
}

Cart

@type process_config() :: %{optional(:skip_tipping) => :boolean}

Configuration overrides

@type t() :: %Stripe.Terminal.Reader{
  action: term() | nil,
  device_sw_version: binary() | nil,
  device_type: binary(),
  id: binary(),
  ip_address: binary() | nil,
  label: binary(),
  livemode: boolean(),
  location: (binary() | Stripe.Terminal.Location.t()) | nil,
  metadata: term(),
  object: binary(),
  serial_number: binary(),
  status: binary() | nil
}

The terminal.reader type.

  • action The most recent action performed by the reader.
  • device_sw_version The current software version of the reader.
  • device_type Type of reader, one of bbpos_wisepad3, stripe_m2, bbpos_chipper2x, bbpos_wisepos_e, verifone_P400, or simulated_wisepos_e.
  • id Unique identifier for the object.
  • ip_address The local IP address of the reader.
  • label Custom label given to the reader for easier identification.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • location The location identifier of the reader.
  • metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
  • object String representing the object's type. Objects of the same type share the same value.
  • serial_number Serial number of the reader.
  • status The networking status of the reader.

Link to this section Functions

Link to this function

cancel_action(client, reader, params \\ %{})

View Source
@spec cancel_action(
  client :: term(),
  reader :: binary(),
  params :: %{optional(:expand) => [:string]}
) ::
  {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Cancels the current reader action.

Details

  • Method: post
  • Path: /v1/terminal/readers/{reader}/cancel_action
Link to this function

create(client, params \\ %{})

View Source
@spec create(
  client :: term(),
  params :: %{
    optional(:expand) => [:string],
    optional(:label) => :string,
    optional(:location) => :string,
    optional(:metadata) => :object | :string,
    registration_code: :string
  }
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Creates a new Reader object.

Details

  • Method: post
  • Path: /v1/terminal/readers
@spec delete(client :: term(), reader :: binary()) ::
  {:ok, Stripe.DeletedTerminal.Reader.t()}
  | {:error, Stripe.ApiErrors.t()}
  | {:error, term()}

Deletes a Reader object.

Details

  • Method: delete
  • Path: /v1/terminal/readers/{reader}
Link to this function

list(client, params \\ %{})

View Source
@spec list(
  client :: term(),
  params :: %{
    optional(:device_type) =>
      :bbpos_chipper2x
      | :bbpos_wisepad3
      | :bbpos_wisepos_e
      | :simulated_wisepos_e
      | :stripe_m2
      | :verifone_P400,
    optional(:ending_before) => :string,
    optional(:expand) => [:string],
    optional(:limit) => :integer,
    optional(:location) => :string,
    optional(:starting_after) => :string,
    optional(:status) => :offline | :online
  }
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Returns a list of Reader objects.

Details

  • Method: get
  • Path: /v1/terminal/readers
Link to this function

present_payment_method(client, reader, params \\ %{})

View Source
@spec present_payment_method(
  client :: term(),
  reader :: binary(),
  params :: %{
    optional(:card_present) => card_present(),
    optional(:expand) => [:string],
    optional(:type) => :card_present
  }
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.

Details

  • Method: post
  • Path: /v1/test_helpers/terminal/readers/{reader}/present_payment_method
Link to this function

process_payment_intent(client, reader, params \\ %{})

View Source
@spec process_payment_intent(
  client :: term(),
  reader :: binary(),
  params :: %{
    optional(:expand) => [:string],
    :payment_intent => :string,
    optional(:process_config) => process_config()
  }
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Initiates a payment flow on a Reader.

Details

  • Method: post
  • Path: /v1/terminal/readers/{reader}/process_payment_intent
Link to this function

process_setup_intent(client, reader, params \\ %{})

View Source
@spec process_setup_intent(
  client :: term(),
  reader :: binary(),
  params :: %{
    :customer_consent_collected => :boolean,
    optional(:expand) => [:string],
    setup_intent: :string
  }
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Initiates a setup intent flow on a Reader.

Details

  • Method: post
  • Path: /v1/terminal/readers/{reader}/process_setup_intent
Link to this function

retrieve(client, reader, params \\ %{})

View Source
@spec retrieve(
  client :: term(),
  reader :: binary(),
  params :: %{optional(:expand) => [:string]}
) ::
  {:ok, t() | Stripe.DeletedTerminal.Reader.t()}
  | {:error, Stripe.ApiErrors.t()}
  | {:error, term()}

Retrieves a Reader object.

Details

  • Method: get
  • Path: /v1/terminal/readers/{reader}
Link to this function

set_reader_display(client, reader, params \\ %{})

View Source
@spec set_reader_display(
  client :: term(),
  reader :: binary(),
  params :: %{
    optional(:cart) => cart(),
    optional(:expand) => [:string],
    type: :cart
  }
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Sets reader display to show cart details.

Details

  • Method: post
  • Path: /v1/terminal/readers/{reader}/set_reader_display
Link to this function

update(client, reader, params \\ %{})

View Source
@spec update(
  client :: term(),
  reader :: binary(),
  params :: %{
    optional(:expand) => [:string],
    optional(:label) => :string,
    optional(:metadata) => :object | :string
  }
) ::
  {:ok, t() | Stripe.DeletedTerminal.Reader.t()}
  | {:error, Stripe.ApiErrors.t()}
  | {:error, term()}

Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Details

  • Method: post
  • Path: /v1/terminal/readers/{reader}