Stripe.Terminal.Reader (stripity_stripe v3.3.2)

View Source

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

card()

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

Simulated data for the card payment method.

card_present()

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

Simulated data for the card_present payment method.

cart()

@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.

choices()

@type choices() :: %{
  optional(:id) => binary(),
  optional(:style) => :primary | :secondary,
  optional(:text) => binary()
}

collect_config()

@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.

confirm_config()

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

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

custom_text()

@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

inputs()

@type inputs() :: %{
  optional(:custom_text) => custom_text(),
  optional(:required) => boolean(),
  optional(:selection) => selection(),
  optional(:toggles) => [toggles()],
  optional(:type) =>
    :email | :numeric | :phone | :selection | :signature | :text
}

interac_present()

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

Simulated data for the interac_present payment method.

line_items()

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

process_config()

@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.

refund_payment_config()

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

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

selection()

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

Options for the selection input

t()

@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.

tipping()

@type tipping() :: %{optional(:amount_eligible) => integer()}

Tipping configuration for this transaction.

toggles()

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

Functions

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

@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

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

@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

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

@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

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

@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

create(params \\ %{}, opts \\ [])

@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

delete(reader, opts \\ [])

@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}

list(params \\ %{}, opts \\ [])

@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

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

@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

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

@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

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

@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

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

@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

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

@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}

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

@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

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

@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

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

@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

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

@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}