terminal_api = client.terminal
TerminalApi
- Create Terminal Action
- Search Terminal Actions
- Get Terminal Action
- Cancel Terminal Action
- Dismiss Terminal Action
- Create Terminal Checkout
- Search Terminal Checkouts
- Get Terminal Checkout
- Cancel Terminal Checkout
- Dismiss Terminal Checkout
- Create Terminal Refund
- Search Terminal Refunds
- Get Terminal Refund
- Cancel Terminal Refund
- Dismiss Terminal Refund
Creates a Terminal action request and sends it to the specified device.
def create_terminal_action(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Create Terminal Action Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Create Terminal Action Response Hash
.
body = {
:idempotency_key => 'thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e',
:action => {
:device_id => '{{DEVICE_ID}}',
:deadline_duration => 'PT5M',
:type => 'SAVE_CARD',
:save_card_options => {
:customer_id => '{{CUSTOMER_ID}}',
:reference_id => 'user-id-1'
}
}
}
result = terminal_api.create_terminal_action(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days.
def search_terminal_actions(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Search Terminal Actions Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Search Terminal Actions Response Hash
.
body = {
:query => {
:filter => {
:created_at => {
:start_at => '2022-04-01T00:00:00.000Z'
}
},
:sort => {
:sort_order => 'DESC'
}
},
:limit => 2
}
result = terminal_api.search_terminal_actions(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Retrieves a Terminal action request by action_id
. Terminal action requests are available for 30 days.
def get_terminal_action(action_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
action_id |
String |
Template, Required | Unique ID for the desired TerminalAction . |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Get Terminal Action Response Hash
.
action_id = 'action_id6'
result = terminal_api.get_terminal_action(action_id: action_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Cancels a Terminal action request if the status of the request permits it.
def cancel_terminal_action(action_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
action_id |
String |
Template, Required | Unique ID for the desired TerminalAction . |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Cancel Terminal Action Response Hash
.
action_id = 'action_id6'
result = terminal_api.cancel_terminal_action(action_id: action_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Dismisses a Terminal action request if the status and type of the request permits it.
See Link and Dismiss Actions for more details.
def dismiss_terminal_action(action_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
action_id |
String |
Template, Required | Unique ID for the TerminalAction associated with the action to be dismissed. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Dismiss Terminal Action Response Hash
.
action_id = 'action_id6'
result = terminal_api.dismiss_terminal_action(action_id: action_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Creates a Terminal checkout request and sends it to the specified device to take a payment for the requested amount.
def create_terminal_checkout(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Create Terminal Checkout Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Create Terminal Checkout Response Hash
.
body = {
:idempotency_key => '28a0c3bc-7839-11ea-bc55-0242ac130003',
:checkout => {
:amount_money => {
:amount => 2610,
:currency => 'USD'
},
:device_options => {
:device_id => 'dbb5d83a-7838-11ea-bc55-0242ac130003'
},
:reference_id => 'id11572',
:note => 'A brief note'
}
}
result = terminal_api.create_terminal_checkout(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
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.
def search_terminal_checkouts(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Search Terminal Checkouts Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Search Terminal Checkouts Response Hash
.
body = {
:query => {
:filter => {
:status => 'COMPLETED'
}
},
:limit => 2
}
result = terminal_api.search_terminal_checkouts(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Retrieves a Terminal checkout request by checkout_id
. Terminal checkout requests are available for 30 days.
def get_terminal_checkout(checkout_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
checkout_id |
String |
Template, Required | The unique ID for the desired TerminalCheckout . |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Get Terminal Checkout Response Hash
.
checkout_id = 'checkout_id8'
result = terminal_api.get_terminal_checkout(checkout_id: checkout_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Cancels a Terminal checkout request if the status of the request permits it.
def cancel_terminal_checkout(checkout_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
checkout_id |
String |
Template, Required | The unique ID for the desired TerminalCheckout . |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Cancel Terminal Checkout Response Hash
.
checkout_id = 'checkout_id8'
result = terminal_api.cancel_terminal_checkout(checkout_id: checkout_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Dismisses a Terminal checkout request if the status and type of the request permits it.
def dismiss_terminal_checkout(checkout_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
checkout_id |
String |
Template, Required | Unique ID for the TerminalCheckout associated with the checkout to be dismissed. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Dismiss Terminal Checkout Response Hash
.
checkout_id = 'checkout_id8'
result = terminal_api.dismiss_terminal_checkout(checkout_id: checkout_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
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.
def create_terminal_refund(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Create Terminal Refund Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Create Terminal Refund Response Hash
.
body = {
:idempotency_key => '402a640b-b26f-401f-b406-46f839590c04',
:refund => {
:payment_id => '5O5OvgkcNUhl7JBuINflcjKqUzXZY',
:amount_money => {
:amount => 111,
:currency => 'CAD'
},
:reason => 'Returning items',
:device_id => 'f72dfb8e-4d65-4e56-aade-ec3fb8d33291'
}
}
result = terminal_api.create_terminal_refund(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days.
def search_terminal_refunds(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Search Terminal Refunds Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Search Terminal Refunds Response Hash
.
body = {
:query => {
:filter => {
:status => 'COMPLETED'
}
},
:limit => 1
}
result = terminal_api.search_terminal_refunds(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days.
def get_terminal_refund(terminal_refund_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
terminal_refund_id |
String |
Template, Required | The unique ID for the desired TerminalRefund . |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Get Terminal Refund Response Hash
.
terminal_refund_id = 'terminal_refund_id0'
result = terminal_api.get_terminal_refund(terminal_refund_id: terminal_refund_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it.
def cancel_terminal_refund(terminal_refund_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
terminal_refund_id |
String |
Template, Required | The unique ID for the desired TerminalRefund . |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Cancel Terminal Refund Response Hash
.
terminal_refund_id = 'terminal_refund_id0'
result = terminal_api.cancel_terminal_refund(terminal_refund_id: terminal_refund_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Dismisses a Terminal refund request if the status and type of the request permits it.
def dismiss_terminal_refund(terminal_refund_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
terminal_refund_id |
String |
Template, Required | Unique ID for the TerminalRefund associated with the refund to be dismissed. |
This method returns a ApiResponse
instance. The data
property in this instance returns the response data which is of type Dismiss Terminal Refund Response Hash
.
terminal_refund_id = 'terminal_refund_id0'
result = terminal_api.dismiss_terminal_refund(terminal_refund_id: terminal_refund_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end