Class: Stripe::Terminal::ReaderService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/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

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

Cancels the current reader action.



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

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

#create(params = {}, opts = {}) ⇒ Object

Creates a new Reader object.



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

def create(params = {}, opts = {})
  request(
    method: :post,
    path: "/v1/terminal/readers",
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Deletes a Reader object.



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

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

#list(params = {}, opts = {}) ⇒ Object

Returns a list of Reader objects.



41
42
43
44
45
46
47
48
49
# File 'lib/stripe/services/terminal/reader_service.rb', line 41

def list(params = {}, opts = {})
  request(
    method: :get,
    path: "/v1/terminal/readers",
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Initiates a payment flow on a Reader.



52
53
54
55
56
57
58
59
60
# File 'lib/stripe/services/terminal/reader_service.rb', line 52

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

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

Initiates a setup intent flow on a Reader.



63
64
65
66
67
68
69
70
71
# File 'lib/stripe/services/terminal/reader_service.rb', line 63

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

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

Initiates a refund on a Reader



74
75
76
77
78
79
80
81
82
# File 'lib/stripe/services/terminal/reader_service.rb', line 74

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

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

Retrieves a Reader object.



85
86
87
88
89
90
91
92
93
# File 'lib/stripe/services/terminal/reader_service.rb', line 85

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

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

Sets reader display to show cart details.



96
97
98
99
100
101
102
103
104
# File 'lib/stripe/services/terminal/reader_service.rb', line 96

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

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

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



107
108
109
110
111
112
113
114
115
# File 'lib/stripe/services/terminal/reader_service.rb', line 107

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