square_connect 2.0.0 → 2.0.2.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -0
  3. data/README.md +151 -9
  4. data/Rakefile +8 -0
  5. data/docs/Address.md +26 -0
  6. data/docs/CaptureTransactionRequest.md +11 -0
  7. data/docs/CaptureTransactionResponse.md +12 -0
  8. data/docs/Card.md +18 -0
  9. data/docs/CardBrand.md +20 -0
  10. data/docs/ChargeRequest.md +22 -0
  11. data/docs/ChargeResponse.md +13 -0
  12. data/docs/Checkout.md +20 -0
  13. data/docs/CheckoutApi.md +62 -0
  14. data/docs/Country.md +261 -0
  15. data/docs/CreateCheckoutRequest.md +18 -0
  16. data/docs/CreateCheckoutResponse.md +13 -0
  17. data/docs/CreateCustomerCardRequest.md +14 -0
  18. data/docs/CreateCustomerCardResponse.md +13 -0
  19. data/docs/CreateCustomerRequest.md +20 -0
  20. data/docs/CreateCustomerResponse.md +13 -0
  21. data/docs/CreateOrderRequest.md +13 -0
  22. data/docs/CreateOrderRequestLineItem.md +14 -0
  23. data/docs/CreateOrderRequestOrder.md +13 -0
  24. data/docs/CreateRefundRequest.md +15 -0
  25. data/docs/CreateRefundResponse.md +13 -0
  26. data/docs/Currency.md +191 -0
  27. data/docs/Customer.md +26 -0
  28. data/docs/CustomerApi.md +267 -0
  29. data/docs/CustomerCardApi.md +116 -0
  30. data/docs/CustomerGroupInfo.md +13 -0
  31. data/docs/CustomerPreferences.md +12 -0
  32. data/docs/DeleteCustomerCardRequest.md +11 -0
  33. data/docs/DeleteCustomerCardResponse.md +12 -0
  34. data/docs/DeleteCustomerRequest.md +11 -0
  35. data/docs/DeleteCustomerResponse.md +12 -0
  36. data/docs/Error.md +15 -0
  37. data/docs/ErrorCategory.md +17 -0
  38. data/docs/ErrorCode.md +83 -0
  39. data/docs/ListCustomersRequest.md +12 -0
  40. data/docs/ListCustomersResponse.md +14 -0
  41. data/docs/ListLocationsRequest.md +11 -0
  42. data/docs/ListLocationsResponse.md +13 -0
  43. data/docs/ListRefundsRequest.md +15 -0
  44. data/docs/ListRefundsResponse.md +14 -0
  45. data/docs/ListTransactionsRequest.md +15 -0
  46. data/docs/ListTransactionsResponse.md +14 -0
  47. data/docs/Location.md +16 -0
  48. data/docs/LocationApi.md +56 -0
  49. data/docs/LocationCapability.md +12 -0
  50. data/docs/Money.md +13 -0
  51. data/docs/Order.md +16 -0
  52. data/docs/OrderLineItem.md +16 -0
  53. data/docs/Refund.md +20 -0
  54. data/docs/RefundApi.md +126 -0
  55. data/docs/RefundStatus.md +15 -0
  56. data/docs/RetrieveCustomerRequest.md +11 -0
  57. data/docs/RetrieveCustomerResponse.md +13 -0
  58. data/docs/RetrieveTransactionRequest.md +11 -0
  59. data/docs/RetrieveTransactionResponse.md +13 -0
  60. data/docs/SortOrder.md +13 -0
  61. data/docs/Tender.md +22 -0
  62. data/docs/TenderCardDetails.md +14 -0
  63. data/docs/TenderCardDetailsEntryMethod.md +16 -0
  64. data/docs/TenderCardDetailsStatus.md +15 -0
  65. data/docs/TenderCashDetails.md +13 -0
  66. data/docs/TenderType.md +17 -0
  67. data/docs/Transaction.md +21 -0
  68. data/docs/TransactionApi.md +285 -0
  69. data/docs/TransactionProduct.md +19 -0
  70. data/docs/UpdateCustomerRequest.md +20 -0
  71. data/docs/UpdateCustomerResponse.md +13 -0
  72. data/docs/VoidTransactionRequest.md +11 -0
  73. data/docs/VoidTransactionResponse.md +12 -0
  74. data/lib/square_connect.rb +33 -16
  75. data/lib/square_connect/api/checkout_api.rb +82 -0
  76. data/lib/square_connect/api/customer_api.rb +121 -162
  77. data/lib/square_connect/api/customer_card_api.rb +31 -50
  78. data/lib/square_connect/api/location_api.rb +12 -20
  79. data/lib/square_connect/api/refund_api.rb +70 -90
  80. data/lib/square_connect/api/transaction_api.rb +119 -165
  81. data/lib/square_connect/api_client.rb +64 -17
  82. data/lib/square_connect/api_error.rb +7 -3
  83. data/lib/square_connect/configuration.rb +31 -1
  84. data/lib/square_connect/models/address.rb +149 -78
  85. data/lib/square_connect/models/capture_transaction_request.rb +176 -0
  86. data/lib/square_connect/models/capture_transaction_response.rb +54 -26
  87. data/lib/square_connect/models/card.rb +98 -52
  88. data/lib/square_connect/models/card_brand.rb +12 -133
  89. data/lib/square_connect/models/charge_request.rb +106 -67
  90. data/lib/square_connect/models/charge_response.rb +57 -30
  91. data/lib/square_connect/models/checkout.rb +266 -0
  92. data/lib/square_connect/models/country.rb +253 -133
  93. data/lib/square_connect/models/create_checkout_request.rb +316 -0
  94. data/lib/square_connect/models/create_checkout_response.rb +198 -0
  95. data/lib/square_connect/models/create_customer_card_request.rb +66 -35
  96. data/lib/square_connect/models/create_customer_card_response.rb +58 -31
  97. data/lib/square_connect/models/create_customer_request.rb +79 -59
  98. data/lib/square_connect/models/create_customer_response.rb +58 -31
  99. data/lib/square_connect/models/create_order_request.rb +234 -0
  100. data/lib/square_connect/models/create_order_request_line_item.rb +268 -0
  101. data/lib/square_connect/models/create_order_request_order.rb +219 -0
  102. data/lib/square_connect/models/create_refund_request.rb +79 -39
  103. data/lib/square_connect/models/create_refund_response.rb +57 -30
  104. data/lib/square_connect/models/currency.rb +183 -133
  105. data/lib/square_connect/models/customer.rb +130 -77
  106. data/lib/square_connect/models/customer_group_info.rb +206 -0
  107. data/lib/square_connect/models/customer_preferences.rb +186 -0
  108. data/lib/square_connect/models/delete_customer_card_request.rb +176 -0
  109. data/lib/square_connect/models/delete_customer_card_response.rb +55 -27
  110. data/lib/square_connect/models/delete_customer_request.rb +176 -0
  111. data/lib/square_connect/models/delete_customer_response.rb +55 -27
  112. data/lib/square_connect/models/error.rb +107 -45
  113. data/lib/square_connect/models/error_category.rb +9 -133
  114. data/lib/square_connect/models/error_code.rb +75 -133
  115. data/lib/square_connect/models/list_customers_request.rb +55 -27
  116. data/lib/square_connect/models/list_customers_response.rb +61 -35
  117. data/lib/square_connect/models/list_locations_request.rb +176 -0
  118. data/lib/square_connect/models/list_locations_response.rb +57 -30
  119. data/lib/square_connect/models/list_refunds_request.rb +91 -42
  120. data/lib/square_connect/models/list_refunds_response.rb +59 -33
  121. data/lib/square_connect/models/list_transactions_request.rb +91 -42
  122. data/lib/square_connect/models/list_transactions_response.rb +59 -33
  123. data/lib/square_connect/models/location.rb +86 -41
  124. data/lib/square_connect/models/location_capability.rb +4 -133
  125. data/lib/square_connect/models/money.rb +85 -34
  126. data/lib/square_connect/models/order.rb +228 -0
  127. data/lib/square_connect/models/order_line_item.rb +226 -0
  128. data/lib/square_connect/models/refund.rb +138 -59
  129. data/lib/square_connect/models/refund_status.rb +7 -133
  130. data/lib/square_connect/models/retrieve_customer_request.rb +176 -0
  131. data/lib/square_connect/models/retrieve_customer_response.rb +58 -31
  132. data/lib/square_connect/models/retrieve_transaction_request.rb +176 -0
  133. data/lib/square_connect/models/retrieve_transaction_response.rb +57 -30
  134. data/lib/square_connect/models/sort_order.rb +5 -133
  135. data/lib/square_connect/models/tender.rb +112 -65
  136. data/lib/square_connect/models/tender_card_details.rb +93 -40
  137. data/lib/square_connect/models/tender_card_details_entry_method.rb +8 -133
  138. data/lib/square_connect/models/tender_card_details_status.rb +7 -133
  139. data/lib/square_connect/models/tender_cash_details.rb +58 -31
  140. data/lib/square_connect/models/tender_type.rb +9 -133
  141. data/lib/square_connect/models/transaction.rb +132 -56
  142. data/lib/square_connect/models/transaction_product.rb +11 -133
  143. data/lib/square_connect/models/update_customer_request.rb +79 -59
  144. data/lib/square_connect/models/update_customer_response.rb +58 -31
  145. data/lib/square_connect/models/void_transaction_request.rb +176 -0
  146. data/lib/square_connect/models/void_transaction_response.rb +54 -26
  147. data/lib/square_connect/version.rb +2 -3
  148. data/spec/api/checkout_api_spec.rb +53 -0
  149. data/spec/api/customer_api_spec.rb +121 -0
  150. data/spec/api/customer_card_api_spec.rb +71 -0
  151. data/spec/api/location_api_spec.rb +58 -0
  152. data/spec/api/refund_api_spec.rb +75 -0
  153. data/spec/api/transaction_api_spec.rb +128 -0
  154. data/spec/api_client_spec.rb +226 -0
  155. data/spec/configuration_spec.rb +42 -0
  156. data/spec/models/address_spec.rb +186 -0
  157. data/spec/models/capture_transaction_request_spec.rb +36 -0
  158. data/spec/models/capture_transaction_response_spec.rb +46 -0
  159. data/spec/models/card_brand_spec.rb +36 -0
  160. data/spec/models/card_spec.rb +106 -0
  161. data/spec/models/charge_request_spec.rb +146 -0
  162. data/spec/models/charge_response_spec.rb +56 -0
  163. data/spec/models/checkout_spec.rb +126 -0
  164. data/spec/models/country_spec.rb +36 -0
  165. data/spec/models/create_checkout_request_spec.rb +106 -0
  166. data/spec/models/create_checkout_response_spec.rb +56 -0
  167. data/spec/models/create_customer_card_request_spec.rb +66 -0
  168. data/spec/models/create_customer_card_response_spec.rb +56 -0
  169. data/spec/models/create_customer_request_spec.rb +126 -0
  170. data/spec/models/create_customer_response_spec.rb +56 -0
  171. data/spec/models/create_order_request_line_item_spec.rb +66 -0
  172. data/spec/models/create_order_request_order_spec.rb +56 -0
  173. data/spec/models/create_order_request_spec.rb +56 -0
  174. data/spec/models/create_refund_request_spec.rb +76 -0
  175. data/spec/models/create_refund_response_spec.rb +56 -0
  176. data/spec/models/currency_spec.rb +36 -0
  177. data/spec/models/customer_group_info_spec.rb +56 -0
  178. data/spec/models/customer_preferences_spec.rb +46 -0
  179. data/spec/models/customer_spec.rb +186 -0
  180. data/spec/models/delete_customer_card_request_spec.rb +36 -0
  181. data/spec/models/delete_customer_card_response_spec.rb +46 -0
  182. data/spec/models/delete_customer_request_spec.rb +36 -0
  183. data/spec/models/delete_customer_response_spec.rb +46 -0
  184. data/spec/models/error_category_spec.rb +36 -0
  185. data/spec/models/error_code_spec.rb +36 -0
  186. data/spec/models/error_spec.rb +76 -0
  187. data/spec/models/list_customers_request_spec.rb +46 -0
  188. data/spec/models/list_customers_response_spec.rb +66 -0
  189. data/spec/models/list_locations_request_spec.rb +36 -0
  190. data/spec/models/list_locations_response_spec.rb +56 -0
  191. data/spec/models/list_refunds_request_spec.rb +76 -0
  192. data/spec/models/list_refunds_response_spec.rb +66 -0
  193. data/spec/models/list_transactions_request_spec.rb +76 -0
  194. data/spec/models/list_transactions_response_spec.rb +66 -0
  195. data/spec/models/location_capability_spec.rb +36 -0
  196. data/spec/models/location_spec.rb +86 -0
  197. data/spec/models/money_spec.rb +56 -0
  198. data/spec/models/order_line_item_spec.rb +86 -0
  199. data/spec/models/order_spec.rb +86 -0
  200. data/spec/models/refund_spec.rb +126 -0
  201. data/spec/models/refund_status_spec.rb +36 -0
  202. data/spec/models/retrieve_customer_request_spec.rb +36 -0
  203. data/spec/models/retrieve_customer_response_spec.rb +56 -0
  204. data/spec/models/retrieve_transaction_request_spec.rb +36 -0
  205. data/spec/models/retrieve_transaction_response_spec.rb +56 -0
  206. data/spec/models/sort_order_spec.rb +36 -0
  207. data/spec/models/tender_card_details_entry_method_spec.rb +36 -0
  208. data/spec/models/tender_card_details_spec.rb +66 -0
  209. data/spec/models/tender_card_details_status_spec.rb +36 -0
  210. data/spec/models/tender_cash_details_spec.rb +56 -0
  211. data/spec/models/tender_spec.rb +146 -0
  212. data/spec/models/tender_type_spec.rb +36 -0
  213. data/spec/models/transaction_product_spec.rb +36 -0
  214. data/spec/models/transaction_spec.rb +136 -0
  215. data/spec/models/update_customer_request_spec.rb +126 -0
  216. data/spec/models/update_customer_response_spec.rb +56 -0
  217. data/spec/models/void_transaction_request_spec.rb +36 -0
  218. data/spec/models/void_transaction_response_spec.rb +46 -0
  219. data/spec/spec_helper.rb +115 -0
  220. data/square_connect.gemspec +22 -11
  221. data/travis-ci/accounts.enc +0 -0
  222. metadata +264 -31
