square_connect 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES.md +5 -0
  3. data/CONTRIBUTING.md +5 -0
  4. data/LICENSE.txt +202 -0
  5. data/README.md +47 -0
  6. data/lib/square_connect.rb +88 -0
  7. data/lib/square_connect/api/customer_api.rb +354 -0
  8. data/lib/square_connect/api/customer_card_api.rb +163 -0
  9. data/lib/square_connect/api/location_api.rb +82 -0
  10. data/lib/square_connect/api/refund_api.rb +179 -0
  11. data/lib/square_connect/api/transaction_api.rb +387 -0
  12. data/lib/square_connect/api_client.rb +337 -0
  13. data/lib/square_connect/api_error.rb +31 -0
  14. data/lib/square_connect/configuration.rb +163 -0
  15. data/lib/square_connect/models/address.rb +288 -0
  16. data/lib/square_connect/models/capture_transaction_response.rb +160 -0
  17. data/lib/square_connect/models/card.rb +233 -0
  18. data/lib/square_connect/models/card_brand.rb +147 -0
  19. data/lib/square_connect/models/charge_request.rb +257 -0
  20. data/lib/square_connect/models/charge_response.rb +171 -0
  21. data/lib/square_connect/models/country.rb +147 -0
  22. data/lib/square_connect/models/create_customer_card_request.rb +180 -0
  23. data/lib/square_connect/models/create_customer_card_response.rb +171 -0
  24. data/lib/square_connect/models/create_customer_request.rb +246 -0
  25. data/lib/square_connect/models/create_customer_response.rb +171 -0
  26. data/lib/square_connect/models/create_refund_request.rb +191 -0
  27. data/lib/square_connect/models/create_refund_response.rb +171 -0
  28. data/lib/square_connect/models/currency.rb +147 -0
  29. data/lib/square_connect/models/customer.rb +292 -0
  30. data/lib/square_connect/models/delete_customer_card_response.rb +160 -0
  31. data/lib/square_connect/models/delete_customer_response.rb +160 -0
  32. data/lib/square_connect/models/error.rb +209 -0
  33. data/lib/square_connect/models/error_category.rb +147 -0
  34. data/lib/square_connect/models/error_code.rb +147 -0
  35. data/lib/square_connect/models/list_customers_request.rb +158 -0
  36. data/lib/square_connect/models/list_customers_response.rb +184 -0
  37. data/lib/square_connect/models/list_locations_response.rb +173 -0
  38. data/lib/square_connect/models/list_refunds_request.rb +200 -0
  39. data/lib/square_connect/models/list_refunds_response.rb +184 -0
  40. data/lib/square_connect/models/list_transactions_request.rb +200 -0
  41. data/lib/square_connect/models/list_transactions_response.rb +184 -0
  42. data/lib/square_connect/models/location.rb +204 -0
  43. data/lib/square_connect/models/location_capability.rb +147 -0
  44. data/lib/square_connect/models/money.rb +178 -0
  45. data/lib/square_connect/models/refund.rb +255 -0
  46. data/lib/square_connect/models/refund_status.rb +147 -0
  47. data/lib/square_connect/models/retrieve_customer_response.rb +171 -0
  48. data/lib/square_connect/models/retrieve_transaction_response.rb +171 -0
  49. data/lib/square_connect/models/sort_order.rb +147 -0
  50. data/lib/square_connect/models/tender.rb +277 -0
  51. data/lib/square_connect/models/tender_card_details.rb +198 -0
  52. data/lib/square_connect/models/tender_card_details_entry_method.rb +147 -0
  53. data/lib/square_connect/models/tender_card_details_status.rb +147 -0
  54. data/lib/square_connect/models/tender_cash_details.rb +169 -0
  55. data/lib/square_connect/models/tender_type.rb +147 -0
  56. data/lib/square_connect/models/transaction.rb +237 -0
  57. data/lib/square_connect/models/transaction_product.rb +147 -0
  58. data/lib/square_connect/models/update_customer_request.rb +246 -0
  59. data/lib/square_connect/models/update_customer_response.rb +171 -0
  60. data/lib/square_connect/models/void_transaction_response.rb +160 -0
  61. data/lib/square_connect/version.rb +13 -0
  62. data/square_connect.gemspec +32 -0
  63. metadata +286 -0
