square_connect 2.0.2.69 → 2.1.0.beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +133 -21
  3. data/docs/ChargeRequest.md +1 -1
  4. data/docs/CheckoutApi.md +8 -6
  5. data/docs/CustomersApi.md +389 -0
  6. data/docs/Device.md +11 -0
  7. data/docs/LocationsApi.md +55 -0
  8. data/docs/TransactionsApi.md +417 -0
  9. data/docs/V1AdjustInventoryRequest.md +12 -0
  10. data/docs/V1BankAccount.md +17 -0
  11. data/docs/V1CashDrawerEvent.md +15 -0
  12. data/docs/V1CashDrawerShift.md +28 -0
  13. data/docs/V1Category.md +11 -0
  14. data/docs/V1CreateRefundRequest.md +14 -0
  15. data/docs/V1Discount.md +16 -0
  16. data/docs/V1Employee.md +21 -0
  17. data/docs/V1EmployeeRole.md +15 -0
  18. data/docs/V1EmployeesApi.md +915 -0
  19. data/docs/V1Fee.md +18 -0
  20. data/docs/V1InventoryEntry.md +11 -0
  21. data/docs/V1Item.md +23 -0
  22. data/docs/V1ItemImage.md +11 -0
  23. data/docs/V1ItemsApi.md +2297 -0
  24. data/docs/V1LocationApi.md +102 -0
  25. data/docs/V1LocationsApi.md +102 -0
  26. data/docs/V1Merchant.md +26 -0
  27. data/docs/V1MerchantLocationDetails.md +12 -0
  28. data/docs/V1ModifierList.md +13 -0
  29. data/docs/V1ModifierOption.md +15 -0
  30. data/docs/V1Money.md +13 -0
  31. data/docs/V1Order.md +34 -0
  32. data/docs/V1OrderHistoryEntry.md +11 -0
  33. data/docs/V1Page.md +13 -0
  34. data/docs/V1PageCell.md +15 -0
  35. data/docs/V1Payment.md +33 -0
  36. data/docs/V1PaymentDiscount.md +12 -0
  37. data/docs/V1PaymentItemDetail.md +13 -0
  38. data/docs/V1PaymentItemization.md +23 -0
  39. data/docs/V1PaymentModifier.md +12 -0
  40. data/docs/V1PaymentTax.md +15 -0
  41. data/docs/V1PhoneNumber.md +13 -0
  42. data/docs/V1Refund.md +16 -0
  43. data/docs/V1Settlement.md +15 -0
  44. data/docs/V1SettlementEntry.md +13 -0
  45. data/docs/V1Tender.md +22 -0
  46. data/docs/V1Timecard.md +20 -0
  47. data/docs/V1TimecardEvent.md +14 -0
  48. data/docs/V1TransactionsApi.md +650 -0
  49. data/docs/V1UpdateModifierListRequest.md +11 -0
  50. data/docs/V1UpdateOrderRequest.md +14 -0
  51. data/docs/V1Variation.md +20 -0
  52. data/lib/.DS_Store +0 -0
  53. data/lib/square_connect.rb +46 -5
  54. data/lib/square_connect/.DS_Store +0 -0
  55. data/lib/square_connect/api/checkout_api.rb +4 -9
  56. data/lib/square_connect/api/{customer_api.rb → customers_api.rb} +150 -61
  57. data/lib/square_connect/api/{location_api.rb → locations_api.rb} +7 -12
  58. data/lib/square_connect/api/{transaction_api.rb → transactions_api.rb} +169 -65
  59. data/lib/square_connect/api/v1_employees_api.rb +974 -0
  60. data/lib/square_connect/api/v1_items_api.rb +2365 -0
  61. data/lib/square_connect/api/v1_locations_api.rb +118 -0
  62. data/lib/square_connect/api/v1_transactions_api.rb +707 -0
  63. data/lib/square_connect/api_client.rb +1 -1
  64. data/lib/square_connect/models/charge_request.rb +1 -1
  65. data/lib/square_connect/models/device.rb +196 -0
  66. data/lib/square_connect/models/v1_adjust_inventory_request.rb +206 -0
  67. data/lib/square_connect/models/v1_bank_account.rb +289 -0
  68. data/lib/square_connect/models/v1_cash_drawer_event.rb +269 -0
  69. data/lib/square_connect/models/v1_cash_drawer_shift.rb +403 -0
  70. data/lib/square_connect/models/v1_category.rb +196 -0
  71. data/lib/square_connect/models/v1_create_refund_request.rb +274 -0
  72. data/lib/square_connect/models/v1_discount.rb +291 -0
  73. data/lib/square_connect/models/v1_employee.rb +323 -0
  74. data/lib/square_connect/models/v1_employee_role.rb +269 -0
  75. data/lib/square_connect/models/v1_fee.rb +335 -0
  76. data/lib/square_connect/models/v1_inventory_entry.rb +196 -0
  77. data/lib/square_connect/models/v1_item.rb +379 -0
  78. data/lib/square_connect/models/v1_item_image.rb +196 -0
  79. data/lib/square_connect/models/v1_merchant.rb +372 -0
  80. data/lib/square_connect/models/v1_merchant_location_details.rb +186 -0
  81. data/lib/square_connect/models/v1_modifier_list.rb +251 -0
  82. data/lib/square_connect/models/v1_modifier_option.rb +236 -0
  83. data/lib/square_connect/models/v1_money.rb +229 -0
  84. data/lib/square_connect/models/v1_order.rb +463 -0
  85. data/lib/square_connect/models/v1_order_history_entry.rb +229 -0
  86. data/lib/square_connect/models/v1_page.rb +218 -0
  87. data/lib/square_connect/models/v1_page_cell.rb +261 -0
  88. data/lib/square_connect/models/v1_payment.rb +423 -0
  89. data/lib/square_connect/models/v1_payment_discount.rb +206 -0
  90. data/lib/square_connect/models/v1_payment_item_detail.rb +216 -0
  91. data/lib/square_connect/models/v1_payment_itemization.rb +355 -0
  92. data/lib/square_connect/models/v1_payment_modifier.rb +206 -0
  93. data/lib/square_connect/models/v1_payment_tax.rb +271 -0
  94. data/lib/square_connect/models/v1_phone_number.rb +206 -0
  95. data/lib/square_connect/models/v1_refund.rb +279 -0
  96. data/lib/square_connect/models/v1_settlement.rb +271 -0
  97. data/lib/square_connect/models/v1_settlement_entry.rb +249 -0
  98. data/lib/square_connect/models/v1_tender.rb +363 -0
  99. data/lib/square_connect/models/v1_timecard.rb +271 -0
  100. data/lib/square_connect/models/v1_timecard_event.rb +259 -0
  101. data/lib/square_connect/models/v1_update_modifier_list_request.rb +229 -0
  102. data/lib/square_connect/models/v1_update_order_request.rb +264 -0
  103. data/lib/square_connect/models/v1_variation.rb +331 -0
  104. data/lib/square_connect/version.rb +1 -1
  105. data/spec/.DS_Store +0 -0
  106. data/spec/api/checkout_api_spec.rb +4 -12
  107. data/spec/api/{customer_api_spec.rb → customers_api_spec.rb} +39 -41
  108. data/spec/api/{location_api_spec.rb → locations_api_spec.rb} +9 -15
  109. data/spec/api/{transaction_api_spec.rb → transactions_api_spec.rb} +43 -41
  110. data/spec/api/v1_employees_api_spec.rb +250 -0
  111. data/spec/api/v1_items_api_spec.rb +568 -0
  112. data/spec/api/v1_locations_api_spec.rb +54 -0
  113. data/spec/api/v1_transactions_api_spec.rb +186 -0
  114. data/spec/models/address_spec.rb +22 -81
  115. data/spec/models/capture_transaction_request_spec.rb +3 -6
  116. data/spec/models/capture_transaction_response_spec.rb +4 -11
  117. data/spec/models/card_brand_spec.rb +3 -6
  118. data/spec/models/card_spec.rb +14 -41
  119. data/spec/models/charge_request_spec.rb +14 -61
  120. data/spec/models/charge_response_spec.rb +5 -16
  121. data/spec/models/checkout_spec.rb +12 -51
  122. data/spec/models/country_spec.rb +3 -6
  123. data/spec/models/create_checkout_request_spec.rb +10 -41
  124. data/spec/models/create_checkout_response_spec.rb +5 -16
  125. data/spec/models/create_customer_card_request_spec.rb +6 -21
  126. data/spec/models/create_customer_card_response_spec.rb +5 -16
  127. data/spec/models/create_customer_request_spec.rb +12 -51
  128. data/spec/models/create_customer_response_spec.rb +5 -16
  129. data/spec/models/create_order_request_line_item_spec.rb +6 -21
  130. data/spec/models/create_order_request_order_spec.rb +5 -16
  131. data/spec/models/create_order_request_spec.rb +5 -16
  132. data/spec/models/create_refund_request_spec.rb +7 -26
  133. data/spec/models/create_refund_response_spec.rb +5 -16
  134. data/spec/models/currency_spec.rb +3 -6
  135. data/spec/models/customer_group_info_spec.rb +5 -16
  136. data/spec/models/customer_preferences_spec.rb +4 -11
  137. data/spec/models/customer_spec.rb +18 -81
  138. data/spec/models/delete_customer_card_request_spec.rb +3 -6
  139. data/spec/models/delete_customer_card_response_spec.rb +4 -11
  140. data/spec/models/delete_customer_request_spec.rb +3 -6
  141. data/spec/models/delete_customer_response_spec.rb +4 -11
  142. data/spec/models/device_spec.rb +45 -0
  143. data/spec/models/error_category_spec.rb +3 -6
  144. data/spec/models/error_code_spec.rb +3 -6
  145. data/spec/models/error_spec.rb +15 -26
  146. data/spec/models/list_customers_request_spec.rb +4 -11
  147. data/spec/models/list_customers_response_spec.rb +6 -21
  148. data/spec/models/list_locations_request_spec.rb +3 -6
  149. data/spec/models/list_locations_response_spec.rb +5 -16
  150. data/spec/models/list_refunds_request_spec.rb +11 -26
  151. data/spec/models/list_refunds_response_spec.rb +6 -21
  152. data/spec/models/list_transactions_request_spec.rb +11 -26
  153. data/spec/models/list_transactions_response_spec.rb +6 -21
  154. data/spec/models/location_capability_spec.rb +3 -6
  155. data/spec/models/location_spec.rb +12 -31
  156. data/spec/models/money_spec.rb +9 -16
  157. data/spec/models/order_line_item_spec.rb +8 -31
  158. data/spec/models/order_spec.rb +8 -31
  159. data/spec/models/refund_spec.rb +16 -51
  160. data/spec/models/refund_status_spec.rb +3 -6
  161. data/spec/models/retrieve_customer_request_spec.rb +3 -6
  162. data/spec/models/retrieve_customer_response_spec.rb +5 -16
  163. data/spec/models/retrieve_transaction_request_spec.rb +3 -6
  164. data/spec/models/retrieve_transaction_response_spec.rb +5 -16
  165. data/spec/models/sort_order_spec.rb +3 -6
  166. data/spec/models/tender_card_details_entry_method_spec.rb +3 -6
  167. data/spec/models/tender_card_details_spec.rb +14 -21
  168. data/spec/models/tender_card_details_status_spec.rb +3 -6
  169. data/spec/models/tender_cash_details_spec.rb +5 -16
  170. data/spec/models/tender_spec.rb +18 -61
  171. data/spec/models/tender_type_spec.rb +3 -6
  172. data/spec/models/transaction_product_spec.rb +3 -6
  173. data/spec/models/transaction_spec.rb +17 -56
  174. data/spec/models/update_customer_request_spec.rb +12 -51
  175. data/spec/models/update_customer_response_spec.rb +5 -16
  176. data/spec/models/v1_adjust_inventory_request_spec.rb +51 -0
  177. data/spec/models/v1_bank_account_spec.rb +85 -0
  178. data/spec/models/v1_cash_drawer_event_spec.rb +73 -0
  179. data/spec/models/v1_cash_drawer_shift_spec.rb +151 -0
  180. data/spec/models/v1_category_spec.rb +45 -0
  181. data/spec/models/v1_create_refund_request_spec.rb +67 -0
  182. data/spec/models/v1_discount_spec.rb +83 -0
  183. data/spec/models/v1_employee_role_spec.rb +73 -0
  184. data/spec/models/v1_employee_spec.rb +97 -0
  185. data/spec/models/v1_fee_spec.rb +103 -0
  186. data/spec/models/v1_inventory_entry_spec.rb +45 -0
  187. data/spec/models/v1_item_image_spec.rb +45 -0
  188. data/spec/models/v1_item_spec.rb +129 -0
  189. data/spec/models/v1_merchant_location_details_spec.rb +39 -0
  190. data/spec/models/v1_merchant_spec.rb +131 -0
  191. data/spec/models/v1_modifier_list_spec.rb +61 -0
  192. data/spec/models/v1_modifier_option_spec.rb +69 -0
  193. data/spec/models/v1_money_spec.rb +49 -0
  194. data/spec/models/v1_order_history_entry_spec.rb +49 -0
  195. data/spec/models/v1_order_spec.rb +187 -0
  196. data/spec/models/v1_page_cell_spec.rb +77 -0
  197. data/spec/models/v1_page_spec.rb +57 -0
  198. data/spec/models/v1_payment_discount_spec.rb +51 -0
  199. data/spec/models/v1_payment_item_detail_spec.rb +57 -0
  200. data/spec/models/v1_payment_itemization_spec.rb +121 -0
  201. data/spec/models/v1_payment_modifier_spec.rb +51 -0
  202. data/spec/models/v1_payment_spec.rb +177 -0
  203. data/spec/models/v1_payment_tax_spec.rb +73 -0
  204. data/spec/models/v1_phone_number_spec.rb +45 -0
  205. data/spec/models/v1_refund_spec.rb +79 -0
  206. data/spec/models/v1_settlement_entry_spec.rb +61 -0
  207. data/spec/models/v1_settlement_spec.rb +73 -0
  208. data/spec/models/v1_tender_spec.rb +123 -0
  209. data/spec/models/v1_timecard_event_spec.rb +67 -0
  210. data/spec/models/v1_timecard_spec.rb +87 -0
  211. data/spec/models/v1_update_modifier_list_request_spec.rb +49 -0
  212. data/spec/models/v1_update_order_request_spec.rb +67 -0
  213. data/spec/models/v1_variation_spec.rb +107 -0
  214. data/spec/models/void_transaction_request_spec.rb +3 -6
  215. data/spec/models/void_transaction_response_spec.rb +4 -11
  216. data/spec/spec_helper.rb +10 -0
  217. data/square_connect-2.0.2.gem +0 -0
  218. data/square_connect-2.1.0.gem +0 -0
  219. data/square_connect-2.1.0beta.gem +0 -0
  220. data/square_connect.gemspec +1 -1
  221. data/travis-ci/accounts.enc +0 -0
  222. metadata +197 -26
  223. data/docs/CustomerApi.md +0 -267
  224. data/docs/CustomerCardApi.md +0 -116
  225. data/docs/LocationApi.md +0 -56
  226. data/docs/RefundApi.md +0 -126
  227. data/docs/TransactionApi.md +0 -285
  228. data/lib/square_connect/api/customer_card_api.rb +0 -144
  229. data/lib/square_connect/api/refund_api.rb +0 -159
  230. data/spec/api/customer_card_api_spec.rb +0 -71
  231. data/spec/api/refund_api_spec.rb +0 -75
