Class: Stripe::TestHelpers::Terminal::ReaderService

Inherits:
StripeService
  • Object
show all
Defined in:
lib/stripe/services/test_helpers/terminal/reader_service.rb

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#present_payment_method(reader, params = {}, opts = {}) ⇒ Object

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



9
10
11
12
13
14
15
16
17
# File 'lib/stripe/services/test_helpers/terminal/reader_service.rb', line 9

def present_payment_method(reader, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/test_helpers/terminal/readers/%<reader>s/present_payment_method", { reader: CGI.escape(reader) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#succeed_input_collection(reader, params = {}, opts = {}) ⇒ Object

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



20
21
22
23
24
25
26
27
28
# File 'lib/stripe/services/test_helpers/terminal/reader_service.rb', line 20

def succeed_input_collection(reader, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/test_helpers/terminal/readers/%<reader>s/succeed_input_collection", { reader: CGI.escape(reader) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#timeout_input_collection(reader, params = {}, opts = {}) ⇒ Object

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



31
32
33
34
35
36
37
38
39
# File 'lib/stripe/services/test_helpers/terminal/reader_service.rb', line 31

def timeout_input_collection(reader, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/test_helpers/terminal/readers/%<reader>s/timeout_input_collection", { reader: CGI.escape(reader) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end