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

A Reader represents a physical device for accepting payment details.

Related guide: Connecting to a reader

Summary

Types

Simulated data for the card payment method.

Simulated data for the card_present payment method.

Cart details to display on the reader screen, including line items, amounts, and currency.

Configuration overrides for this collection, such as tipping, surcharging, and customer cancellation settings.

Configuration overrides for this confirmation, such as surcharge settings and return URL.

Customize the text which will be displayed while collecting this input

Simulated data for the interac_present payment method.

Configuration overrides for this transaction, such as tipping and customer cancellation settings.

Configuration overrides for this refund, such as customer cancellation settings.

Options for the selection input

t()

The terminal.reader type.

Tipping configuration for this transaction.

Functions

Cancels the current reader action. See Programmatic Cancellation for more details.

Initiates an input collection flow on a Reader to display input forms and collect information from your customers.

Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See Collecting a Payment method for more details.

Finalizes a payment on a Reader. See Confirming a Payment for more details.

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. See process the payment for more details.

Initiates a SetupIntent flow on a Reader. See Save directly without charging for more details.

Initiates an in-person refund on a Reader. See Refund an Interac Payment for more details.

Retrieves a Reader object.

Use this endpoint to trigger a successful input collection on a simulated reader.

Use this endpoint to complete an input collection with a timeout error on a simulated reader.

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

Types

@type card() :: %{
  optional(:cvc) => binary(),
  optional(:exp_month) => integer(),
  optional(:exp_year) => integer(),
  optional(:number) => binary()
}

Simulated data for the card payment method.

@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 details to display on the reader screen, including line items, amounts, and currency.

@type choices() :: %{
  optional(:id) => binary(),
  optional(:style) => :primary | :secondary,
  optional(:text) => binary()
}
@type collect_config() :: %{
  optional(:allow_redisplay) => :always | :limited | :unspecified,
  optional(:enable_customer_cancellation) => boolean(),
  optional(:skip_tipping) => boolean(),
  optional(:tipping) => tipping()
}

Configuration overrides for this collection, such as tipping, surcharging, and customer cancellation settings.

@type confirm_config() :: %{optional(:return_url) => binary()}

Configuration overrides for this confirmation, such as surcharge settings and return URL.

@type custom_text() :: %{
  optional(:description) => binary(),
  optional(:skip_button) => binary(),
  optional(:submit_button) => binary(),
  optional(:title) => binary()
}

Customize the text which will be displayed while collecting this input

@type inputs() :: %{
  optional(:custom_text) => custom_text(),
  optional(:required) => boolean(),
  optional(:selection) => selection(),
  optional(:toggles) => [toggles()],
  optional(:type) =>
    :email | :numeric | :phone | :selection | :signature | :text
}
@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(:allow_redisplay) => :always | :limited | :unspecified,
  optional(:enable_customer_cancellation) => boolean(),
  optional(:return_url) => binary(),
  optional(:skip_tipping) => boolean(),
  optional(:tipping) => tipping()
}

Configuration overrides for this transaction, such as tipping and customer cancellation settings.

Link to this type

refund_payment_config()

View Source
@type refund_payment_config() :: %{
  optional(:enable_customer_cancellation) => boolean()
}

Configuration overrides for this refund, such as customer cancellation settings.

@type selection() :: %{optional(:choices) => [choices()]}

Options for the selection input

@type t() :: %Stripe.Terminal.Reader{
  action: term() | nil,
  device_sw_version: binary() | nil,
  device_type: binary(),
  id: binary(),
  ip_address: binary() | nil,
  label: binary(),
  last_seen_at: integer() | nil,
  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 Device type of the reader.
  • 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.
  • last_seen_at The last time this reader reported to Stripe backend.
  • 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. We do not recommend using this field in flows that may block taking payments.
@type tipping() :: %{optional(:amount_eligible) => integer()}

Tipping configuration for this transaction.

@type toggles() :: %{
  optional(:default_value) => :disabled | :enabled,
  optional(:description) => binary(),
  optional(:title) => binary()
}

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. See Programmatic Cancellation for more details.

Details

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

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

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

Initiates an input collection flow on a Reader to display input forms and collect information from your customers.

Details

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

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

View Source
@spec collect_payment_method(
  reader :: binary(),
  params :: %{
    optional(:collect_config) => collect_config(),
    optional(:expand) => [binary()],
    optional(:payment_intent) => binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See Collecting a Payment method for more details.

Details

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

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

View Source
@spec confirm_payment_intent(
  reader :: binary(),
  params :: %{
    optional(:confirm_config) => confirm_config(),
    optional(:expand) => [binary()],
    optional(:payment_intent) => binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Finalizes a payment on a Reader. See Confirming a Payment for more details.

Details

  • Method: post
  • Path: /v1/terminal/readers/{reader}/confirm_payment_intent
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
      | :mobile_phone_reader
      | :simulated_stripe_s700
      | :simulated_wisepos_e
      | :stripe_m2
      | :stripe_s700
      | :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) => card(),
    optional(:card_present) => card_present(),
    optional(:expand) => [binary()],
    optional(:interac_present) => interac_present(),
    optional(:type) => :card | :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. See process the payment for more details.

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(:allow_redisplay) => :always | :limited | :unspecified,
    optional(:expand) => [binary()],
    optional(:process_config) => process_config(),
    optional(:setup_intent) => binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Initiates a SetupIntent flow on a Reader. See Save directly without charging for more details.

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(:refund_payment_config) => refund_payment_config(),
    optional(:reverse_transfer) => boolean()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Initiates an in-person refund on a Reader. See Refund an Interac Payment for more details.

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 the reader display to show cart details.

Details

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

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

View Source
@spec succeed_input_collection(
  reader :: binary(),
  params :: %{
    optional(:expand) => [binary()],
    optional(:skip_non_required_inputs) => :all | :none
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Use this endpoint to trigger a successful input collection on a simulated reader.

Details

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

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

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

Use this endpoint to complete an input collection with a timeout error on a simulated reader.

Details

  • Method: post
  • Path: /v1/test_helpers/terminal/readers/{reader}/timeout_input_collection
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}