data/docs/Device.md ADDED
@@ -0,0 +1,11 @@
1
+ # SquareConnect::Device
2
+
3
+ ### Description
4
+
5
+ ## Properties
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **id** | **String** | The device's Square-issued ID. | [optional]
9
+ **name** | **String** | The device's merchant-specified name. | [optional]
10
+
11
+
@@ -0,0 +1,55 @@
1
+ # SquareConnect::LocationsApi
2
+
3
+ All URIs are relative to *https://connect.squareup.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**list_locations**](LocationsApi.md#list_locations) | **GET** /v2/locations | ListLocations
8
+
9
+
10
+ # **list_locations**
11
+ > ListLocationsResponse list_locations
12
+
13
+ ListLocations
14
+
15
+ Provides the details for all of a business's locations. Most other Connect API endpoints have a required `location_id` path parameter. The `id` field of the [`Location`](#type-location) objects returned by this endpoint correspond to that `location_id` parameter.
16
+
17
+ ### Example
18
+ ```ruby
19
+ # load the gem
20
+ require 'square_connect'
21
+ # setup authorization
22
+ SquareConnect.configure do |config|
23
+ # Configure OAuth2 access token for authorization: oauth2
24
+ config.access_token = 'YOUR ACCESS TOKEN'
25
+ end
26
+
27
+ api_instance = SquareConnect::LocationsApi.new
28
+
29
+ begin
30
+ #ListLocations
31
+ result = api_instance.list_locations
32
+ p result
33
+ rescue SquareConnect::ApiError => e
34
+ puts "Exception when calling LocationsApi->list_locations: #{e}"
35
+ end
36
+ ```
37
+
38
+ ### Parameters
39
+ This endpoint does not need any parameter.
40
+
41
+ ### Return type
42
+
43
+ [**ListLocationsResponse**](ListLocationsResponse.md)
44
+
45
+ ### Authorization
46
+
47
+ [oauth2](../README.md#oauth2)
48
+
49
+ ### HTTP request headers
50
+
51
+ - **Content-Type**: application/json
52
+ - **Accept**: application/json
53
+
54
+
55
+
@@ -0,0 +1,417 @@
1
+ # SquareConnect::TransactionsApi
2
+
3
+ All URIs are relative to *https://connect.squareup.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**capture_transaction**](TransactionsApi.md#capture_transaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/capture | CaptureTransaction
8
+ [**charge**](TransactionsApi.md#charge) | **POST** /v2/locations/{location_id}/transactions | Charge
9
+ [**create_refund**](TransactionsApi.md#create_refund) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/refund | CreateRefund
10
+ [**list_refunds**](TransactionsApi.md#list_refunds) | **GET** /v2/locations/{location_id}/refunds | ListRefunds
11
+ [**list_transactions**](TransactionsApi.md#list_transactions) | **GET** /v2/locations/{location_id}/transactions | ListTransactions
12
+ [**retrieve_transaction**](TransactionsApi.md#retrieve_transaction) | **GET** /v2/locations/{location_id}/transactions/{transaction_id} | RetrieveTransaction
13
+ [**void_transaction**](TransactionsApi.md#void_transaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/void | VoidTransaction
14
+
15
+
16
+ # **capture_transaction**
17
+ > CaptureTransactionResponse capture_transaction(location_id, transaction_id)
18
+
19
+ CaptureTransaction
20
+
21
+ Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/articles/delayed-capture-transactions/) for more information.
22
+
23
+ ### Example
24
+ ```ruby
25
+ # load the gem
26
+ require 'square_connect'
27
+ # setup authorization
28
+ SquareConnect.configure do |config|
29
+ # Configure OAuth2 access token for authorization: oauth2
30
+ config.access_token = 'YOUR ACCESS TOKEN'
31
+ end
32
+
33
+ api_instance = SquareConnect::TransactionsApi.new
34
+
35
+ location_id = "location_id_example" # String |
36
+
37
+ transaction_id = "transaction_id_example" # String |
38
+
39
+
40
+ begin
41
+ #CaptureTransaction
42
+ result = api_instance.capture_transaction(location_id, transaction_id)
43
+ p result
44
+ rescue SquareConnect::ApiError => e
45
+ puts "Exception when calling TransactionsApi->capture_transaction: #{e}"
46
+ end
47
+ ```
48
+
49
+ ### Parameters
50
+
51
+ Name | Type | Description | Notes
52
+ ------------- | ------------- | ------------- | -------------
53
+ **location_id** | **String**| |
54
+ **transaction_id** | **String**| |
55
+
56
+ ### Return type
57
+
58
+ [**CaptureTransactionResponse**](CaptureTransactionResponse.md)
59
+
60
+ ### Authorization
61
+
62
+ [oauth2](../README.md#oauth2)
63
+
64
+ ### HTTP request headers
65
+
66
+ - **Content-Type**: application/json
67
+ - **Accept**: application/json
68
+
69
+
70
+
71
+ # **charge**
72
+ > ChargeResponse charge(location_id, body)
73
+
74
+ Charge
75
+
76
+ Charges a card represented by a card nonce or a customer's card on file. Your request to this endpoint must include _either_: - A value for the `card_nonce` parameter (to charge a card nonce generated with the `SqPaymentForm`) - Values for the `customer_card_id` and `customer_id` parameters (to charge a customer's card on file) In order for an e-commerce payment to potentially qualify for [Square chargeback protection](https://squareup.com/help/article/5394), you _must_ provide values for the following parameters in your request: - `buyer_email_address` - At least one of `billing_address` or `shipping_address` When this response is returned, the amount of Square's processing fee might not yet be calculated. To obtain the processing fee, wait about ten seconds and call [RetrieveTransaction](#endpoint-retrievetransaction). See the `processing_fee_money` field of each [Tender included](#type-tender) in the transaction.
77
+
78
+ ### Example
79
+ ```ruby
80
+ # load the gem
81
+ require 'square_connect'
82
+ # setup authorization
83
+ SquareConnect.configure do |config|
84
+ # Configure OAuth2 access token for authorization: oauth2
85
+ config.access_token = 'YOUR ACCESS TOKEN'
86
+ end
87
+
88
+ api_instance = SquareConnect::TransactionsApi.new
89
+
90
+ location_id = "location_id_example" # String | The ID of the location to associate the created transaction with.
91
+
92
+ body = SquareConnect::ChargeRequest.new # ChargeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
93
+
94
+
95
+ begin
96
+ #Charge
97
+ result = api_instance.charge(location_id, body)
98
+ p result
99
+ rescue SquareConnect::ApiError => e
100
+ puts "Exception when calling TransactionsApi->charge: #{e}"
101
+ end
102
+ ```
103
+
104
+ ### Parameters
105
+
106
+ Name | Type | Description | Notes
107
+ ------------- | ------------- | ------------- | -------------
108
+ **location_id** | **String**| The ID of the location to associate the created transaction with. |
109
+ **body** | [**ChargeRequest**](ChargeRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
110
+
111
+ ### Return type
112
+
113
+ [**ChargeResponse**](ChargeResponse.md)
114
+
115
+ ### Authorization
116
+
117
+ [oauth2](../README.md#oauth2)
118
+
119
+ ### HTTP request headers
120
+
121
+ - **Content-Type**: application/json
122
+ - **Accept**: application/json
123
+
124
+
125
+
126
+ # **create_refund**
127
+ > CreateRefundResponse create_refund(location_id, transaction_id, body)
128
+
129
+ CreateRefund
130
+
131
+ Initiates a refund for a previously charged tender.
132
+
133
+ ### Example
134
+ ```ruby
135
+ # load the gem
136
+ require 'square_connect'
137
+ # setup authorization
138
+ SquareConnect.configure do |config|
139
+ # Configure OAuth2 access token for authorization: oauth2
140
+ config.access_token = 'YOUR ACCESS TOKEN'
141
+ end
142
+
143
+ api_instance = SquareConnect::TransactionsApi.new
144
+
145
+ location_id = "location_id_example" # String | The ID of the original transaction's associated location.
146
+
147
+ transaction_id = "transaction_id_example" # String | The ID of the original transaction that includes the tender to refund.
148
+
149
+ body = SquareConnect::CreateRefundRequest.new # CreateRefundRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
150
+
151
+
152
+ begin
153
+ #CreateRefund
154
+ result = api_instance.create_refund(location_id, transaction_id, body)
155
+ p result
156
+ rescue SquareConnect::ApiError => e
157
+ puts "Exception when calling TransactionsApi->create_refund: #{e}"
158
+ end
159
+ ```
160
+
161
+ ### Parameters
162
+
163
+ Name | Type | Description | Notes
164
+ ------------- | ------------- | ------------- | -------------
165
+ **location_id** | **String**| The ID of the original transaction's associated location. |
166
+ **transaction_id** | **String**| The ID of the original transaction that includes the tender to refund. |
167
+ **body** | [**CreateRefundRequest**](CreateRefundRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
168
+
169
+ ### Return type
170
+
171
+ [**CreateRefundResponse**](CreateRefundResponse.md)
172
+
173
+ ### Authorization
174
+
175
+ [oauth2](../README.md#oauth2)
176
+
177
+ ### HTTP request headers
178
+
179
+ - **Content-Type**: application/json
180
+ - **Accept**: application/json
181
+
182
+
183
+
184
+ # **list_refunds**
185
+ > ListRefundsResponse list_refunds(location_id, opts)
186
+
187
+ ListRefunds
188
+
189
+ Lists refunds for one of a business's locations. Refunds with a `status` of `PENDING` are not currently included in this endpoint's response. Max results per [page](#paginatingresults): 50
190
+
191
+ ### Example
192
+ ```ruby
193
+ # load the gem
194
+ require 'square_connect'
195
+ # setup authorization
196
+ SquareConnect.configure do |config|
197
+ # Configure OAuth2 access token for authorization: oauth2
198
+ config.access_token = 'YOUR ACCESS TOKEN'
199
+ end
200
+
201
+ api_instance = SquareConnect::TransactionsApi.new
202
+
203
+ location_id = "location_id_example" # String | The ID of the location to list refunds for.
204
+
205
+ opts = {
206
+ begin_time: "begin_time_example", # String | The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year.
207
+ end_time: "end_time_example", # String | The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time.
208
+ sort_order: "sort_order_example", # String | The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). Default value: `DESC`
209
+ cursor: "cursor_example" # String | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information.
210
+ }
211
+
212
+ begin
213
+ #ListRefunds
214
+ result = api_instance.list_refunds(location_id, opts)
215
+ p result
216
+ rescue SquareConnect::ApiError => e
217
+ puts "Exception when calling TransactionsApi->list_refunds: #{e}"
218
+ end
219
+ ```
220
+
221
+ ### Parameters
222
+
223
+ Name | Type | Description | Notes
224
+ ------------- | ------------- | ------------- | -------------
225
+ **location_id** | **String**| The ID of the location to list refunds for. |
226
+ **begin_time** | **String**| The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year. | [optional]
227
+ **end_time** | **String**| The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. | [optional]
228
+ **sort_order** | **String**| The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). Default value: `DESC` | [optional]
229
+ **cursor** | **String**| A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information. | [optional]
230
+
231
+ ### Return type
232
+
233
+ [**ListRefundsResponse**](ListRefundsResponse.md)
234
+
235
+ ### Authorization
236
+
237
+ [oauth2](../README.md#oauth2)
238
+
239
+ ### HTTP request headers
240
+
241
+ - **Content-Type**: application/json
242
+ - **Accept**: application/json
243
+
244
+
245
+
246
+ # **list_transactions**
247
+ > ListTransactionsResponse list_transactions(location_id, opts)
248
+
249
+ ListTransactions
250
+
251
+ Lists transactions for a particular location. Max results per [page](#paginatingresults): 50
252
+
253
+ ### Example
254
+ ```ruby
255
+ # load the gem
256
+ require 'square_connect'
257
+ # setup authorization
258
+ SquareConnect.configure do |config|
259
+ # Configure OAuth2 access token for authorization: oauth2
260
+ config.access_token = 'YOUR ACCESS TOKEN'
261
+ end
262
+
263
+ api_instance = SquareConnect::TransactionsApi.new
264
+
265
+ location_id = "location_id_example" # String | The ID of the location to list transactions for.
266
+
267
+ opts = {
268
+ begin_time: "begin_time_example", # String | The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year.
269
+ end_time: "end_time_example", # String | The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time.
270
+ sort_order: "sort_order_example", # String | The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). Default value: `DESC`
271
+ cursor: "cursor_example" # String | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information.
272
+ }
273
+
274
+ begin
275
+ #ListTransactions
276
+ result = api_instance.list_transactions(location_id, opts)
277
+ p result
278
+ rescue SquareConnect::ApiError => e
279
+ puts "Exception when calling TransactionsApi->list_transactions: #{e}"
280
+ end
281
+ ```
282
+
283
+ ### Parameters
284
+
285
+ Name | Type | Description | Notes
286
+ ------------- | ------------- | ------------- | -------------
287
+ **location_id** | **String**| The ID of the location to list transactions for. |
288
+ **begin_time** | **String**| The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year. | [optional]
289
+ **end_time** | **String**| The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. | [optional]
290
+ **sort_order** | **String**| The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). Default value: `DESC` | [optional]
291
+ **cursor** | **String**| A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information. | [optional]
292
+
293
+ ### Return type
294
+
295
+ [**ListTransactionsResponse**](ListTransactionsResponse.md)
296
+
297
+ ### Authorization
298
+
299
+ [oauth2](../README.md#oauth2)
300
+
301
+ ### HTTP request headers
302
+
303
+ - **Content-Type**: application/json
304
+ - **Accept**: application/json
305
+
306
+
307
+
308
+ # **retrieve_transaction**
309
+ > RetrieveTransactionResponse retrieve_transaction(location_id, transaction_id)
310
+
311
+ RetrieveTransaction
312
+
313
+ Retrieves details for a single transaction.
314
+
315
+ ### Example
316
+ ```ruby
317
+ # load the gem
318
+ require 'square_connect'
319
+ # setup authorization
320
+ SquareConnect.configure do |config|
321
+ # Configure OAuth2 access token for authorization: oauth2
322
+ config.access_token = 'YOUR ACCESS TOKEN'
323
+ end
324
+
325
+ api_instance = SquareConnect::TransactionsApi.new
326
+
327
+ location_id = "location_id_example" # String | The ID of the transaction's associated location.
328
+
329
+ transaction_id = "transaction_id_example" # String | The ID of the transaction to retrieve.
330
+
331
+
332
+ begin
333
+ #RetrieveTransaction
334
+ result = api_instance.retrieve_transaction(location_id, transaction_id)
335
+ p result
336
+ rescue SquareConnect::ApiError => e
337
+ puts "Exception when calling TransactionsApi->retrieve_transaction: #{e}"
338
+ end
339
+ ```
340
+
341
+ ### Parameters
342
+
343
+ Name | Type | Description | Notes
344
+ ------------- | ------------- | ------------- | -------------
345
+ **location_id** | **String**| The ID of the transaction's associated location. |
346
+ **transaction_id** | **String**| The ID of the transaction to retrieve. |
347
+
348
+ ### Return type
349
+
350
+ [**RetrieveTransactionResponse**](RetrieveTransactionResponse.md)
351
+
352
+ ### Authorization
353
+
354
+ [oauth2](../README.md#oauth2)
355
+
356
+ ### HTTP request headers
357
+
358
+ - **Content-Type**: application/json
359
+ - **Accept**: application/json
360
+
361
+
362
+
363
+ # **void_transaction**
364
+ > VoidTransactionResponse void_transaction(location_id, transaction_id)
365
+
366
+ VoidTransaction
367
+
368
+ Cancels a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/articles/delayed-capture-transactions/) for more information.
369
+
370
+ ### Example
371
+ ```ruby
372
+ # load the gem
373
+ require 'square_connect'
374
+ # setup authorization
375
+ SquareConnect.configure do |config|
376
+ # Configure OAuth2 access token for authorization: oauth2
377
+ config.access_token = 'YOUR ACCESS TOKEN'
378
+ end
379
+
380
+ api_instance = SquareConnect::TransactionsApi.new
381
+
382
+ location_id = "location_id_example" # String |
383
+
384
+ transaction_id = "transaction_id_example" # String |
385
+
386
+
387
+ begin
388
+ #VoidTransaction
389
+ result = api_instance.void_transaction(location_id, transaction_id)
390
+ p result
391
+ rescue SquareConnect::ApiError => e
392
+ puts "Exception when calling TransactionsApi->void_transaction: #{e}"
393
+ end
394
+ ```
395
+
396
+ ### Parameters
397
+
398
+ Name | Type | Description | Notes
399
+ ------------- | ------------- | ------------- | -------------
400
+ **location_id** | **String**| |
401
+ **transaction_id** | **String**| |
402
+
403
+ ### Return type
404
+
405
+ [**VoidTransactionResponse**](VoidTransactionResponse.md)
406
+
407
+ ### Authorization
408
+
409
+ [oauth2](../README.md#oauth2)
410
+
411
+ ### HTTP request headers
412
+
413
+ - **Content-Type**: application/json
414
+ - **Accept**: application/json
415
+
416
+
417
+