@@ -0,0 +1,160 @@
1
+ =begin
2
+ Square Connect API
3
+
4
+ OpenAPI spec version: 2.0
5
+
6
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
7
+
8
+
9
+ =end
10
+
11
+ require 'date'
12
+
13
+ module SquareConnect
14
+ # Defines the fields that are included in the response body of\na request to the **CaptureTransaction** endpoint.
15
+ class VoidTransactionResponse
16
+ # Any errors that occurred during the request.
17
+ attr_accessor :errors
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+
23
+ :'errors' => :'errors'
24
+
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'errors' => :'Array<Error>'
32
+
33
+ }
34
+ end
35
+
36
+ def initialize(attributes = {})
37
+ return unless attributes.is_a?(Hash)
38
+
39
+ # convert string to symbol for hash key
40
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
41
+
42
+
43
+ if attributes[:'errors']
44
+ if (value = attributes[:'errors']).is_a?(Array)
45
+ self.errors = value
46
+ end
47
+ end
48
+
49
+ end
50
+
51
+ # Check equality by comparing each attribute.
52
+ def ==(o)
53
+ return true if self.equal?(o)
54
+ self.class == o.class &&
55
+ errors == o.errors
56
+ end
57
+
58
+ # @see the `==` method
59
+ def eql?(o)
60
+ self == o
61
+ end
62
+
63
+ # Calculate hash code according to all attributes.
64
+ def hash
65
+ [errors].hash
66
+ end
67
+
68
+ # build the object from hash
69
+ def build_from_hash(attributes)
70
+ return nil unless attributes.is_a?(Hash)
71
+ self.class.swagger_types.each_pair do |key, type|
72
+ if type =~ /^Array<(.*)>/i
73
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
74
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
75
+ else
76
+ #TODO show warning in debug mode
77
+ end
78
+ elsif !attributes[self.class.attribute_map[key]].nil?
79
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
80
+ else
81
+ # data not found in attributes(hash), not an issue as the data can be optional
82
+ end
83
+ end
84
+
85
+ self
86
+ end
87
+
88
+ def _deserialize(type, value)
89
+ case type.to_sym
90
+ when :DateTime
91
+ DateTime.parse(value)
92
+ when :Date
93
+ Date.parse(value)
94
+ when :String
95
+ value.to_s
96
+ when :Integer
97
+ value.to_i
98
+ when :Float
99
+ value.to_f
100
+ when :BOOLEAN
101
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
102
+ true
103
+ else
104
+ false
105
+ end
106
+ when /\AArray<(?<inner_type>.+)>\z/
107
+ inner_type = Regexp.last_match[:inner_type]
108
+ value.map { |v| _deserialize(inner_type, v) }
109
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
110
+ k_type = Regexp.last_match[:k_type]
111
+ v_type = Regexp.last_match[:v_type]
112
+ {}.tap do |hash|
113
+ value.each do |k, v|
114
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
115
+ end
116
+ end
117
+ else # model
118
+ _model = SquareConnect.const_get(type).new
119
+ _model.build_from_hash(value)
120
+ end
121
+ end
122
+
123
+ def to_s
124
+ to_hash.to_s
125
+ end
126
+
127
+ # to_body is an alias to to_body (backward compatibility))
128
+ def to_body
129
+ to_hash
130
+ end
131
+
132
+ # return the object in the form of hash
133
+ def to_hash
134
+ hash = {}
135
+ self.class.attribute_map.each_pair do |attr, param|
136
+ value = self.send(attr)
137
+ next if value.nil?
138
+ hash[param] = _to_hash(value)
139
+ end
140
+ hash
141
+ end
142
+
143
+ # Method to output non-array value in the form of hash
144
+ # For object, use to_hash. Otherwise, just return the value
145
+ def _to_hash(value)
146
+ if value.is_a?(Array)
147
+ value.compact.map{ |v| _to_hash(v) }
148
+ elsif value.is_a?(Hash)
149
+ {}.tap do |hash|
150
+ value.each { |k, v| hash[k] = _to_hash(v) }
151
+ end
152
+ elsif value.respond_to? :to_hash
153
+ value.to_hash
154
+ else
155
+ value
156
+ end
157
+ end
158
+
159
+ end
160
+ end
@@ -0,0 +1,13 @@
1
+ =begin
2
+ Square Connect API
3
+
4
+ OpenAPI spec version: 2.0
5
+
6
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
7
+
8
+
9
+ =end
10
+
11
+ module SquareConnect
12
+ VERSION = "2.0.0"
13
+ end
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "square_connect/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "square_connect"
7
+ s.version = SquareConnect::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Square, Inc."]
10
+ s.email = ["developers@squareup.com"]
11
+ s.homepage = "https://github.com/Square/connect-ruby-sdk"
12
+ s.summary = "Client library for the Square Connect v2 API"
13
+ s.description = "Ruby client library for the Square Connect v2 API"
14
+ s.license = "Apache-2.0"
15
+
16
+
17
+ s.add_runtime_dependency 'typhoeus', '~> 0.2', '>= 0.2.1'
18
+ s.add_runtime_dependency 'json', '~> 1.4', '>= 1.4.6'
19
+
20
+ s.add_development_dependency 'rspec', '~> 3.2', '>= 3.2.0'
21
+ s.add_development_dependency 'vcr', '~> 2.9', '>= 2.9.3'
22
+ s.add_development_dependency 'webmock', '~> 1.6', '>= 1.6.2'
23
+ s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
24
+ s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
25
+ s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
26
+ s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.11'
27
+
28
+ s.files = `find *`.split("\n").uniq.sort.select{|f| !f.empty? }
29
+ s.test_files = `find spec/*`.split("\n")
30
+ s.executables = []
31
+ s.require_paths = ["lib"]
32
+ end
metadata ADDED
@@ -0,0 +1,286 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: square_connect
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Square, Inc.
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: typhoeus
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.2'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.2.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '0.2'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.2.1
33
+ - !ruby/object:Gem::Dependency
34
+ name: json
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.4'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.4.6
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.4'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 1.4.6
53
+ - !ruby/object:Gem::Dependency
54
+ name: rspec
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '3.2'
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 3.2.0
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '3.2'
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 3.2.0
73
+ - !ruby/object:Gem::Dependency
74
+ name: vcr
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '2.9'
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 2.9.3
83
+ type: :development
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.9'
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 2.9.3
93
+ - !ruby/object:Gem::Dependency
94
+ name: webmock
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '1.6'
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 1.6.2
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '1.6'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 1.6.2
113
+ - !ruby/object:Gem::Dependency
114
+ name: autotest
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - "~>"
118
+ - !ruby/object:Gem::Version
119
+ version: '4.4'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 4.4.6
123
+ type: :development
124
+ prerelease: false
125
+ version_requirements: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: '4.4'
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 4.4.6
133
+ - !ruby/object:Gem::Dependency
134
+ name: autotest-rails-pure
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: '4.1'
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: 4.1.2
143
+ type: :development
144
+ prerelease: false
145
+ version_requirements: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '4.1'
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: 4.1.2
153
+ - !ruby/object:Gem::Dependency
154
+ name: autotest-growl
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '0.2'
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: 0.2.16
163
+ type: :development
164
+ prerelease: false
165
+ version_requirements: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - "~>"
168
+ - !ruby/object:Gem::Version
169
+ version: '0.2'
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: 0.2.16
173
+ - !ruby/object:Gem::Dependency
174
+ name: autotest-fsevent
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '0.2'
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: 0.2.11
183
+ type: :development
184
+ prerelease: false
185
+ version_requirements: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - "~>"
188
+ - !ruby/object:Gem::Version
189
+ version: '0.2'
190
+ - - ">="
191
+ - !ruby/object:Gem::Version
192
+ version: 0.2.11
193
+ description: Ruby client library for the Square Connect v2 API
194
+ email:
195
+ - developers@squareup.com
196
+ executables: []
197
+ extensions: []
198
+ extra_rdoc_files: []
199
+ files:
200
+ - CHANGES.md
201
+ - CONTRIBUTING.md
202
+ - LICENSE.txt
203
+ - README.md
204
+ - lib/square_connect.rb
205
+ - lib/square_connect/api/customer_api.rb
206
+ - lib/square_connect/api/customer_card_api.rb
207
+ - lib/square_connect/api/location_api.rb
208
+ - lib/square_connect/api/refund_api.rb
209
+ - lib/square_connect/api/transaction_api.rb
210
+ - lib/square_connect/api_client.rb
211
+ - lib/square_connect/api_error.rb
212
+ - lib/square_connect/configuration.rb
213
+ - lib/square_connect/models/address.rb
214
+ - lib/square_connect/models/capture_transaction_response.rb
215
+ - lib/square_connect/models/card.rb
216
+ - lib/square_connect/models/card_brand.rb
217
+ - lib/square_connect/models/charge_request.rb
218
+ - lib/square_connect/models/charge_response.rb
219
+ - lib/square_connect/models/country.rb
220
+ - lib/square_connect/models/create_customer_card_request.rb
221
+ - lib/square_connect/models/create_customer_card_response.rb
222
+ - lib/square_connect/models/create_customer_request.rb
223
+ - lib/square_connect/models/create_customer_response.rb
224
+ - lib/square_connect/models/create_refund_request.rb
225
+ - lib/square_connect/models/create_refund_response.rb
226
+ - lib/square_connect/models/currency.rb
227
+ - lib/square_connect/models/customer.rb
228
+ - lib/square_connect/models/delete_customer_card_response.rb
229
+ - lib/square_connect/models/delete_customer_response.rb
230
+ - lib/square_connect/models/error.rb
231
+ - lib/square_connect/models/error_category.rb
232
+ - lib/square_connect/models/error_code.rb
233
+ - lib/square_connect/models/list_customers_request.rb
234
+ - lib/square_connect/models/list_customers_response.rb
235
+ - lib/square_connect/models/list_locations_response.rb
236
+ - lib/square_connect/models/list_refunds_request.rb
237
+ - lib/square_connect/models/list_refunds_response.rb
238
+ - lib/square_connect/models/list_transactions_request.rb
239
+ - lib/square_connect/models/list_transactions_response.rb
240
+ - lib/square_connect/models/location.rb
241
+ - lib/square_connect/models/location_capability.rb
242
+ - lib/square_connect/models/money.rb
243
+ - lib/square_connect/models/refund.rb
244
+ - lib/square_connect/models/refund_status.rb
245
+ - lib/square_connect/models/retrieve_customer_response.rb
246
+ - lib/square_connect/models/retrieve_transaction_response.rb
247
+ - lib/square_connect/models/sort_order.rb
248
+ - lib/square_connect/models/tender.rb
249
+ - lib/square_connect/models/tender_card_details.rb
250
+ - lib/square_connect/models/tender_card_details_entry_method.rb
251
+ - lib/square_connect/models/tender_card_details_status.rb
252
+ - lib/square_connect/models/tender_cash_details.rb
253
+ - lib/square_connect/models/tender_type.rb
254
+ - lib/square_connect/models/transaction.rb
255
+ - lib/square_connect/models/transaction_product.rb
256
+ - lib/square_connect/models/update_customer_request.rb
257
+ - lib/square_connect/models/update_customer_response.rb
258
+ - lib/square_connect/models/void_transaction_response.rb
259
+ - lib/square_connect/version.rb
260
+ - square_connect.gemspec
261
+ homepage: https://github.com/Square/connect-ruby-sdk
262
+ licenses:
263
+ - Apache-2.0
264
+ metadata: {}
265
+ post_install_message:
266
+ rdoc_options: []
267
+ require_paths:
268
+ - lib
269
+ required_ruby_version: !ruby/object:Gem::Requirement
270
+ requirements:
271
+ - - ">="
272
+ - !ruby/object:Gem::Version
273
+ version: '0'
274
+ required_rubygems_version: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - ">="
277
+ - !ruby/object:Gem::Version
278
+ version: '0'
279
+ requirements: []
280
+ rubyforge_project:
281
+ rubygems_version: 2.4.5.1
282
+ signing_key:
283
+ specification_version: 4
284
+ summary: Client library for the Square Connect v2 API
285
+ test_files: []
286
+ has_rdoc: