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
@@ -1,285 +0,0 @@
1
- # SquareConnect::TransactionApi
2
-
3
- All URIs are relative to *https://connect.squareup.com*
4
-
5
- Method | HTTP request | Description
6
- ------------- | ------------- | -------------
7
- [**capture_transaction**](TransactionApi.md#capture_transaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/capture | CaptureTransaction
8
- [**charge**](TransactionApi.md#charge) | **POST** /v2/locations/{location_id}/transactions | Charge
9
- [**list_transactions**](TransactionApi.md#list_transactions) | **GET** /v2/locations/{location_id}/transactions | ListTransactions
10
- [**retrieve_transaction**](TransactionApi.md#retrieve_transaction) | **GET** /v2/locations/{location_id}/transactions/{transaction_id} | RetrieveTransaction
11
- [**void_transaction**](TransactionApi.md#void_transaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/void | VoidTransaction
12
-
13
-
14
- # **capture_transaction**
15
- > CaptureTransactionResponse capture_transaction(authorization, location_id, transaction_id)
16
-
17
- CaptureTransaction
18
-
19
- 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.
20
-
21
- ### Example
22
- ```ruby
23
- # load the gem
24
- require 'square_connect'
25
-
26
- api_instance = SquareConnect::TransactionApi.new
27
-
28
- authorization = "authorization_example" # String | The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
29
-
30
- location_id = "location_id_example" # String |
31
-
32
- transaction_id = "transaction_id_example" # String |
33
-
34
-
35
- begin
36
- #CaptureTransaction
37
- result = api_instance.capture_transaction(authorization, location_id, transaction_id)
38
- p result
39
- rescue SquareConnect::ApiError => e
40
- puts "Exception when calling TransactionApi->capture_transaction: #{e}"
41
- end
42
- ```
43
-
44
- ### Parameters
45
-
46
- Name | Type | Description | Notes
47
- ------------- | ------------- | ------------- | -------------
48
- **authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
49
- **location_id** | **String**| |
50
- **transaction_id** | **String**| |
51
-
52
- ### Return type
53
-
54
- [**CaptureTransactionResponse**](CaptureTransactionResponse.md)
55
-
56
- ### Authorization
57
-
58
- No authorization required
59
-
60
- ### HTTP request headers
61
-
62
- - **Content-Type**: application/json
63
- - **Accept**: application/json
64
-
65
-
66
-
67
- # **charge**
68
- > ChargeResponse charge(authorization, location_id, body)
69
-
70
- Charge
71
-
72
- 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.
73
-
74
- ### Example
75
- ```ruby
76
- # load the gem
77
- require 'square_connect'
78
-
79
- api_instance = SquareConnect::TransactionApi.new
80
-
81
- authorization = "authorization_example" # String | The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
82
-
83
- location_id = "location_id_example" # String | The ID of the location to associate the created transaction with.
84
-
85
- body = SquareConnect::ChargeRequest.new # ChargeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
86
-
87
-
88
- begin
89
- #Charge
90
- result = api_instance.charge(authorization, location_id, body)
91
- p result
92
- rescue SquareConnect::ApiError => e
93
- puts "Exception when calling TransactionApi->charge: #{e}"
94
- end
95
- ```
96
-
97
- ### Parameters
98
-
99
- Name | Type | Description | Notes
100
- ------------- | ------------- | ------------- | -------------
101
- **authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
102
- **location_id** | **String**| The ID of the location to associate the created transaction with. |
103
- **body** | [**ChargeRequest**](ChargeRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
104
-
105
- ### Return type
106
-
107
- [**ChargeResponse**](ChargeResponse.md)
108
-
109
- ### Authorization
110
-
111
- No authorization required
112
-
113
- ### HTTP request headers
114
-
115
- - **Content-Type**: application/json
116
- - **Accept**: application/json
117
-
118
-
119
-
120
- # **list_transactions**
121
- > ListTransactionsResponse list_transactions(authorization, location_id, opts)
122
-
123
- ListTransactions
124
-
125
- Lists transactions for a particular location. Max results per [page](#paginatingresults): 50
126
-
127
- ### Example
128
- ```ruby
129
- # load the gem
130
- require 'square_connect'
131
-
132
- api_instance = SquareConnect::TransactionApi.new
133
-
134
- authorization = "authorization_example" # String | The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
135
-
136
- location_id = "location_id_example" # String | The ID of the location to list transactions for.
137
-
138
- opts = {
139
- 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.
140
- 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.
141
- 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`
142
- 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.
143
- }
144
-
145
- begin
146
- #ListTransactions
147
- result = api_instance.list_transactions(authorization, location_id, opts)
148
- p result
149
- rescue SquareConnect::ApiError => e
150
- puts "Exception when calling TransactionApi->list_transactions: #{e}"
151
- end
152
- ```
153
-
154
- ### Parameters
155
-
156
- Name | Type | Description | Notes
157
- ------------- | ------------- | ------------- | -------------
158
- **authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
159
- **location_id** | **String**| The ID of the location to list transactions for. |
160
- **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]
161
- **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]
162
- **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]
163
- **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]
164
-
165
- ### Return type
166
-
167
- [**ListTransactionsResponse**](ListTransactionsResponse.md)
168
-
169
- ### Authorization
170
-
171
- No authorization required
172
-
173
- ### HTTP request headers
174
-
175
- - **Content-Type**: application/json
176
- - **Accept**: application/json
177
-
178
-
179
-
180
- # **retrieve_transaction**
181
- > RetrieveTransactionResponse retrieve_transaction(authorization, location_id, transaction_id)
182
-
183
- RetrieveTransaction
184
-
185
- Retrieves details for a single transaction.
186
-
187
- ### Example
188
- ```ruby
189
- # load the gem
190
- require 'square_connect'
191
-
192
- api_instance = SquareConnect::TransactionApi.new
193
-
194
- authorization = "authorization_example" # String | The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
195
-
196
- location_id = "location_id_example" # String | The ID of the transaction's associated location.
197
-
198
- transaction_id = "transaction_id_example" # String | The ID of the transaction to retrieve.
199
-
200
-
201
- begin
202
- #RetrieveTransaction
203
- result = api_instance.retrieve_transaction(authorization, location_id, transaction_id)
204
- p result
205
- rescue SquareConnect::ApiError => e
206
- puts "Exception when calling TransactionApi->retrieve_transaction: #{e}"
207
- end
208
- ```
209
-
210
- ### Parameters
211
-
212
- Name | Type | Description | Notes
213
- ------------- | ------------- | ------------- | -------------
214
- **authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
215
- **location_id** | **String**| The ID of the transaction's associated location. |
216
- **transaction_id** | **String**| The ID of the transaction to retrieve. |
217
-
218
- ### Return type
219
-
220
- [**RetrieveTransactionResponse**](RetrieveTransactionResponse.md)
221
-
222
- ### Authorization
223
-
224
- No authorization required
225
-
226
- ### HTTP request headers
227
-
228
- - **Content-Type**: application/json
229
- - **Accept**: application/json
230
-
231
-
232
-
233
- # **void_transaction**
234
- > VoidTransactionResponse void_transaction(authorization, location_id, transaction_id)
235
-
236
- VoidTransaction
237
-
238
- 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.
239
-
240
- ### Example
241
- ```ruby
242
- # load the gem
243
- require 'square_connect'
244
-
245
- api_instance = SquareConnect::TransactionApi.new
246
-
247
- authorization = "authorization_example" # String | The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
248
-
249
- location_id = "location_id_example" # String |
250
-
251
- transaction_id = "transaction_id_example" # String |
252
-
253
-
254
- begin
255
- #VoidTransaction
256
- result = api_instance.void_transaction(authorization, location_id, transaction_id)
257
- p result
258
- rescue SquareConnect::ApiError => e
259
- puts "Exception when calling TransactionApi->void_transaction: #{e}"
260
- end
261
- ```
262
-
263
- ### Parameters
264
-
265
- Name | Type | Description | Notes
266
- ------------- | ------------- | ------------- | -------------
267
- **authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
268
- **location_id** | **String**| |
269
- **transaction_id** | **String**| |
270
-
271
- ### Return type
272
-
273
- [**VoidTransactionResponse**](VoidTransactionResponse.md)
274
-
275
- ### Authorization
276
-
277
- No authorization required
278
-
279
- ### HTTP request headers
280
-
281
- - **Content-Type**: application/json
282
- - **Accept**: application/json
283
-
284
-
285
-
@@ -1,144 +0,0 @@
1
- =begin
2
- #Square Connect API
3
-
4
- OpenAPI spec version: 2.0
5
- Contact: developers@squareup.com
6
- Generated by: https://github.com/swagger-api/swagger-codegen.git
7
-
8
- =end
9
-
10
- require "uri"
11
-
12
- module SquareConnect
13
- class CustomerCardApi
14
- attr_accessor :api_client
15
-
16
- def initialize(api_client = ApiClient.default)
17
- @api_client = api_client
18
- end
19
-
20
- # CreateCustomerCard
21
- # Adds a card on file to an existing customer.
22
- # @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
23
- # @param customer_id The ID of the customer to link the card on file to.
24
- # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
25
- # @param [Hash] opts the optional parameters
26
- # @return [CreateCustomerCardResponse]
27
- def create_customer_card(authorization, customer_id, body, opts = {})
28
- data, _status_code, _headers = create_customer_card_with_http_info(authorization, customer_id, body, opts)
29
- return data
30
- end
31
-
32
- # CreateCustomerCard
33
- # Adds a card on file to an existing customer.
34
- # @param authorization The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`.
35
- # @param customer_id The ID of the customer to link the card on file to.
36
- # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
37
- # @param [Hash] opts the optional parameters
38
- # @return [Array<(CreateCustomerCardResponse, Fixnum, Hash)>] CreateCustomerCardResponse data, response status code and response headers
39
- def create_customer_card_with_http_info(authorization, customer_id, body, opts = {})
40
- if @api_client.config.debugging
41
- @api_client.config.logger.debug "Calling API: CustomerCardApi.create_customer_card ..."
42
- end
43
- # verify the required parameter 'authorization' is set
44
- fail ArgumentError, "Missing the required parameter 'authorization' when calling CustomerCardApi.create_customer_card" if authorization.nil?
45
- # verify the required parameter 'customer_id' is set
46
- fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerCardApi.create_customer_card" if customer_id.nil?
47
- # verify the required parameter 'body' is set
48
- fail ArgumentError, "Missing the required parameter 'body' when calling CustomerCardApi.create_customer_card" if body.nil?
49
- # resource path
50
- local_var_path = "/v2/customers/{customer_id}/cards".sub('{format}','json').sub('{' + 'customer_id' + '}', customer_id.to_s)
51
-
52
- # query parameters
53
- query_params = {}
54
-
55
- # header parameters
56
- header_params = {}
57
- # HTTP header 'Accept' (if needed)
58
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
- # HTTP header 'Content-Type'
60
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
61
- header_params[:'Authorization'] = authorization
62
-
63
- # form parameters
64
- form_params = {}
65
-
66
- # http body (model)
67
- post_body = @api_client.object_to_http_body(body)
68
- auth_names = []
69
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
70
- :header_params => header_params,
71
- :query_params => query_params,
72
- :form_params => form_params,
73
- :body => post_body,
74
- :auth_names => auth_names,
75
- :return_type => 'CreateCustomerCardResponse')
76
- if @api_client.config.debugging
77
- @api_client.config.logger.debug "API called: CustomerCardApi#create_customer_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
- end
79
- return data, status_code, headers
80
- end
81
-
82
- # DeleteCustomerCard
83
- # Removes a card on file from a customer.
84
- # @param authorization The value to provide in the Authorization header of your request. This value should follow the format &#x60;Bearer YOUR_ACCESS_TOKEN_HERE&#x60;.
85
- # @param customer_id The ID of the customer that the card on file belongs to.
86
- # @param card_id The ID of the card on file to delete.
87
- # @param [Hash] opts the optional parameters
88
- # @return [DeleteCustomerCardResponse]
89
- def delete_customer_card(authorization, customer_id, card_id, opts = {})
90
- data, _status_code, _headers = delete_customer_card_with_http_info(authorization, customer_id, card_id, opts)
91
- return data
92
- end
93
-
94
- # DeleteCustomerCard
95
- # Removes a card on file from a customer.
96
- # @param authorization The value to provide in the Authorization header of your request. This value should follow the format &#x60;Bearer YOUR_ACCESS_TOKEN_HERE&#x60;.
97
- # @param customer_id The ID of the customer that the card on file belongs to.
98
- # @param card_id The ID of the card on file to delete.
99
- # @param [Hash] opts the optional parameters
100
- # @return [Array<(DeleteCustomerCardResponse, Fixnum, Hash)>] DeleteCustomerCardResponse data, response status code and response headers
101
- def delete_customer_card_with_http_info(authorization, customer_id, card_id, opts = {})
102
- if @api_client.config.debugging
103
- @api_client.config.logger.debug "Calling API: CustomerCardApi.delete_customer_card ..."
104
- end
105
- # verify the required parameter 'authorization' is set
106
- fail ArgumentError, "Missing the required parameter 'authorization' when calling CustomerCardApi.delete_customer_card" if authorization.nil?
107
- # verify the required parameter 'customer_id' is set
108
- fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerCardApi.delete_customer_card" if customer_id.nil?
109
- # verify the required parameter 'card_id' is set
110
- fail ArgumentError, "Missing the required parameter 'card_id' when calling CustomerCardApi.delete_customer_card" if card_id.nil?
111
- # resource path
112
- local_var_path = "/v2/customers/{customer_id}/cards/{card_id}".sub('{format}','json').sub('{' + 'customer_id' + '}', customer_id.to_s).sub('{' + 'card_id' + '}', card_id.to_s)
113
-
114
- # query parameters
115
- query_params = {}
116
-
117
- # header parameters
118
- header_params = {}
119
- # HTTP header 'Accept' (if needed)
120
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
121
- # HTTP header 'Content-Type'
122
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
123
- header_params[:'Authorization'] = authorization
124
-
125
- # form parameters
126
- form_params = {}
127
-
128
- # http body (model)
129
- post_body = nil
130
- auth_names = []
131
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
132
- :header_params => header_params,
133
- :query_params => query_params,
134
- :form_params => form_params,
135
- :body => post_body,
136
- :auth_names => auth_names,
137
- :return_type => 'DeleteCustomerCardResponse')
138
- if @api_client.config.debugging
139
- @api_client.config.logger.debug "API called: CustomerCardApi#delete_customer_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
140
- end
141
- return data, status_code, headers
142
- end
143
- end
144
- end
@@ -1,159 +0,0 @@
1
- =begin
2
- #Square Connect API
3
-
4
- OpenAPI spec version: 2.0
5
- Contact: developers@squareup.com
6
- Generated by: https://github.com/swagger-api/swagger-codegen.git
7
-
8
- =end
9
-
10
- require "uri"
11
-
12
- module SquareConnect
13
- class RefundApi
14
- attr_accessor :api_client
15
-
16
- def initialize(api_client = ApiClient.default)
17
- @api_client = api_client
18
- end
19
-
20
- # CreateRefund
21
- # Initiates a refund for a previously charged tender.
22
- # @param authorization The value to provide in the Authorization header of your request. This value should follow the format &#x60;Bearer YOUR_ACCESS_TOKEN_HERE&#x60;.
23
- # @param location_id The ID of the original transaction&#39;s associated location.
24
- # @param transaction_id The ID of the original transaction that includes the tender to refund.
25
- # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
26
- # @param [Hash] opts the optional parameters
27
- # @return [CreateRefundResponse]
28
- def create_refund(authorization, location_id, transaction_id, body, opts = {})
29
- data, _status_code, _headers = create_refund_with_http_info(authorization, location_id, transaction_id, body, opts)
30
- return data
31
- end
32
-
33
- # CreateRefund
34
- # Initiates a refund for a previously charged tender.
35
- # @param authorization The value to provide in the Authorization header of your request. This value should follow the format &#x60;Bearer YOUR_ACCESS_TOKEN_HERE&#x60;.
36
- # @param location_id The ID of the original transaction&#39;s associated location.
37
- # @param transaction_id The ID of the original transaction that includes the tender to refund.
38
- # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
39
- # @param [Hash] opts the optional parameters
40
- # @return [Array<(CreateRefundResponse, Fixnum, Hash)>] CreateRefundResponse data, response status code and response headers
41
- def create_refund_with_http_info(authorization, location_id, transaction_id, body, opts = {})
42
- if @api_client.config.debugging
43
- @api_client.config.logger.debug "Calling API: RefundApi.create_refund ..."
44
- end
45
- # verify the required parameter 'authorization' is set
46
- fail ArgumentError, "Missing the required parameter 'authorization' when calling RefundApi.create_refund" if authorization.nil?
47
- # verify the required parameter 'location_id' is set
48
- fail ArgumentError, "Missing the required parameter 'location_id' when calling RefundApi.create_refund" if location_id.nil?
49
- # verify the required parameter 'transaction_id' is set
50
- fail ArgumentError, "Missing the required parameter 'transaction_id' when calling RefundApi.create_refund" if transaction_id.nil?
51
- # verify the required parameter 'body' is set
52
- fail ArgumentError, "Missing the required parameter 'body' when calling RefundApi.create_refund" if body.nil?
53
- # resource path
54
- local_var_path = "/v2/locations/{location_id}/transactions/{transaction_id}/refund".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'transaction_id' + '}', transaction_id.to_s)
55
-
56
- # query parameters
57
- query_params = {}
58
-
59
- # header parameters
60
- header_params = {}
61
- # HTTP header 'Accept' (if needed)
62
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
63
- # HTTP header 'Content-Type'
64
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
65
- header_params[:'Authorization'] = authorization
66
-
67
- # form parameters
68
- form_params = {}
69
-
70
- # http body (model)
71
- post_body = @api_client.object_to_http_body(body)
72
- auth_names = []
73
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
74
- :header_params => header_params,
75
- :query_params => query_params,
76
- :form_params => form_params,
77
- :body => post_body,
78
- :auth_names => auth_names,
79
- :return_type => 'CreateRefundResponse')
80
- if @api_client.config.debugging
81
- @api_client.config.logger.debug "API called: RefundApi#create_refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
- end
83
- return data, status_code, headers
84
- end
85
-
86
- # ListRefunds
87
- # 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
88
- # @param authorization The value to provide in the Authorization header of your request. This value should follow the format &#x60;Bearer YOUR_ACCESS_TOKEN_HERE&#x60;.
89
- # @param location_id The ID of the location to list refunds for.
90
- # @param [Hash] opts the optional parameters
91
- # @option opts [String] :begin_time 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.
92
- # @option opts [String] :end_time 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.
93
- # @option opts [String] :sort_order The order in which results are listed in the response (&#x60;ASC&#x60; for oldest first, &#x60;DESC&#x60; for newest first). Default value: &#x60;DESC&#x60;
94
- # @option opts [String] :cursor 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.
95
- # @return [ListRefundsResponse]
96
- def list_refunds(authorization, location_id, opts = {})
97
- data, _status_code, _headers = list_refunds_with_http_info(authorization, location_id, opts)
98
- return data
99
- end
100
-
101
- # ListRefunds
102
- # Lists refunds for one of a business&#39;s locations. Refunds with a &#x60;status&#x60; of &#x60;PENDING&#x60; are not currently included in this endpoint&#39;s response. Max results per [page](#paginatingresults): 50
103
- # @param authorization The value to provide in the Authorization header of your request. This value should follow the format &#x60;Bearer YOUR_ACCESS_TOKEN_HERE&#x60;.
104
- # @param location_id The ID of the location to list refunds for.
105
- # @param [Hash] opts the optional parameters
106
- # @option opts [String] :begin_time 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.
107
- # @option opts [String] :end_time 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.
108
- # @option opts [String] :sort_order The order in which results are listed in the response (&#x60;ASC&#x60; for oldest first, &#x60;DESC&#x60; for newest first). Default value: &#x60;DESC&#x60;
109
- # @option opts [String] :cursor 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.
110
- # @return [Array<(ListRefundsResponse, Fixnum, Hash)>] ListRefundsResponse data, response status code and response headers
111
- def list_refunds_with_http_info(authorization, location_id, opts = {})
112
- if @api_client.config.debugging
113
- @api_client.config.logger.debug "Calling API: RefundApi.list_refunds ..."
114
- end
115
- # verify the required parameter 'authorization' is set
116
- fail ArgumentError, "Missing the required parameter 'authorization' when calling RefundApi.list_refunds" if authorization.nil?
117
- # verify the required parameter 'location_id' is set
118
- fail ArgumentError, "Missing the required parameter 'location_id' when calling RefundApi.list_refunds" if location_id.nil?
119
- if opts[:'sort_order'] && !['DESC', 'ASC'].include?(opts[:'sort_order'])
120
- fail ArgumentError, 'invalid value for "sort_order", must be one of DESC, ASC'
121
- end
122
- # resource path
123
- local_var_path = "/v2/locations/{location_id}/refunds".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)
124
-
125
- # query parameters
126
- query_params = {}
127
- query_params[:'begin_time'] = opts[:'begin_time'] if !opts[:'begin_time'].nil?
128
- query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
129
- query_params[:'sort_order'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
130
- query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
131
-
132
- # header parameters
133
- header_params = {}
134
- # HTTP header 'Accept' (if needed)
135
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
136
- # HTTP header 'Content-Type'
137
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
138
- header_params[:'Authorization'] = authorization
139
-
140
- # form parameters
141
- form_params = {}
142
-
143
- # http body (model)
144
- post_body = nil
145
- auth_names = []
146
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
147
- :header_params => header_params,
148
- :query_params => query_params,
149
- :form_params => form_params,
150
- :body => post_body,
151
- :auth_names => auth_names,
152
- :return_type => 'ListRefundsResponse')
153
- if @api_client.config.debugging
154
- @api_client.config.logger.debug "API called: RefundApi#list_refunds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
155
- end
156
- return data, status_code, headers
157
- end
158
- end
159
- end