@@ -0,0 +1,18 @@
1
+ # SquareConnect::CreateCheckoutRequest
2
+
3
+ ### Description
4
+
5
+ Defines the parameters that can be included in the body of a request to the [CreateCheckout](#endpoint-createcheckout) endpoint.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **idempotency_key** | **String** | A unique string that identifies this checkout among others you've created. It can be any valid string but must be unique for every order sent to Square Checkout for a given location ID. The idempotency key is used to avoid processing the same order more than once. If you're unsure whether a particular checkout was created successfully, you can reattempt it with the same idempotency key and all the same other parameters without worrying about creating duplicates. We recommend using a random number/string generator native to the language you are working in to generate strings for your idempotency keys. See [Idempotency keys](#idempotencykeys) for more information. |
11
+ **order** | [**CreateOrderRequestOrder**](CreateOrderRequestOrder.md) | The order including line items to be checked out. |
12
+ **ask_for_shipping_address** | **BOOLEAN** | If `true`, Square Checkout will collect shipping information on your behalf and store that information with the transaction information in your Square Dashboard. Default is `false`. | [optional]
13
+ **merchant_support_email** | **String** | The email address to display on the Square Checkout confirmation page and confirmation email that the buyer can use to contact the merchant. If this value is not set, the confirmation page and email will display the primary email address associated with the merchant's Square account. Default is unset. | [optional]
14
+ **pre_populate_buyer_email** | **String** | If provided, the buyer's email is pre-populated on the checkout page as an editable text field. Default is unset. | [optional]
15
+ **pre_populate_shipping_address** | [**Address**](Address.md) | If provided, the buyer's shipping info is pre-populated on the checkout page as editable text fields. Default is unset. | [optional]
16
+ **redirect_url** | **String** | The URL to redirect to after checkout is completed with `checkoutId`, Square's `orderId`, `transactionId`, and `referenceId` appended as URL parameters. For example, if the provided redirect_url is `http://www.example.com/order-complete`, a successful transaction redirects the customer to: `http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx` If you do not provide a redirect URL, Square Checkout will display an order confirmation page on your behalf; however Square strongly recommends that you provide a redirect URL so you can verify the transaction results and finalize the order through your existing/normal confirmation workflow. Default is unset. | [optional]
17
+
18
+
@@ -0,0 +1,13 @@
1
+ # SquareConnect::CreateCheckoutResponse
2
+
3
+ ### Description
4
+
5
+ Defines the fields that are included in the response body of a request to the [CreateCheckout](#endpoint-createcheckout) endpoint.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **checkout** | [**Checkout**](Checkout.md) | The newly created checkout. If the same request was made with the same idempotency_key, this will be the checkout created with the idempotency_key. | [optional]
11
+ **errors** | [**Array<Error>**](Error.md) | Any errors that occurred during the request. | [optional]
12
+
13
+
@@ -0,0 +1,14 @@
1
+ # SquareConnect::CreateCustomerCardRequest
2
+
3
+ ### Description
4
+
5
+ Defines the fields that are included in the request body of a request to the [CreateCustomerCard](#endpoint-createcustomercard) endpoint.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **card_nonce** | **String** | A card nonce representing the credit card to link to the customer. Card nonces are generated by the `SqPaymentForm` that buyers enter their card information into. See [Embedding the payment form](/articles/adding-payment-form/) for more information. |
11
+ **billing_address** | [**Address**](Address.md) | Address information for the card on file. Only the `postal_code` field is required for payments in the US and Canada. | [optional]
12
+ **cardholder_name** | **String** | The cardholder's name. | [optional]
13
+
14
+
@@ -0,0 +1,13 @@
1
+ # SquareConnect::CreateCustomerCardResponse
2
+
3
+ ### Description
4
+
5
+ Defines the fields that are included in the response body of a request to the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. One of `errors` or `card` is present in a given response (never both).
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **errors** | [**Array<Error>**](Error.md) | Any errors that occurred during the request. | [optional]
11
+ **card** | [**Card**](Card.md) | The created card on file. | [optional]
12
+
13
+
@@ -0,0 +1,20 @@
1
+ # SquareConnect::CreateCustomerRequest
2
+
3
+ ### Description
4
+
5
+ Defines the body parameters that can be provided in a request to the [CreateCustomer](#endpoint-createcustomer) endpoint.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **given_name** | **String** | The customer's given (i.e., first) name. | [optional]
11
+ **family_name** | **String** | The customer's family (i.e., last) name. | [optional]
12
+ **company_name** | **String** | The name of the customer's company. | [optional]
13
+ **nickname** | **String** | A nickname for the customer. | [optional]
14
+ **email_address** | **String** | The customer's email address. | [optional]
15
+ **address** | [**Address**](Address.md) | The customer's physical address. | [optional]
16
+ **phone_number** | **String** | The customer's phone number. | [optional]
17
+ **reference_id** | **String** | An optional second ID you can set to associate the customer with an entity in another system. | [optional]
18
+ **note** | **String** | An optional note to associate with the customer. | [optional]
19
+
20
+
@@ -0,0 +1,13 @@
1
+ # SquareConnect::CreateCustomerResponse
2
+
3
+ ### Description
4
+
5
+ Defines the fields that are included in the response body of a request to the [CreateCustomer](#endpoint-createcustomer) endpoint. One of `errors` or `customer` is present in a given response (never both).
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **errors** | [**Array<Error>**](Error.md) | Any errors that occurred during the request. | [optional]
11
+ **customer** | [**Customer**](Customer.md) | The created customer. | [optional]
12
+
13
+
@@ -0,0 +1,13 @@
1
+ # SquareConnect::CreateOrderRequest
2
+
3
+ ### Description
4
+
5
+ Defines the parameters that can be included in the body of a request to the [CreateOrder](#endpoint-createorder) endpoint.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **idempotency_key** | **String** | A value you specify that uniquely identifies this order among orders you've created. If you're unsure whether a particular order was created successfully, you can reattempt it with the same idempotency key without worrying about creating duplicate orders. See [Idempotency keys](#idempotencykeys) for more information. |
11
+ **order** | [**Order**](Order.md) | The order to be created. |
12
+
13
+
@@ -0,0 +1,14 @@
1
+ # SquareConnect::CreateOrderRequestLineItem
2
+
3
+ ### Description
4
+
5
+ Represents a line item to include in an order. Each line item describes a different product to purchase, with its own quantity and price details.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **name** | **String** | The name of the line item. This value cannot exceed 500 characters. |
11
+ **quantity** | **String** | The quantity to purchase, as a string representation of a number. Currently, only integer values are supported. |
12
+ **base_price_money** | [**Money**](Money.md) | The base price for a single unit of the line item's associated variation. If a line item represents a Custom Amount instead of a particular product, this field indicates that amount. |
13
+
14
+
@@ -0,0 +1,13 @@
1
+ # SquareConnect::CreateOrderRequestOrder
2
+
3
+ ### Description
4
+
5
+ The object describes the order.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **reference_id** | **String** | An optional ID you can associate with the order for your own purposes (such as to associate the order with an entity ID in your own database). This value cannot exceed 40 characters. | [optional]
11
+ **line_items** | [**Array<CreateOrderRequestLineItem>**](CreateOrderRequestLineItem.md) | The line items to associate with this order. Each line item represents a different product (or a custom monetary amount) to include in a purchase. |
12
+
13
+
@@ -0,0 +1,15 @@
1
+ # SquareConnect::CreateRefundRequest
2
+
3
+ ### Description
4
+
5
+ Defines the body parameters that can be included in a request to the [CreateRefund](#endpoint-createrefund) endpoint.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **idempotency_key** | **String** | A value you specify that uniquely identifies this refund among refunds you've created for the tender. If you're unsure whether a particular refund succeeded, you can reattempt it with the same idempotency key without worrying about duplicating the refund. See [Idempotency keys](#idempotencykeys) for more information. |
11
+ **tender_id** | **String** | The ID of the tender to refund. A [`Transaction`](#type-transaction) has one or more `tenders` (i.e., methods of payment) associated with it, and you refund each tender separately with the Connect API. |
12
+ **reason** | **String** | A description of the reason for the refund. Default value: `Refund via API` | [optional]
13
+ **amount_money** | [**Money**](Money.md) | The amount of money to refund. Note that you specify the amount in the __smallest denomination of the applicable currency__. For example, US dollar amounts are specified in cents. See [Working with monetary amounts](#workingwithmonetaryamounts) for details. This amount cannot exceed the amount that was originally charged to the tender that corresponds to `tender_id`. |
14
+
15
+
@@ -0,0 +1,13 @@
1
+ # SquareConnect::CreateRefundResponse
2
+
3
+ ### Description
4
+
5
+ Defines the fields that are included in the response body of a request to the [CreateRefund](#endpoint-createrefund) endpoint. One of `errors` or `refund` is present in a given response (never both).
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **errors** | [**Array<Error>**](Error.md) | Any errors that occurred during the request. | [optional]
11
+ **refund** | [**Refund**](Refund.md) | The created refund. | [optional]
12
+
13
+
@@ -0,0 +1,191 @@
1
+ # SquareConnect::Currency
2
+
3
+ ### Description
4
+
5
+ Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://wikipedia.org/wiki/ISO_4217).
6
+
7
+ ## Properties
8
+ Name | Type
9
+ ------------ | -------------
10
+ **AED** | string
11
+ **AFN** | string
12
+ **ALL** | string
13
+ **AMD** | string
14
+ **ANG** | string
15
+ **AOA** | string
16
+ **ARS** | string
17
+ **AUD** | string
18
+ **AWG** | string
19
+ **AZN** | string
20
+ **BAM** | string
21
+ **BBD** | string
22
+ **BDT** | string
23
+ **BGN** | string
24
+ **BHD** | string
25
+ **BIF** | string
26
+ **BMD** | string
27
+ **BND** | string
28
+ **BOB** | string
29
+ **BOV** | string
30
+ **BRL** | string
31
+ **BSD** | string
32
+ **BTN** | string
33
+ **BWP** | string
34
+ **BYR** | string
35
+ **BZD** | string
36
+ **CAD** | string
37
+ **CDF** | string
38
+ **CHE** | string
39
+ **CHF** | string
40
+ **CHW** | string
41
+ **CLF** | string
42
+ **CLP** | string
43
+ **CNY** | string
44
+ **COP** | string
45
+ **COU** | string
46
+ **CRC** | string
47
+ **CUC** | string
48
+ **CUP** | string
49
+ **CVE** | string
50
+ **CZK** | string
51
+ **DJF** | string
52
+ **DKK** | string
53
+ **DOP** | string
54
+ **DZD** | string
55
+ **EGP** | string
56
+ **ERN** | string
57
+ **ETB** | string
58
+ **EUR** | string
59
+ **FJD** | string
60
+ **FKP** | string
61
+ **GBP** | string
62
+ **GEL** | string
63
+ **GHS** | string
64
+ **GIP** | string
65
+ **GMD** | string
66
+ **GNF** | string
67
+ **GTQ** | string
68
+ **GYD** | string
69
+ **HKD** | string
70
+ **HNL** | string
71
+ **HRK** | string
72
+ **HTG** | string
73
+ **HUF** | string
74
+ **IDR** | string
75
+ **ILS** | string
76
+ **INR** | string
77
+ **IQD** | string
78
+ **IRR** | string
79
+ **ISK** | string
80
+ **JMD** | string
81
+ **JOD** | string
82
+ **JPY** | string
83
+ **KES** | string
84
+ **KGS** | string
85
+ **KHR** | string
86
+ **KMF** | string
87
+ **KPW** | string
88
+ **KRW** | string
89
+ **KWD** | string
90
+ **KYD** | string
91
+ **KZT** | string
92
+ **LAK** | string
93
+ **LBP** | string
94
+ **LKR** | string
95
+ **LRD** | string
96
+ **LSL** | string
97
+ **LTL** | string
98
+ **LVL** | string
99
+ **LYD** | string
100
+ **MAD** | string
101
+ **MDL** | string
102
+ **MGA** | string
103
+ **MKD** | string
104
+ **MMK** | string
105
+ **MNT** | string
106
+ **MOP** | string
107
+ **MRO** | string
108
+ **MUR** | string
109
+ **MVR** | string
110
+ **MWK** | string
111
+ **MXN** | string
112
+ **MXV** | string
113
+ **MYR** | string
114
+ **MZN** | string
115
+ **NAD** | string
116
+ **NGN** | string
117
+ **NIO** | string
118
+ **NOK** | string
119
+ **NPR** | string
120
+ **NZD** | string
121
+ **OMR** | string
122
+ **PAB** | string
123
+ **PEN** | string
124
+ **PGK** | string
125
+ **PHP** | string
126
+ **PKR** | string
127
+ **PLN** | string
128
+ **PYG** | string
129
+ **QAR** | string
130
+ **RON** | string
131
+ **RSD** | string
132
+ **RUB** | string
133
+ **RWF** | string
134
+ **SAR** | string
135
+ **SBD** | string
136
+ **SCR** | string
137
+ **SDG** | string
138
+ **SEK** | string
139
+ **SGD** | string
140
+ **SHP** | string
141
+ **SLL** | string
142
+ **SOS** | string
143
+ **SRD** | string
144
+ **SSP** | string
145
+ **STD** | string
146
+ **SVC** | string
147
+ **SYP** | string
148
+ **SZL** | string
149
+ **THB** | string
150
+ **TJS** | string
151
+ **TMT** | string
152
+ **TND** | string
153
+ **TOP** | string
154
+ **TRY** | string
155
+ **TTD** | string
156
+ **TWD** | string
157
+ **TZS** | string
158
+ **UAH** | string
159
+ **UGX** | string
160
+ **USD** | string
161
+ **USN** | string
162
+ **USS** | string
163
+ **UYI** | string
164
+ **UYU** | string
165
+ **UZS** | string
166
+ **VEF** | string
167
+ **VND** | string
168
+ **VUV** | string
169
+ **WST** | string
170
+ **XAF** | string
171
+ **XAG** | string
172
+ **XAU** | string
173
+ **XBA** | string
174
+ **XBB** | string
175
+ **XBC** | string
176
+ **XBD** | string
177
+ **XCD** | string
178
+ **XDR** | string
179
+ **XOF** | string
180
+ **XPD** | string
181
+ **XPF** | string
182
+ **XPT** | string
183
+ **XTS** | string
184
+ **XXX** | string
185
+ **YER** | string
186
+ **ZAR** | string
187
+ **ZMK** | string
188
+ **ZMW** | string
189
+ **BTC** | string
190
+
191
+
@@ -0,0 +1,26 @@
1
+ # SquareConnect::Customer
2
+
3
+ ### Description
4
+
5
+ Represents one of a business's customers, which can have one or more cards on file associated with it.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **id** | **String** | The customer's unique ID. |
11
+ **created_at** | **String** | The time when the customer was created, in RFC 3339 format. |
12
+ **updated_at** | **String** | The time when the customer was last updated, in RFC 3339 format. |
13
+ **cards** | [**Array<Card>**](Card.md) | The non-confidential details of the customer's cards on file. | [optional]
14
+ **given_name** | **String** | The customer's given (i.e., first) name. | [optional]
15
+ **family_name** | **String** | The customer's family (i.e., last) name. | [optional]
16
+ **nickname** | **String** | The customer's nickname. | [optional]
17
+ **company_name** | **String** | The name of the customer's company. | [optional]
18
+ **email_address** | **String** | The customer's email address. | [optional]
19
+ **address** | [**Address**](Address.md) | The customer's physical address. | [optional]
20
+ **phone_number** | **String** | The customer's phone number. | [optional]
21
+ **reference_id** | **String** | A second ID you can set to associate the customer with an entity in another system. | [optional]
22
+ **note** | **String** | A note to associate with the customer. | [optional]
23
+ **preferences** | [**CustomerPreferences**](CustomerPreferences.md) | The customer's preferences. | [optional]
24
+ **groups** | [**Array<CustomerGroupInfo>**](CustomerGroupInfo.md) | The groups the customer belongs to. | [optional]
25
+
26
+
@@ -0,0 +1,267 @@
1
+ # SquareConnect::CustomerApi
2
+
3
+ All URIs are relative to *https://connect.squareup.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**create_customer**](CustomerApi.md#create_customer) | **POST** /v2/customers | CreateCustomer
8
+ [**delete_customer**](CustomerApi.md#delete_customer) | **DELETE** /v2/customers/{customer_id} | DeleteCustomer
9
+ [**list_customers**](CustomerApi.md#list_customers) | **GET** /v2/customers | ListCustomers
10
+ [**retrieve_customer**](CustomerApi.md#retrieve_customer) | **GET** /v2/customers/{customer_id} | RetrieveCustomer
11
+ [**update_customer**](CustomerApi.md#update_customer) | **PUT** /v2/customers/{customer_id} | UpdateCustomer
12
+
13
+
14
+ # **create_customer**
15
+ > CreateCustomerResponse create_customer(authorization, body)
16
+
17
+ CreateCustomer
18
+
19
+ Creates a new customer for a business, which can have associated cards on file. You must provide __at least one__ of the following values in your request to this endpoint: - `given_name` - `family_name` - `company_name` - `email_address` - `phone_number` This endpoint does not accept an idempotency key. If you accidentally create a duplicate customer, you can delete it with the [DeleteCustomer](#endpoint-deletecustomer) endpoint.
20
+
21
+ ### Example
22
+ ```ruby
23
+ # load the gem
24
+ require 'square_connect'
25
+
26
+ api_instance = SquareConnect::CustomerApi.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
+ body = SquareConnect::CreateCustomerRequest.new # CreateCustomerRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
31
+
32
+
33
+ begin
34
+ #CreateCustomer
35
+ result = api_instance.create_customer(authorization, body)
36
+ p result
37
+ rescue SquareConnect::ApiError => e
38
+ puts "Exception when calling CustomerApi->create_customer: #{e}"
39
+ end
40
+ ```
41
+
42
+ ### Parameters
43
+
44
+ Name | Type | Description | Notes
45
+ ------------- | ------------- | ------------- | -------------
46
+ **authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
47
+ **body** | [**CreateCustomerRequest**](CreateCustomerRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
48
+
49
+ ### Return type
50
+
51
+ [**CreateCustomerResponse**](CreateCustomerResponse.md)
52
+
53
+ ### Authorization
54
+
55
+ No authorization required
56
+
57
+ ### HTTP request headers
58
+
59
+ - **Content-Type**: application/json
60
+ - **Accept**: application/json
61
+
62
+
63
+
64
+ # **delete_customer**
65
+ > DeleteCustomerResponse delete_customer(authorization, customer_id)
66
+
67
+ DeleteCustomer
68
+
69
+ Deletes a customer from a business, along with any linked cards on file.
70
+
71
+ ### Example
72
+ ```ruby
73
+ # load the gem
74
+ require 'square_connect'
75
+
76
+ api_instance = SquareConnect::CustomerApi.new
77
+
78
+ 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`.
79
+
80
+ customer_id = "customer_id_example" # String | The ID of the customer to delete.
81
+
82
+
83
+ begin
84
+ #DeleteCustomer
85
+ result = api_instance.delete_customer(authorization, customer_id)
86
+ p result
87
+ rescue SquareConnect::ApiError => e
88
+ puts "Exception when calling CustomerApi->delete_customer: #{e}"
89
+ end
90
+ ```
91
+
92
+ ### Parameters
93
+
94
+ Name | Type | Description | Notes
95
+ ------------- | ------------- | ------------- | -------------
96
+ **authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
97
+ **customer_id** | **String**| The ID of the customer to delete. |
98
+
99
+ ### Return type
100
+
101
+ [**DeleteCustomerResponse**](DeleteCustomerResponse.md)
102
+
103
+ ### Authorization
104
+
105
+ No authorization required
106
+
107
+ ### HTTP request headers
108
+
109
+ - **Content-Type**: application/json
110
+ - **Accept**: application/json
111
+
112
+
113
+
114
+ # **list_customers**
115
+ > ListCustomersResponse list_customers(authorization, opts)
116
+
117
+ ListCustomers
118
+
119
+ Lists a business's customers.
120
+
121
+ ### Example
122
+ ```ruby
123
+ # load the gem
124
+ require 'square_connect'
125
+
126
+ api_instance = SquareConnect::CustomerApi.new
127
+
128
+ 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`.
129
+
130
+ opts = {
131
+ 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.
132
+ }
133
+
134
+ begin
135
+ #ListCustomers
136
+ result = api_instance.list_customers(authorization, opts)
137
+ p result
138
+ rescue SquareConnect::ApiError => e
139
+ puts "Exception when calling CustomerApi->list_customers: #{e}"
140
+ end
141
+ ```
142
+
143
+ ### Parameters
144
+
145
+ Name | Type | Description | Notes
146
+ ------------- | ------------- | ------------- | -------------
147
+ **authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
148
+ **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]
149
+
150
+ ### Return type
151
+
152
+ [**ListCustomersResponse**](ListCustomersResponse.md)
153
+
154
+ ### Authorization
155
+
156
+ No authorization required
157
+
158
+ ### HTTP request headers
159
+
160
+ - **Content-Type**: application/json
161
+ - **Accept**: application/json
162
+
163
+
164
+
165
+ # **retrieve_customer**
166
+ > RetrieveCustomerResponse retrieve_customer(authorization, customer_id)
167
+
168
+ RetrieveCustomer
169
+
170
+ Returns details for a single customer.
171
+
172
+ ### Example
173
+ ```ruby
174
+ # load the gem
175
+ require 'square_connect'
176
+
177
+ api_instance = SquareConnect::CustomerApi.new
178
+
179
+ 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`.
180
+
181
+ customer_id = "customer_id_example" # String | The ID of the customer to retrieve.
182
+
183
+
184
+ begin
185
+ #RetrieveCustomer
186
+ result = api_instance.retrieve_customer(authorization, customer_id)
187
+ p result
188
+ rescue SquareConnect::ApiError => e
189
+ puts "Exception when calling CustomerApi->retrieve_customer: #{e}"
190
+ end
191
+ ```
192
+
193
+ ### Parameters
194
+
195
+ Name | Type | Description | Notes
196
+ ------------- | ------------- | ------------- | -------------
197
+ **authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
198
+ **customer_id** | **String**| The ID of the customer to retrieve. |
199
+
200
+ ### Return type
201
+
202
+ [**RetrieveCustomerResponse**](RetrieveCustomerResponse.md)
203
+
204
+ ### Authorization
205
+
206
+ No authorization required
207
+
208
+ ### HTTP request headers
209
+
210
+ - **Content-Type**: application/json
211
+ - **Accept**: application/json
212
+
213
+
214
+
215
+ # **update_customer**
216
+ > UpdateCustomerResponse update_customer(authorization, customer_id, body)
217
+
218
+ UpdateCustomer
219
+
220
+ Updates the details of an existing customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint.
221
+
222
+ ### Example
223
+ ```ruby
224
+ # load the gem
225
+ require 'square_connect'
226
+
227
+ api_instance = SquareConnect::CustomerApi.new
228
+
229
+ 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`.
230
+
231
+ customer_id = "customer_id_example" # String | The ID of the customer to update.
232
+
233
+ body = SquareConnect::UpdateCustomerRequest.new # UpdateCustomerRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
234
+
235
+
236
+ begin
237
+ #UpdateCustomer
238
+ result = api_instance.update_customer(authorization, customer_id, body)
239
+ p result
240
+ rescue SquareConnect::ApiError => e
241
+ puts "Exception when calling CustomerApi->update_customer: #{e}"
242
+ end
243
+ ```
244
+
245
+ ### Parameters
246
+
247
+ Name | Type | Description | Notes
248
+ ------------- | ------------- | ------------- | -------------
249
+ **authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
250
+ **customer_id** | **String**| The ID of the customer to update. |
251
+ **body** | [**UpdateCustomerRequest**](UpdateCustomerRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
252
+
253
+ ### Return type
254
+
255
+ [**UpdateCustomerResponse**](UpdateCustomerResponse.md)
256
+
257
+ ### Authorization
258
+
259
+ No authorization required
260
+
261
+ ### HTTP request headers
262
+
263
+ - **Content-Type**: application/json
264
+ - **Accept**: application/json
265
+
266
+
267
+