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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2450e79746e4ced5399510f8792b30f0ecf3d7b7
4
- data.tar.gz: e8b039a0ac5e579c7d80d64b4c75bf6561104087
3
+ metadata.gz: 2079515ea891e08b25df4d246d5720ff331fb60a
4
+ data.tar.gz: 7f9aa2305578144d592c9e0be8e760ba94d47574
5
5
  SHA512:
6
- metadata.gz: dfeac07d26ac053117336bde427b97eb606314b38234765b6fb63bfd4b0782c751bbeee71777cb04d1223b365543984e44f087d1511ac1ec7ee936cc939e3fff
7
- data.tar.gz: 34264b57627602750d85d1b3d278ba9741dbf7317792e910c6807a1dee9112b777367e965059e4d6c3da043881aabf11deb4236b307a50a0cf348d0896c0afc0
6
+ metadata.gz: 8b40ee2dc79d631f99664550b92e0402d86d8e7efe5403aee1e8014277c921c7d177dd0f5f94b0bff3cbed33cfbe3e3c5623ecedf40c583347b90cd12f8fe5b2
7
+ data.tar.gz: df4315592045d57ac6e80a728a2aff7c9207b35acd72c497d43ccc920299b34570087a624fbe95d25ffa81c751e1249a79a00d2edfa674231994d391d8fc5196
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 12.0.0'
7
+ end
data/README.md CHANGED
@@ -1,14 +1,19 @@
1
- Connect v2 SDKs
1
+ Connect v2 Ruby SDKs [![Build Status](https://travis-ci.org/square/connect-ruby-sdk.svg?branch=master)](https://travis-ci.org/square/connect-ruby-sdk)[![Gem Version](https://badge.fury.io/rb/square_connect.svg)](https://badge.fury.io/rb/square_connect)
2
2
  ===============
3
3
 
4
- This repository contains the released Ruby client SDK. Check out our other
5
- repository for the specification and template files we used to generate this.
4
+ This repository contains the released Ruby client SDK. Check out our [API
5
+ specification repository](https://github.com/square/connect-api-specification)
6
+ for the specification and template files we used to generate this.
6
7
 
7
- Usage
8
- -----
8
+ This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
9
9
 
10
- ### Ruby
10
+ - API version: 2.0
11
+ - Package version: 2.0.2
12
+ - Build package: io.swagger.codegen.languages.RubyClientCodegen
11
13
 
14
+ ## Installation
15
+
16
+ ### RubyGems
12
17
  The Ruby SDK is published as a gem. Simply run:
13
18
 
14
19
  ```
@@ -21,17 +26,154 @@ Or add this line to your Gemfile:
21
26
  gem 'square_connect'
22
27
  ```
23
28
 
29
+ ### Install from Git
30
+
31
+ If the Ruby gem is hosted at a git repository: https://github.com/square/connect-ruby-sdk, then add the following in the Gemfile:
32
+
33
+ gem 'square_connect', :git => 'https://github.com/square/connect-ruby-sdk.git'
34
+
35
+ ### Include the Ruby code directly
36
+
37
+ Include the Ruby code directly using `-I` as follows:
38
+
39
+ ```shell
40
+ ruby -Ilib script.rb
41
+ ```
42
+
43
+ ## Getting Started
44
+
45
+ Please follow the [installation](#installation) procedure and then run the following code:
46
+ ```ruby
47
+ # Load the gem
48
+ require 'square_connect'
49
+
50
+ api_instance = SquareConnect::CheckoutApi.new
51
+
52
+ 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`.
53
+
54
+ location_id = "location_id_example" # String | The ID of the business location to associate the checkout with.
55
+
56
+ body = SquareConnect::CreateCheckoutRequest.new # CreateCheckoutRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
57
+
58
+
59
+ begin
60
+ #CreateCheckout
61
+ result = api_instance.create_checkout(authorization, location_id, body)
62
+ p result
63
+ rescue SquareConnect::ApiError => e
64
+ puts "Exception when calling CheckoutApi->create_checkout: #{e}"
65
+ end
66
+
67
+ ```
68
+
69
+ ## Documentation for API Endpoints
70
+
71
+ All URIs are relative to *https://connect.squareup.com*
72
+
73
+ Class | Method | HTTP request | Description
74
+ ------------ | ------------- | ------------- | -------------
75
+ *SquareConnect::CheckoutApi* | [**create_checkout**](docs/CheckoutApi.md#create_checkout) | **POST** /v2/locations/{location_id}/checkouts | CreateCheckout
76
+ *SquareConnect::CustomerApi* | [**create_customer**](docs/CustomerApi.md#create_customer) | **POST** /v2/customers | CreateCustomer
77
+ *SquareConnect::CustomerApi* | [**delete_customer**](docs/CustomerApi.md#delete_customer) | **DELETE** /v2/customers/{customer_id} | DeleteCustomer
78
+ *SquareConnect::CustomerApi* | [**list_customers**](docs/CustomerApi.md#list_customers) | **GET** /v2/customers | ListCustomers
79
+ *SquareConnect::CustomerApi* | [**retrieve_customer**](docs/CustomerApi.md#retrieve_customer) | **GET** /v2/customers/{customer_id} | RetrieveCustomer
80
+ *SquareConnect::CustomerApi* | [**update_customer**](docs/CustomerApi.md#update_customer) | **PUT** /v2/customers/{customer_id} | UpdateCustomer
81
+ *SquareConnect::CustomerCardApi* | [**create_customer_card**](docs/CustomerCardApi.md#create_customer_card) | **POST** /v2/customers/{customer_id}/cards | CreateCustomerCard
82
+ *SquareConnect::CustomerCardApi* | [**delete_customer_card**](docs/CustomerCardApi.md#delete_customer_card) | **DELETE** /v2/customers/{customer_id}/cards/{card_id} | DeleteCustomerCard
83
+ *SquareConnect::LocationApi* | [**list_locations**](docs/LocationApi.md#list_locations) | **GET** /v2/locations | ListLocations
84
+ *SquareConnect::RefundApi* | [**create_refund**](docs/RefundApi.md#create_refund) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/refund | CreateRefund
85
+ *SquareConnect::RefundApi* | [**list_refunds**](docs/RefundApi.md#list_refunds) | **GET** /v2/locations/{location_id}/refunds | ListRefunds
86
+ *SquareConnect::TransactionApi* | [**capture_transaction**](docs/TransactionApi.md#capture_transaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/capture | CaptureTransaction
87
+ *SquareConnect::TransactionApi* | [**charge**](docs/TransactionApi.md#charge) | **POST** /v2/locations/{location_id}/transactions | Charge
88
+ *SquareConnect::TransactionApi* | [**list_transactions**](docs/TransactionApi.md#list_transactions) | **GET** /v2/locations/{location_id}/transactions | ListTransactions
89
+ *SquareConnect::TransactionApi* | [**retrieve_transaction**](docs/TransactionApi.md#retrieve_transaction) | **GET** /v2/locations/{location_id}/transactions/{transaction_id} | RetrieveTransaction
90
+ *SquareConnect::TransactionApi* | [**void_transaction**](docs/TransactionApi.md#void_transaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/void | VoidTransaction
91
+
92
+
93
+ ## Documentation for Models
94
+
95
+ - [SquareConnect::Address](docs/Address.md)
96
+ - [SquareConnect::CaptureTransactionRequest](docs/CaptureTransactionRequest.md)
97
+ - [SquareConnect::CaptureTransactionResponse](docs/CaptureTransactionResponse.md)
98
+ - [SquareConnect::Card](docs/Card.md)
99
+ - [SquareConnect::CardBrand](docs/CardBrand.md)
100
+ - [SquareConnect::ChargeRequest](docs/ChargeRequest.md)
101
+ - [SquareConnect::ChargeResponse](docs/ChargeResponse.md)
102
+ - [SquareConnect::Checkout](docs/Checkout.md)
103
+ - [SquareConnect::Country](docs/Country.md)
104
+ - [SquareConnect::CreateCheckoutRequest](docs/CreateCheckoutRequest.md)
105
+ - [SquareConnect::CreateCheckoutResponse](docs/CreateCheckoutResponse.md)
106
+ - [SquareConnect::CreateCustomerCardRequest](docs/CreateCustomerCardRequest.md)
107
+ - [SquareConnect::CreateCustomerCardResponse](docs/CreateCustomerCardResponse.md)
108
+ - [SquareConnect::CreateCustomerRequest](docs/CreateCustomerRequest.md)
109
+ - [SquareConnect::CreateCustomerResponse](docs/CreateCustomerResponse.md)
110
+ - [SquareConnect::CreateOrderRequest](docs/CreateOrderRequest.md)
111
+ - [SquareConnect::CreateOrderRequestLineItem](docs/CreateOrderRequestLineItem.md)
112
+ - [SquareConnect::CreateOrderRequestOrder](docs/CreateOrderRequestOrder.md)
113
+ - [SquareConnect::CreateRefundRequest](docs/CreateRefundRequest.md)
114
+ - [SquareConnect::CreateRefundResponse](docs/CreateRefundResponse.md)
115
+ - [SquareConnect::Currency](docs/Currency.md)
116
+ - [SquareConnect::Customer](docs/Customer.md)
117
+ - [SquareConnect::CustomerGroupInfo](docs/CustomerGroupInfo.md)
118
+ - [SquareConnect::CustomerPreferences](docs/CustomerPreferences.md)
119
+ - [SquareConnect::DeleteCustomerCardRequest](docs/DeleteCustomerCardRequest.md)
120
+ - [SquareConnect::DeleteCustomerCardResponse](docs/DeleteCustomerCardResponse.md)
121
+ - [SquareConnect::DeleteCustomerRequest](docs/DeleteCustomerRequest.md)
122
+ - [SquareConnect::DeleteCustomerResponse](docs/DeleteCustomerResponse.md)
123
+ - [SquareConnect::Error](docs/Error.md)
124
+ - [SquareConnect::ErrorCategory](docs/ErrorCategory.md)
125
+ - [SquareConnect::ErrorCode](docs/ErrorCode.md)
126
+ - [SquareConnect::ListCustomersRequest](docs/ListCustomersRequest.md)
127
+ - [SquareConnect::ListCustomersResponse](docs/ListCustomersResponse.md)
128
+ - [SquareConnect::ListLocationsRequest](docs/ListLocationsRequest.md)
129
+ - [SquareConnect::ListLocationsResponse](docs/ListLocationsResponse.md)
130
+ - [SquareConnect::ListRefundsRequest](docs/ListRefundsRequest.md)
131
+ - [SquareConnect::ListRefundsResponse](docs/ListRefundsResponse.md)
132
+ - [SquareConnect::ListTransactionsRequest](docs/ListTransactionsRequest.md)
133
+ - [SquareConnect::ListTransactionsResponse](docs/ListTransactionsResponse.md)
134
+ - [SquareConnect::Location](docs/Location.md)
135
+ - [SquareConnect::LocationCapability](docs/LocationCapability.md)
136
+ - [SquareConnect::Money](docs/Money.md)
137
+ - [SquareConnect::Order](docs/Order.md)
138
+ - [SquareConnect::OrderLineItem](docs/OrderLineItem.md)
139
+ - [SquareConnect::Refund](docs/Refund.md)
140
+ - [SquareConnect::RefundStatus](docs/RefundStatus.md)
141
+ - [SquareConnect::RetrieveCustomerRequest](docs/RetrieveCustomerRequest.md)
142
+ - [SquareConnect::RetrieveCustomerResponse](docs/RetrieveCustomerResponse.md)
143
+ - [SquareConnect::RetrieveTransactionRequest](docs/RetrieveTransactionRequest.md)
144
+ - [SquareConnect::RetrieveTransactionResponse](docs/RetrieveTransactionResponse.md)
145
+ - [SquareConnect::SortOrder](docs/SortOrder.md)
146
+ - [SquareConnect::Tender](docs/Tender.md)
147
+ - [SquareConnect::TenderCardDetails](docs/TenderCardDetails.md)
148
+ - [SquareConnect::TenderCardDetailsEntryMethod](docs/TenderCardDetailsEntryMethod.md)
149
+ - [SquareConnect::TenderCardDetailsStatus](docs/TenderCardDetailsStatus.md)
150
+ - [SquareConnect::TenderCashDetails](docs/TenderCashDetails.md)
151
+ - [SquareConnect::TenderType](docs/TenderType.md)
152
+ - [SquareConnect::Transaction](docs/Transaction.md)
153
+ - [SquareConnect::TransactionProduct](docs/TransactionProduct.md)
154
+ - [SquareConnect::UpdateCustomerRequest](docs/UpdateCustomerRequest.md)
155
+ - [SquareConnect::UpdateCustomerResponse](docs/UpdateCustomerResponse.md)
156
+ - [SquareConnect::VoidTransactionRequest](docs/VoidTransactionRequest.md)
157
+ - [SquareConnect::VoidTransactionResponse](docs/VoidTransactionResponse.md)
158
+
159
+
160
+ ## Documentation for Authorization
161
+
162
+ All endpoints do not require authorization.
163
+
164
+
24
165
  Contributing
25
166
  ------------
26
167
 
27
- Send bug reports, feature requests, and code contributions to API specifications
28
- repository, as this repository contains only the generated SDK code.
168
+ Send bug reports, feature requests, and code contributions to the [API
169
+ specifications repository](https://github.com/square/connect-api-specification),
170
+ as this repository contains only the generated SDK code.
29
171
 
30
172
  License
31
173
  -------
32
174
 
33
175
  ```
34
- Copyright 2016 Square, Inc.
176
+ Copyright 2017 Square, Inc.
35
177
 
36
178
  Licensed under the Apache License, Version 2.0 (the "License");
37
179
  you may not use this file except in compliance with the License.
@@ -0,0 +1,8 @@
1
+ begin
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task default: :spec
6
+ rescue LoadError
7
+ # no rspec available
8
+ end
@@ -0,0 +1,26 @@
1
+ # SquareConnect::Address
2
+
3
+ ### Description
4
+
5
+ Represents a physical address.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **address_line_1** | **String** | The first line of the address. Fields that start with `address_line` provide the address's most specific details, like street number, street name, and building name. They do *not* provide less specific details like city, state/province, or country (these details are provided in other fields). | [optional]
11
+ **address_line_2** | **String** | The second line of the address, if any. | [optional]
12
+ **address_line_3** | **String** | The third line of the address, if any. | [optional]
13
+ **locality** | **String** | The city or town of the address. | [optional]
14
+ **sublocality** | **String** | A civil region within the address's `locality`, if any. | [optional]
15
+ **sublocality_2** | **String** | A civil region within the address's `sublocality`, if any. | [optional]
16
+ **sublocality_3** | **String** | A civil region within the address's `sublocality_2`, if any. | [optional]
17
+ **administrative_district_level_1** | **String** | A civil entity within the address's country. In the US, this is the state. | [optional]
18
+ **administrative_district_level_2** | **String** | A civil entity within the address's `administrative_district_level_1`. In the US, this is the county. | [optional]
19
+ **administrative_district_level_3** | **String** | A civil entity within the address's `administrative_district_level_2`, if any. | [optional]
20
+ **postal_code** | **String** | The address's postal code. | [optional]
21
+ **country** | **String** | The address's country, in ISO 3166-1-alpha-2 format. | [optional]
22
+ **first_name** | **String** | Optional first name when it's representing recipient. | [optional]
23
+ **last_name** | **String** | Optional last name when it's representing recipient. | [optional]
24
+ **organization** | **String** | Optional organization name when it's representing recipient. | [optional]
25
+
26
+
@@ -0,0 +1,11 @@
1
+ # SquareConnect::CaptureTransactionRequest
2
+
3
+ ### Description
4
+
5
+
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+
11
+
@@ -0,0 +1,12 @@
1
+ # SquareConnect::CaptureTransactionResponse
2
+
3
+ ### Description
4
+
5
+ Defines the fields that are included in the response body of a request to the [CaptureTransaction](#endpoint-capturetransaction) endpoint.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **errors** | [**Array<Error>**](Error.md) | Any errors that occurred during the request. | [optional]
11
+
12
+
@@ -0,0 +1,18 @@
1
+ # SquareConnect::Card
2
+
3
+ ### Description
4
+
5
+ Represents the non-confidential details of a credit card.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **id** | **String** | The card's unique ID, if any. | [optional]
11
+ **card_brand** | **String** | The card's brand (such as `VISA`). See [CardBrand](#type-cardbrand) for all possible values. | [optional]
12
+ **last_4** | **String** | The last 4 digits of the card's number. | [optional]
13
+ **exp_month** | **Integer** | The month of the card's expiration date. This value is always between `1` and `12`, inclusive. | [optional]
14
+ **exp_year** | **Integer** | The four-digit year of the card's expiration date. | [optional]
15
+ **cardholder_name** | **String** | The cardholder name. This value is present only if this object represents a customer's card on file. | [optional]
16
+ **billing_address** | [**Address**](Address.md) | The card's billing address. This value is present only if this object represents a customer's card on file. | [optional]
17
+
18
+
@@ -0,0 +1,20 @@
1
+ # SquareConnect::CardBrand
2
+
3
+ ### Description
4
+
5
+ Indicates a credit card's brand, such as `VISA`.
6
+
7
+ ## Properties
8
+ Name | Type
9
+ ------------ | -------------
10
+ **OTHER_BRAND** | string
11
+ **VISA** | string
12
+ **MASTERCARD** | string
13
+ **AMERICAN_EXPRESS** | string
14
+ **DISCOVER** | string
15
+ **DISCOVER_DINERS** | string
16
+ **JCB** | string
17
+ **CHINA_UNIONPAY** | string
18
+ **SQUARE_GIFT_CARD** | string
19
+
20
+
@@ -0,0 +1,22 @@
1
+ # SquareConnect::ChargeRequest
2
+
3
+ ### Description
4
+
5
+ Defines the parameters that can be included in the body of a request to the [Charge](#endpoint-charge) endpoint.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **idempotency_key** | **String** | A value you specify that uniquely identifies this transaction among transactions you've created. If you're unsure whether a particular transaction succeeded, you can reattempt it with the same idempotency key without worrying about double-charging the buyer. See [Idempotency keys](#idempotencykeys) for more information. |
11
+ **amount_money** | [**Money**](Money.md) | The amount of money to charge. 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. The value of `currency` must match the currency associated with the business that is charging the card. |
12
+ **card_nonce** | **String** | A nonce generated from the `SqPaymentForm` that represents the card to charge. The application that provides a nonce to this endpoint must be the _same application_ that generated the nonce with the `SqPaymentForm`. Otherwise, the nonce is invalid. Do not provide a value for this field if you provide a value for `customer_card_id`. | [optional]
13
+ **customer_card_id** | **String** | The ID of the customer card on file to charge. Do not provide a value for this field if you provide a value for `card_nonce`. If you provide this value, you _must_ also provide a value for `customer_id`. | [optional]
14
+ **delay_capture** | **BOOLEAN** | If `true`, the request will only perform an Auth on the provided card. You can then later perform either a Capture (with the [CaptureTransaction](#endpoint-capturetransaction) endpoint) or a Void (with the [VoidTransation](#endpoint-voidtransaction) endpoint). Default value: `false` | [optional]
15
+ **reference_id** | **String** | An optional ID you can associate with the transaction for your own purposes (such as to associate the transaction with an entity ID in your own database). This value cannot exceed 40 characters. | [optional]
16
+ **note** | **String** | An optional note to associate with the transaction. This value cannot exceed 60 characters. | [optional]
17
+ **customer_id** | **String** | The ID of the customer to associate this transaction with. This field is required if you provide a value for `customer_card_id`, and optional otherwise. | [optional]
18
+ **billing_address** | [**Address**](Address.md) | The buyer's billing address. This value is optional, but this transaction is ineligible for chargeback protection if neither this parameter nor `shipping_address` is provided. | [optional]
19
+ **shipping_address** | [**Address**](Address.md) | The buyer's shipping address, if available. This value is optional, but this transaction is ineligible for chargeback protection if neither this parameter nor `billing_address` is provided. | [optional]
20
+ **buyer_email_address** | **String** | The buyer's email address, if available. This value is optional, but this transaction is ineligible for chargeback protection if it is not provided. | [optional]
21
+
22
+
@@ -0,0 +1,13 @@
1
+ # SquareConnect::ChargeResponse
2
+
3
+ ### Description
4
+
5
+ Defines the fields that are included in the response body of a request to the [Charge](#endpoint-charge) endpoint. One of `errors` or `transaction` 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
+ **transaction** | [**Transaction**](Transaction.md) | The created transaction. | [optional]
12
+
13
+
@@ -0,0 +1,20 @@
1
+ # SquareConnect::Checkout
2
+
3
+ ### Description
4
+
5
+ Square Checkout lets merchants accept online payments for supported payment types using a checkout workflow hosted on squareup.com.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **id** | **String** | ID generated by Square Checkout when a new checkout is requested. | [optional]
11
+ **checkout_page_url** | **String** | The URL that the buyer's browser should be redirected to after the checkout is completed. | [optional]
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. | [optional]
17
+ **order** | [**Order**](Order.md) | Order to be checked out. | [optional]
18
+ **created_at** | **String** | The time when the checkout was created, in RFC 3339 format. | [optional]
19
+
20
+
@@ -0,0 +1,62 @@
1
+ # SquareConnect::CheckoutApi
2
+
3
+ All URIs are relative to *https://connect.squareup.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**create_checkout**](CheckoutApi.md#create_checkout) | **POST** /v2/locations/{location_id}/checkouts | CreateCheckout
8
+
9
+
10
+ # **create_checkout**
11
+ > CreateCheckoutResponse create_checkout(authorization, location_id, body)
12
+
13
+ CreateCheckout
14
+
15
+ Creates a [Checkout](#type-checkout) response that links a `checkoutId` and `checkout_page_url` that customers can be directed to in order to provide their payment information using a payment processing workflow hosted on connect.squareup.com.
16
+
17
+ ### Example
18
+ ```ruby
19
+ # load the gem
20
+ require 'square_connect'
21
+
22
+ api_instance = SquareConnect::CheckoutApi.new
23
+
24
+ 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`.
25
+
26
+ location_id = "location_id_example" # String | The ID of the business location to associate the checkout with.
27
+
28
+ body = SquareConnect::CreateCheckoutRequest.new # CreateCheckoutRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
29
+
30
+
31
+ begin
32
+ #CreateCheckout
33
+ result = api_instance.create_checkout(authorization, location_id, body)
34
+ p result
35
+ rescue SquareConnect::ApiError => e
36
+ puts "Exception when calling CheckoutApi->create_checkout: #{e}"
37
+ end
38
+ ```
39
+
40
+ ### Parameters
41
+
42
+ Name | Type | Description | Notes
43
+ ------------- | ------------- | ------------- | -------------
44
+ **authorization** | **String**| The value to provide in the Authorization header of your request. This value should follow the format `Bearer YOUR_ACCESS_TOKEN_HERE`. |
45
+ **location_id** | **String**| The ID of the business location to associate the checkout with. |
46
+ **body** | [**CreateCheckoutRequest**](CreateCheckoutRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
47
+
48
+ ### Return type
49
+
50
+ [**CreateCheckoutResponse**](CreateCheckoutResponse.md)
51
+
52
+ ### Authorization
53
+
54
+ No authorization required
55
+
56
+ ### HTTP request headers
57
+
58
+ - **Content-Type**: application/json
59
+ - **Accept**: application/json
60
+
61
+
62
+
@@ -0,0 +1,261 @@
1
+ # SquareConnect::Country
2
+
3
+ ### Description
4
+
5
+ Indicates the country associated with another entity, such as a business. Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm).
6
+
7
+ ## Properties
8
+ Name | Type
9
+ ------------ | -------------
10
+ **ZZ** | string
11
+ **AD** | string
12
+ **AE** | string
13
+ **AF** | string
14
+ **AG** | string
15
+ **AI** | string
16
+ **AL** | string
17
+ **AM** | string
18
+ **AO** | string
19
+ **AQ** | string
20
+ **AR** | string
21
+ **AS** | string
22
+ **AT** | string
23
+ **AU** | string
24
+ **AW** | string
25
+ **AX** | string
26
+ **AZ** | string
27
+ **BA** | string
28
+ **BB** | string
29
+ **BD** | string
30
+ **BE** | string
31
+ **BF** | string
32
+ **BG** | string
33
+ **BH** | string
34
+ **BI** | string
35
+ **BJ** | string
36
+ **BL** | string
37
+ **BM** | string
38
+ **BN** | string
39
+ **BO** | string
40
+ **BQ** | string
41
+ **BR** | string
42
+ **BS** | string
43
+ **BT** | string
44
+ **BV** | string
45
+ **BW** | string
46
+ **BY** | string
47
+ **BZ** | string
48
+ **CA** | string
49
+ **CC** | string
50
+ **CD** | string
51
+ **CF** | string
52
+ **CG** | string
53
+ **CH** | string
54
+ **CI** | string
55
+ **CK** | string
56
+ **CL** | string
57
+ **CM** | string
58
+ **CN** | string
59
+ **CO** | string
60
+ **CR** | string
61
+ **CU** | string
62
+ **CV** | string
63
+ **CW** | string
64
+ **CX** | string
65
+ **CY** | string
66
+ **CZ** | string
67
+ **DE** | string
68
+ **DJ** | string
69
+ **DK** | string
70
+ **DM** | string
71
+ **DO** | string
72
+ **DZ** | string
73
+ **EC** | string
74
+ **EE** | string
75
+ **EG** | string
76
+ **EH** | string
77
+ **ER** | string
78
+ **ES** | string
79
+ **ET** | string
80
+ **FI** | string
81
+ **FJ** | string
82
+ **FK** | string
83
+ **FM** | string
84
+ **FO** | string
85
+ **FR** | string
86
+ **GA** | string
87
+ **GB** | string
88
+ **GD** | string
89
+ **GE** | string
90
+ **GF** | string
91
+ **GG** | string
92
+ **GH** | string
93
+ **GI** | string
94
+ **GL** | string
95
+ **GM** | string
96
+ **GN** | string
97
+ **GP** | string
98
+ **GQ** | string
99
+ **GR** | string
100
+ **GS** | string
101
+ **GT** | string
102
+ **GU** | string
103
+ **GW** | string
104
+ **GY** | string
105
+ **HK** | string
106
+ **HM** | string
107
+ **HN** | string
108
+ **HR** | string
109
+ **HT** | string
110
+ **HU** | string
111
+ **ID** | string
112
+ **IE** | string
113
+ **IL** | string
114
+ **IM** | string
115
+ **IN** | string
116
+ **IO** | string
117
+ **IQ** | string
118
+ **IR** | string
119
+ **IS** | string
120
+ **IT** | string
121
+ **JE** | string
122
+ **JM** | string
123
+ **JO** | string
124
+ **JP** | string
125
+ **KE** | string
126
+ **KG** | string
127
+ **KH** | string
128
+ **KI** | string
129
+ **KM** | string
130
+ **KN** | string
131
+ **KP** | string
132
+ **KR** | string
133
+ **KW** | string
134
+ **KY** | string
135
+ **KZ** | string
136
+ **LA** | string
137
+ **LB** | string
138
+ **LC** | string
139
+ **LI** | string
140
+ **LK** | string
141
+ **LR** | string
142
+ **LS** | string
143
+ **LT** | string
144
+ **LU** | string
145
+ **LV** | string
146
+ **LY** | string
147
+ **MA** | string
148
+ **MC** | string
149
+ **MD** | string
150
+ **ME** | string
151
+ **MF** | string
152
+ **MG** | string
153
+ **MH** | string
154
+ **MK** | string
155
+ **ML** | string
156
+ **MM** | string
157
+ **MN** | string
158
+ **MO** | string
159
+ **MP** | string
160
+ **MQ** | string
161
+ **MR** | string
162
+ **MS** | string
163
+ **MT** | string
164
+ **MU** | string
165
+ **MV** | string
166
+ **MW** | string
167
+ **MX** | string
168
+ **MY** | string
169
+ **MZ** | string
170
+ **NA** | string
171
+ **NC** | string
172
+ **NE** | string
173
+ **NF** | string
174
+ **NG** | string
175
+ **NI** | string
176
+ **NL** | string
177
+ **NO** | string
178
+ **NP** | string
179
+ **NR** | string
180
+ **NU** | string
181
+ **NZ** | string
182
+ **OM** | string
183
+ **PA** | string
184
+ **PE** | string
185
+ **PF** | string
186
+ **PG** | string
187
+ **PH** | string
188
+ **PK** | string
189
+ **PL** | string
190
+ **PM** | string
191
+ **PN** | string
192
+ **PR** | string
193
+ **PS** | string
194
+ **PT** | string
195
+ **PW** | string
196
+ **PY** | string
197
+ **QA** | string
198
+ **RE** | string
199
+ **RO** | string
200
+ **RS** | string
201
+ **RU** | string
202
+ **RW** | string
203
+ **SA** | string
204
+ **SB** | string
205
+ **SC** | string
206
+ **SD** | string
207
+ **SE** | string
208
+ **SG** | string
209
+ **SH** | string
210
+ **SI** | string
211
+ **SJ** | string
212
+ **SK** | string
213
+ **SL** | string
214
+ **SM** | string
215
+ **SN** | string
216
+ **SO** | string
217
+ **SR** | string
218
+ **SS** | string
219
+ **ST** | string
220
+ **SV** | string
221
+ **SX** | string
222
+ **SY** | string
223
+ **SZ** | string
224
+ **TC** | string
225
+ **TD** | string
226
+ **TF** | string
227
+ **TG** | string
228
+ **TH** | string
229
+ **TJ** | string
230
+ **TK** | string
231
+ **TL** | string
232
+ **TM** | string
233
+ **TN** | string
234
+ **TO** | string
235
+ **TR** | string
236
+ **TT** | string
237
+ **TV** | string
238
+ **TW** | string
239
+ **TZ** | string
240
+ **UA** | string
241
+ **UG** | string
242
+ **UM** | string
243
+ **US** | string
244
+ **UY** | string
245
+ **UZ** | string
246
+ **VA** | string
247
+ **VC** | string
248
+ **VE** | string
249
+ **VG** | string
250
+ **VI** | string
251
+ **VN** | string
252
+ **VU** | string
253
+ **WF** | string
254
+ **WS** | string
255
+ **YE** | string
256
+ **YT** | string
257
+ **ZA** | string
258
+ **ZM** | string
259
+ **ZW** | string
260
+
261
+