Class: Square::TerminalApi
- Defined in:
- lib/square/api/terminal_api.rb
Overview
TerminalApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#cancel_terminal_action(action_id:) ⇒ CancelTerminalActionResponse Hash
Cancels a Terminal action request if the status of the request permits it.
-
#cancel_terminal_checkout(checkout_id:) ⇒ CancelTerminalCheckoutResponse Hash
Cancels a Terminal checkout request if the status of the request permits it.
-
#cancel_terminal_refund(terminal_refund_id:) ⇒ CancelTerminalRefundResponse Hash
Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it.
-
#create_terminal_action(body:) ⇒ CreateTerminalActionResponse Hash
Creates a Terminal action request and sends it to the specified device.
-
#create_terminal_checkout(body:) ⇒ CreateTerminalCheckoutResponse Hash
Creates a Terminal checkout request and sends it to the specified device to take a payment for the requested amount.
-
#create_terminal_refund(body:) ⇒ CreateTerminalRefundResponse Hash
Creates a request to refund an Interac payment completed on a Square Terminal.
-
#dismiss_terminal_action(action_id:) ⇒ DismissTerminalActionResponse Hash
Dismisses a Terminal action request if the status and type of the request permits it.
-
#dismiss_terminal_checkout(checkout_id:) ⇒ DismissTerminalCheckoutResponse Hash
Dismisses a Terminal checkout request if the status and type of the request permits it.
-
#dismiss_terminal_refund(terminal_refund_id:) ⇒ DismissTerminalRefundResponse Hash
Dismisses a Terminal refund request if the status and type of the request permits it.
-
#get_terminal_action(action_id:) ⇒ GetTerminalActionResponse Hash
Retrieves a Terminal action request by ‘action_id`.
-
#get_terminal_checkout(checkout_id:) ⇒ GetTerminalCheckoutResponse Hash
Retrieves a Terminal checkout request by ‘checkout_id`.
-
#get_terminal_refund(terminal_refund_id:) ⇒ GetTerminalRefundResponse Hash
Retrieves an Interac Terminal refund object by ID.
-
#search_terminal_actions(body:) ⇒ SearchTerminalActionsResponse Hash
Retrieves a filtered list of Terminal action requests created by the account making the request.
-
#search_terminal_checkouts(body:) ⇒ SearchTerminalCheckoutsResponse Hash
Returns a filtered list of Terminal checkout requests created by the application making the request.
-
#search_terminal_refunds(body:) ⇒ SearchTerminalRefundsResponse Hash
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request.
Methods inherited from BaseApi
#initialize, #new_api_call_builder, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from Square::BaseApi
Instance Method Details
#cancel_terminal_action(action_id:) ⇒ CancelTerminalActionResponse Hash
Cancels a Terminal action request if the status of the request permits it. ‘TerminalAction`.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/square/api/terminal_api.rb', line 75 def cancel_terminal_action(action_id:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/v2/terminals/actions/{action_id}/cancel', 'default') .template_param(new_parameter(action_id, key: 'action_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#cancel_terminal_checkout(checkout_id:) ⇒ CancelTerminalCheckoutResponse Hash
Cancels a Terminal checkout request if the status of the request permits it. desired ‘TerminalCheckout`.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/square/api/terminal_api.rb', line 190 def cancel_terminal_checkout(checkout_id:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/v2/terminals/checkouts/{checkout_id}/cancel', 'default') .template_param(new_parameter(checkout_id, key: 'checkout_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#cancel_terminal_refund(terminal_refund_id:) ⇒ CancelTerminalRefundResponse Hash
Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it. the desired ‘TerminalRefund`.
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/square/api/terminal_api.rb', line 303 def cancel_terminal_refund(terminal_refund_id:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/v2/terminals/refunds/{terminal_refund_id}/cancel', 'default') .template_param(new_parameter(terminal_refund_id, key: 'terminal_refund_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#create_terminal_action(body:) ⇒ CreateTerminalActionResponse Hash
Creates a Terminal action request and sends it to the specified device. containing the fields to POST for the request. See the corresponding object definition for field details.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/square/api/terminal_api.rb', line 9 def create_terminal_action(body:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/v2/terminals/actions', 'default') .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#create_terminal_checkout(body:) ⇒ CreateTerminalCheckoutResponse Hash
Creates a Terminal checkout request and sends it to the specified device to take a payment for the requested amount. containing the fields to POST for the request. See the corresponding object definition for field details.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/square/api/terminal_api.rb', line 122 def create_terminal_checkout(body:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/v2/terminals/checkouts', 'default') .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#create_terminal_refund(body:) ⇒ CreateTerminalRefundResponse Hash
Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see [Refunds API]($e/Refunds). containing the fields to POST for the request. See the corresponding object definition for field details.
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/square/api/terminal_api.rb', line 236 def create_terminal_refund(body:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/v2/terminals/refunds', 'default') .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#dismiss_terminal_action(action_id:) ⇒ DismissTerminalActionResponse Hash
Dismisses a Terminal action request if the status and type of the request permits it. See [Link and Dismiss Actions](developer.squareup.com/docs/terminal-api/advanced-feature s/custom-workflows/link-and-dismiss-actions) for more details. ‘TerminalAction` associated with the action to be dismissed.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/square/api/terminal_api.rb', line 99 def dismiss_terminal_action(action_id:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/v2/terminals/actions/{action_id}/dismiss', 'default') .template_param(new_parameter(action_id, key: 'action_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#dismiss_terminal_checkout(checkout_id:) ⇒ DismissTerminalCheckoutResponse Hash
Dismisses a Terminal checkout request if the status and type of the request permits it. ‘TerminalCheckout` associated with the checkout to be dismissed.
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/square/api/terminal_api.rb', line 211 def dismiss_terminal_checkout(checkout_id:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/v2/terminals/checkouts/{checkout_id}/dismiss', 'default') .template_param(new_parameter(checkout_id, key: 'checkout_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#dismiss_terminal_refund(terminal_refund_id:) ⇒ DismissTerminalRefundResponse Hash
Dismisses a Terminal refund request if the status and type of the request permits it. ‘TerminalRefund` associated with the refund to be dismissed.
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/square/api/terminal_api.rb', line 324 def dismiss_terminal_refund(terminal_refund_id:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/v2/terminals/refunds/{terminal_refund_id}/dismiss', 'default') .template_param(new_parameter(terminal_refund_id, key: 'terminal_refund_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#get_terminal_action(action_id:) ⇒ GetTerminalActionResponse Hash
Retrieves a Terminal action request by ‘action_id`. Terminal action requests are available for 30 days. `TerminalAction`.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/square/api/terminal_api.rb', line 55 def get_terminal_action(action_id:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/v2/terminals/actions/{action_id}', 'default') .template_param(new_parameter(action_id, key: 'action_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#get_terminal_checkout(checkout_id:) ⇒ GetTerminalCheckoutResponse Hash
Retrieves a Terminal checkout request by ‘checkout_id`. Terminal checkout requests are available for 30 days. desired `TerminalCheckout`.
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/square/api/terminal_api.rb', line 169 def get_terminal_checkout(checkout_id:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/v2/terminals/checkouts/{checkout_id}', 'default') .template_param(new_parameter(checkout_id, key: 'checkout_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#get_terminal_refund(terminal_refund_id:) ⇒ GetTerminalRefundResponse Hash
Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days. the desired ‘TerminalRefund`.
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/square/api/terminal_api.rb', line 282 def get_terminal_refund(terminal_refund_id:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/v2/terminals/refunds/{terminal_refund_id}', 'default') .template_param(new_parameter(terminal_refund_id, key: 'terminal_refund_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#search_terminal_actions(body:) ⇒ SearchTerminalActionsResponse Hash
Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days. containing the fields to POST for the request. See the corresponding object definition for field details.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/square/api/terminal_api.rb', line 33 def search_terminal_actions(body:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/v2/terminals/actions/search', 'default') .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#search_terminal_checkouts(body:) ⇒ SearchTerminalCheckoutsResponse Hash
Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days. containing the fields to POST for the request. See the corresponding object definition for field details.
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/square/api/terminal_api.rb', line 147 def search_terminal_checkouts(body:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/v2/terminals/checkouts/search', 'default') .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#search_terminal_refunds(body:) ⇒ SearchTerminalRefundsResponse Hash
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days. containing the fields to POST for the request. See the corresponding object definition for field details.
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/square/api/terminal_api.rb', line 260 def search_terminal_refunds(body:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::POST, '/v2/terminals/refunds/search', 'default') .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |