square.rb 17.1.0.20220120 → 19.0.0.20220420
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +35 -221
- data/lib/square/api/base_api.rb +1 -1
- data/lib/square/api/customer_groups_api.rb +7 -6
- data/lib/square/api/customer_segments_api.rb +7 -6
- data/lib/square/api/customers_api.rb +11 -8
- data/lib/square/api/locations_api.rb +3 -4
- data/lib/square/api/loyalty_api.rb +4 -3
- data/lib/square/api/merchants_api.rb +10 -8
- data/lib/square/api/orders_api.rb +2 -2
- data/lib/square/api/payouts_api.rb +173 -0
- data/lib/square/api/subscriptions_api.rb +0 -3
- data/lib/square/api/terminal_api.rb +14 -6
- data/lib/square/api/vendors_api.rb +257 -0
- data/lib/square/api_helper.rb +29 -31
- data/lib/square/client.rb +17 -5
- data/lib/square/configuration.rb +12 -13
- data/lib/square/http/faraday_client.rb +28 -20
- data/lib/square/http/http_client.rb +31 -12
- data/lib/square/http/http_request.rb +6 -2
- data/lib/square.rb +2 -0
- metadata +47 -9
@@ -28,72 +28,91 @@ module Square
|
|
28
28
|
# Get a GET HttpRequest object.
|
29
29
|
# @param [String] The URL to send the request to.
|
30
30
|
# @param [Hash, Optional] The headers for the HTTP Request.
|
31
|
+
# @param [Hash, Optional] The context for the HTTP Request.
|
31
32
|
def get(query_url,
|
32
|
-
headers: {}
|
33
|
+
headers: {},
|
34
|
+
context: {})
|
33
35
|
HttpRequest.new(HttpMethodEnum::GET,
|
34
36
|
query_url,
|
35
|
-
headers: headers
|
37
|
+
headers: headers,
|
38
|
+
context: context)
|
36
39
|
end
|
37
40
|
|
38
41
|
# Get a HEAD HttpRequest object.
|
39
42
|
# @param [String] The URL to send the request to.
|
40
43
|
# @param [Hash, Optional] The headers for the HTTP Request.
|
44
|
+
# @param [Hash, Optional] The context for the HTTP Request.
|
41
45
|
def head(query_url,
|
42
|
-
headers: {}
|
46
|
+
headers: {},
|
47
|
+
context: {})
|
43
48
|
HttpRequest.new(HttpMethodEnum::HEAD,
|
44
49
|
query_url,
|
45
|
-
headers: headers
|
50
|
+
headers: headers,
|
51
|
+
context: context)
|
46
52
|
end
|
47
53
|
|
48
54
|
# Get a POST HttpRequest object.
|
49
55
|
# @param [String] The URL to send the request to.
|
50
56
|
# @param [Hash, Optional] The headers for the HTTP Request.
|
51
57
|
# @param [Hash, Optional] The parameters for the HTTP Request.
|
58
|
+
# @param [Hash, Optional] The context for the HTTP Request.
|
52
59
|
def post(query_url,
|
53
60
|
headers: {},
|
54
|
-
parameters: {}
|
61
|
+
parameters: {},
|
62
|
+
context: {})
|
55
63
|
HttpRequest.new(HttpMethodEnum::POST,
|
56
64
|
query_url,
|
57
65
|
headers: headers,
|
58
|
-
parameters: parameters
|
66
|
+
parameters: parameters,
|
67
|
+
context: context)
|
59
68
|
end
|
60
69
|
|
61
70
|
# Get a PUT HttpRequest object.
|
62
71
|
# @param [String] The URL to send the request to.
|
63
72
|
# @param [Hash, Optional] The headers for the HTTP Request.
|
64
73
|
# @param [Hash, Optional] The parameters for the HTTP Request.
|
74
|
+
# @param [Hash, Optional] The context for the HTTP Request.
|
65
75
|
def put(query_url,
|
66
76
|
headers: {},
|
67
|
-
parameters: {}
|
77
|
+
parameters: {},
|
78
|
+
context: {})
|
68
79
|
HttpRequest.new(HttpMethodEnum::PUT,
|
69
80
|
query_url,
|
70
81
|
headers: headers,
|
71
|
-
parameters: parameters
|
82
|
+
parameters: parameters,
|
83
|
+
context: context)
|
72
84
|
end
|
73
85
|
|
74
86
|
# Get a PATCH HttpRequest object.
|
75
87
|
# @param [String] The URL to send the request to.
|
76
88
|
# @param [Hash, Optional] The headers for the HTTP Request.
|
77
89
|
# @param [Hash, Optional] The parameters for the HTTP Request.
|
90
|
+
# @param [Hash, Optional] The context for the HTTP Request.
|
78
91
|
def patch(query_url,
|
79
92
|
headers: {},
|
80
|
-
parameters: {}
|
93
|
+
parameters: {},
|
94
|
+
context: {})
|
81
95
|
HttpRequest.new(HttpMethodEnum::PATCH,
|
82
96
|
query_url,
|
83
97
|
headers: headers,
|
84
|
-
parameters: parameters
|
98
|
+
parameters: parameters,
|
99
|
+
context: context)
|
85
100
|
end
|
86
101
|
|
87
102
|
# Get a DELETE HttpRequest object.
|
88
103
|
# @param [String] The URL to send the request to.
|
89
104
|
# @param [Hash, Optional] The headers for the HTTP Request.
|
105
|
+
# @param [Hash, Optional] The parameters for the HTTP Request.
|
106
|
+
# @param [Hash, Optional] The context for the HTTP Request.
|
90
107
|
def delete(query_url,
|
91
108
|
headers: {},
|
92
|
-
parameters: {}
|
109
|
+
parameters: {},
|
110
|
+
context: {})
|
93
111
|
HttpRequest.new(HttpMethodEnum::DELETE,
|
94
112
|
query_url,
|
95
113
|
headers: headers,
|
96
|
-
parameters: parameters
|
114
|
+
parameters: parameters,
|
115
|
+
context: context)
|
97
116
|
end
|
98
117
|
end
|
99
118
|
end
|
@@ -2,21 +2,25 @@ module Square
|
|
2
2
|
# Represents a single Http Request.
|
3
3
|
class HttpRequest
|
4
4
|
attr_accessor :http_method, :query_url, :headers,
|
5
|
-
:parameters, :username, :password
|
5
|
+
:parameters, :username, :password,
|
6
|
+
:context
|
6
7
|
|
7
8
|
# The constructor.
|
8
9
|
# @param [HttpMethodEnum] The HTTP method.
|
9
10
|
# @param [String] The URL to send the request to.
|
10
11
|
# @param [Hash, Optional] The headers for the HTTP Request.
|
11
12
|
# @param [Hash, Optional] The parameters for the HTTP Request.
|
13
|
+
# @param [Hash, Optional] The context for the HTTP Request.
|
12
14
|
def initialize(http_method,
|
13
15
|
query_url,
|
14
16
|
headers: {},
|
15
|
-
parameters: {}
|
17
|
+
parameters: {},
|
18
|
+
context: {})
|
16
19
|
@http_method = http_method
|
17
20
|
@query_url = query_url
|
18
21
|
@headers = headers
|
19
22
|
@parameters = parameters
|
23
|
+
@context = context
|
20
24
|
end
|
21
25
|
|
22
26
|
# Add a header to the HttpRequest.
|
data/lib/square.rb
CHANGED
@@ -57,9 +57,11 @@ require_relative 'square/api/loyalty_api'
|
|
57
57
|
require_relative 'square/api/merchants_api'
|
58
58
|
require_relative 'square/api/orders_api'
|
59
59
|
require_relative 'square/api/payments_api'
|
60
|
+
require_relative 'square/api/payouts_api'
|
60
61
|
require_relative 'square/api/refunds_api'
|
61
62
|
require_relative 'square/api/sites_api'
|
62
63
|
require_relative 'square/api/snippets_api'
|
63
64
|
require_relative 'square/api/subscriptions_api'
|
64
65
|
require_relative 'square/api/team_api'
|
65
66
|
require_relative 'square/api/terminal_api'
|
67
|
+
require_relative 'square/api/vendors_api'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: square.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 19.0.0.20220420
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Square Developer Platform
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|
@@ -30,22 +30,58 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
34
|
-
|
33
|
+
version: '2.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: faraday-follow_redirects
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
35
46
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
47
|
+
version: '0.2'
|
37
48
|
type: :runtime
|
38
49
|
prerelease: false
|
39
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: faraday-multipart
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
40
58
|
requirements:
|
41
59
|
- - "~>"
|
42
60
|
- !ruby/object:Gem::Version
|
43
61
|
version: '1.0'
|
44
|
-
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: faraday-gzip
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.1'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
45
81
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
82
|
+
version: '0.1'
|
47
83
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
84
|
+
name: faraday-retry
|
49
85
|
requirement: !ruby/object:Gem::Requirement
|
50
86
|
requirements:
|
51
87
|
- - "~>"
|
@@ -162,6 +198,7 @@ files:
|
|
162
198
|
- lib/square/api/o_auth_api.rb
|
163
199
|
- lib/square/api/orders_api.rb
|
164
200
|
- lib/square/api/payments_api.rb
|
201
|
+
- lib/square/api/payouts_api.rb
|
165
202
|
- lib/square/api/refunds_api.rb
|
166
203
|
- lib/square/api/sites_api.rb
|
167
204
|
- lib/square/api/snippets_api.rb
|
@@ -170,6 +207,7 @@ files:
|
|
170
207
|
- lib/square/api/terminal_api.rb
|
171
208
|
- lib/square/api/transactions_api.rb
|
172
209
|
- lib/square/api/v1_transactions_api.rb
|
210
|
+
- lib/square/api/vendors_api.rb
|
173
211
|
- lib/square/api_helper.rb
|
174
212
|
- lib/square/client.rb
|
175
213
|
- lib/square/configuration.rb
|
@@ -208,7 +246,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
208
246
|
requirements:
|
209
247
|
- - ">="
|
210
248
|
- !ruby/object:Gem::Version
|
211
|
-
version: '2.
|
249
|
+
version: '2.6'
|
212
250
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
251
|
requirements:
|
214
252
|
- - ">="
|