View Source Stripe.Terminal.Reader (stripity_stripe v3.2.0)

A Reader represents a physical device for accepting payment details.

Related guide: Connecting to a reader

Summary

Types

Simulated data for the card_present payment method.

Cart

Simulated data for the interac_present payment method.

Configuration overrides

t()

The terminal.reader type.

Tipping configuration for this transaction.

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.

Initiates a refund 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.

Types

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

Simulated data for the card_present payment method.

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

Cart

@type interac_present() :: %{optional(:number) => binary()}

Simulated data for the interac_present payment method.

@type line_items() :: %{
  optional(:amount) => integer(),
  optional(:description) => binary(),
  optional(:quantity) => integer()
}
@type process_config() :: %{
  optional(:skip_tipping) => boolean(),
  optional(:tipping) => tipping()
}

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.
@type tipping() :: %{optional(:amount_eligible) => integer()}

Tipping configuration for this transaction.

Functions

Link to this function

cancel_action(reader, params \\ %{}, opts \\ [])

View Source
@spec cancel_action(
  reader :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {: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(params \\ %{}, opts \\ [])

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

Creates a new Reader object.

Details

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

delete(reader, opts \\ [])

View Source
@spec delete(reader :: binary(), opts :: Keyword.t()) ::
  {: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(params \\ %{}, opts \\ [])

View Source
@spec list(
  params :: %{
    optional(:device_type) =>
      :bbpos_chipper2x
      | :bbpos_wisepad3
      | :bbpos_wisepos_e
      | :simulated_wisepos_e
      | :stripe_m2
      | :verifone_P400,
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:limit) => integer(),
    optional(:location) => binary(),
    optional(:serial_number) => binary(),
    optional(:starting_after) => binary(),
    optional(:status) => :offline | :online
  },
  opts :: Keyword.t()
) ::
  {: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(reader, params \\ %{}, opts \\ [])

View Source
@spec present_payment_method(
  reader :: binary(),
  params :: %{
    optional(:amount_tip) => integer(),
    optional(:card_present) => card_present(),
    optional(:expand) => [binary()],
    optional(:interac_present) => interac_present(),
    optional(:type) => :card_present | :interac_present
  },
  opts :: Keyword.t()
) :: {: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(reader, params \\ %{}, opts \\ [])

View Source
@spec process_payment_intent(
  reader :: binary(),
  params :: %{
    optional(:expand) => [binary()],
    optional(:payment_intent) => binary(),
    optional(:process_config) => process_config()
  },
  opts :: Keyword.t()
) :: {: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(reader, params \\ %{}, opts \\ [])

View Source
@spec process_setup_intent(
  reader :: binary(),
  params :: %{
    optional(:customer_consent_collected) => boolean(),
    optional(:expand) => [binary()],
    optional(:process_config) => map(),
    optional(:setup_intent) => binary()
  },
  opts :: Keyword.t()
) :: {: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

refund_payment(reader, params \\ %{}, opts \\ [])

View Source
@spec refund_payment(
  reader :: binary(),
  params :: %{
    optional(:amount) => integer(),
    optional(:charge) => binary(),
    optional(:expand) => [binary()],
    optional(:metadata) => %{optional(binary()) => binary()},
    optional(:payment_intent) => binary(),
    optional(:refund_application_fee) => boolean(),
    optional(:reverse_transfer) => boolean()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Initiates a refund on a Reader

Details

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

retrieve(reader, params \\ %{}, opts \\ [])

View Source
@spec retrieve(
  reader :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) ::
  {: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(reader, params \\ %{}, opts \\ [])

View Source
@spec set_reader_display(
  reader :: binary(),
  params :: %{
    optional(:cart) => cart(),
    optional(:expand) => [binary()],
    optional(:type) => :cart
  },
  opts :: Keyword.t()
) :: {: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(reader, params \\ %{}, opts \\ [])

View Source
@spec update(
  reader :: binary(),
  params :: %{
    optional(:expand) => [binary()],
    optional(:label) => binary() | binary(),
    optional(:metadata) => %{optional(binary()) => binary()} | binary()
  },
  opts :: Keyword.t()
) ::
  {: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}