square.rb 38.1.0.20240604 → 38.1.1.20240717
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/square/api/apple_pay_api.rb +14 -10
- data/lib/square/api/bank_accounts_api.rb +9 -9
- data/lib/square/api/base_api.rb +1 -1
- data/lib/square/api/booking_custom_attributes_api.rb +33 -33
- data/lib/square/api/bookings_api.rb +39 -39
- data/lib/square/api/cards_api.rb +12 -12
- data/lib/square/api/cash_drawers_api.rb +9 -9
- data/lib/square/api/catalog_api.rb +42 -42
- data/lib/square/api/checkout_api.rb +30 -30
- data/lib/square/api/customer_custom_attributes_api.rb +30 -30
- data/lib/square/api/customer_groups_api.rb +15 -15
- data/lib/square/api/customer_segments_api.rb +6 -6
- data/lib/square/api/customers_api.rb +42 -42
- data/lib/square/api/devices_api.rb +15 -15
- data/lib/square/api/disputes_api.rb +27 -27
- data/lib/square/api/employees_api.rb +6 -6
- data/lib/square/api/events_api.rb +12 -12
- data/lib/square/api/gift_card_activities_api.rb +6 -6
- data/lib/square/api/gift_cards_api.rb +21 -21
- data/lib/square/api/inventory_api.rb +39 -39
- data/lib/square/api/invoices_api.rb +37 -38
- data/lib/square/api/labor_api.rb +48 -48
- data/lib/square/api/location_custom_attributes_api.rb +33 -33
- data/lib/square/api/locations_api.rb +12 -12
- data/lib/square/api/loyalty_api.rb +54 -54
- data/lib/square/api/merchant_custom_attributes_api.rb +33 -33
- data/lib/square/api/merchants_api.rb +6 -6
- data/lib/square/api/mobile_authorization_api.rb +3 -3
- data/lib/square/api/o_auth_api.rb +9 -9
- data/lib/square/api/order_custom_attributes_api.rb +33 -33
- data/lib/square/api/orders_api.rb +24 -24
- data/lib/square/api/payments_api.rb +21 -21
- data/lib/square/api/payouts_api.rb +9 -9
- data/lib/square/api/refunds_api.rb +9 -9
- data/lib/square/api/sites_api.rb +3 -3
- data/lib/square/api/snippets_api.rb +9 -9
- data/lib/square/api/subscriptions_api.rb +36 -36
- data/lib/square/api/team_api.rb +24 -24
- data/lib/square/api/terminal_api.rb +45 -45
- data/lib/square/api/transactions_api.rb +12 -12
- data/lib/square/api/v1_transactions_api.rb +10 -10
- data/lib/square/api/vendors_api.rb +21 -21
- data/lib/square/api/webhook_subscriptions_api.rb +24 -24
- data/lib/square/client.rb +2 -2
- data/lib/square/configuration.rb +1 -1
- data/test/webhooks/test_webhooks_helper.rb +17 -0
- metadata +8 -8
@@ -17,9 +17,9 @@ module Square
|
|
17
17
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
18
18
|
.auth(Single.new('global')))
|
19
19
|
.response(new_response_handler
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
21
|
+
.is_api_response(true)
|
22
|
+
.convertor(ApiResponse.method(:create)))
|
23
23
|
.execute
|
24
24
|
end
|
25
25
|
|
@@ -41,9 +41,9 @@ module Square
|
|
41
41
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
42
42
|
.auth(Single.new('global')))
|
43
43
|
.response(new_response_handler
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
45
|
+
.is_api_response(true)
|
46
|
+
.convertor(ApiResponse.method(:create)))
|
47
47
|
.execute
|
48
48
|
end
|
49
49
|
|
@@ -62,9 +62,9 @@ module Square
|
|
62
62
|
.header_param(new_parameter('application/json', key: 'accept'))
|
63
63
|
.auth(Single.new('global')))
|
64
64
|
.response(new_response_handler
|
65
|
-
|
66
|
-
|
67
|
-
|
65
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
66
|
+
.is_api_response(true)
|
67
|
+
.convertor(ApiResponse.method(:create)))
|
68
68
|
.execute
|
69
69
|
end
|
70
70
|
|
@@ -82,9 +82,9 @@ module Square
|
|
82
82
|
.header_param(new_parameter('application/json', key: 'accept'))
|
83
83
|
.auth(Single.new('global')))
|
84
84
|
.response(new_response_handler
|
85
|
-
|
86
|
-
|
87
|
-
|
85
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
86
|
+
.is_api_response(true)
|
87
|
+
.convertor(ApiResponse.method(:create)))
|
88
88
|
.execute
|
89
89
|
end
|
90
90
|
|
@@ -106,9 +106,9 @@ module Square
|
|
106
106
|
.header_param(new_parameter('application/json', key: 'accept'))
|
107
107
|
.auth(Single.new('global')))
|
108
108
|
.response(new_response_handler
|
109
|
-
|
110
|
-
|
111
|
-
|
109
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
110
|
+
.is_api_response(true)
|
111
|
+
.convertor(ApiResponse.method(:create)))
|
112
112
|
.execute
|
113
113
|
end
|
114
114
|
|
@@ -130,9 +130,9 @@ module Square
|
|
130
130
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
131
131
|
.auth(Single.new('global')))
|
132
132
|
.response(new_response_handler
|
133
|
-
|
134
|
-
|
135
|
-
|
133
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
134
|
+
.is_api_response(true)
|
135
|
+
.convertor(ApiResponse.method(:create)))
|
136
136
|
.execute
|
137
137
|
end
|
138
138
|
|
@@ -155,9 +155,9 @@ module Square
|
|
155
155
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
156
156
|
.auth(Single.new('global')))
|
157
157
|
.response(new_response_handler
|
158
|
-
|
159
|
-
|
160
|
-
|
158
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
159
|
+
.is_api_response(true)
|
160
|
+
.convertor(ApiResponse.method(:create)))
|
161
161
|
.execute
|
162
162
|
end
|
163
163
|
|
@@ -176,9 +176,9 @@ module Square
|
|
176
176
|
.header_param(new_parameter('application/json', key: 'accept'))
|
177
177
|
.auth(Single.new('global')))
|
178
178
|
.response(new_response_handler
|
179
|
-
|
180
|
-
|
181
|
-
|
179
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
180
|
+
.is_api_response(true)
|
181
|
+
.convertor(ApiResponse.method(:create)))
|
182
182
|
.execute
|
183
183
|
end
|
184
184
|
|
@@ -197,9 +197,9 @@ module Square
|
|
197
197
|
.header_param(new_parameter('application/json', key: 'accept'))
|
198
198
|
.auth(Single.new('global')))
|
199
199
|
.response(new_response_handler
|
200
|
-
|
201
|
-
|
202
|
-
|
200
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
201
|
+
.is_api_response(true)
|
202
|
+
.convertor(ApiResponse.method(:create)))
|
203
203
|
.execute
|
204
204
|
end
|
205
205
|
|
@@ -218,9 +218,9 @@ module Square
|
|
218
218
|
.header_param(new_parameter('application/json', key: 'accept'))
|
219
219
|
.auth(Single.new('global')))
|
220
220
|
.response(new_response_handler
|
221
|
-
|
222
|
-
|
223
|
-
|
221
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
222
|
+
.is_api_response(true)
|
223
|
+
.convertor(ApiResponse.method(:create)))
|
224
224
|
.execute
|
225
225
|
end
|
226
226
|
|
@@ -244,9 +244,9 @@ module Square
|
|
244
244
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
245
245
|
.auth(Single.new('global')))
|
246
246
|
.response(new_response_handler
|
247
|
-
|
248
|
-
|
249
|
-
|
247
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
248
|
+
.is_api_response(true)
|
249
|
+
.convertor(ApiResponse.method(:create)))
|
250
250
|
.execute
|
251
251
|
end
|
252
252
|
|
@@ -268,9 +268,9 @@ module Square
|
|
268
268
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
269
269
|
.auth(Single.new('global')))
|
270
270
|
.response(new_response_handler
|
271
|
-
|
272
|
-
|
273
|
-
|
271
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
272
|
+
.is_api_response(true)
|
273
|
+
.convertor(ApiResponse.method(:create)))
|
274
274
|
.execute
|
275
275
|
end
|
276
276
|
|
@@ -289,9 +289,9 @@ module Square
|
|
289
289
|
.header_param(new_parameter('application/json', key: 'accept'))
|
290
290
|
.auth(Single.new('global')))
|
291
291
|
.response(new_response_handler
|
292
|
-
|
293
|
-
|
294
|
-
|
292
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
293
|
+
.is_api_response(true)
|
294
|
+
.convertor(ApiResponse.method(:create)))
|
295
295
|
.execute
|
296
296
|
end
|
297
297
|
|
@@ -310,9 +310,9 @@ module Square
|
|
310
310
|
.header_param(new_parameter('application/json', key: 'accept'))
|
311
311
|
.auth(Single.new('global')))
|
312
312
|
.response(new_response_handler
|
313
|
-
|
314
|
-
|
315
|
-
|
313
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
314
|
+
.is_api_response(true)
|
315
|
+
.convertor(ApiResponse.method(:create)))
|
316
316
|
.execute
|
317
317
|
end
|
318
318
|
|
@@ -331,9 +331,9 @@ module Square
|
|
331
331
|
.header_param(new_parameter('application/json', key: 'accept'))
|
332
332
|
.auth(Single.new('global')))
|
333
333
|
.response(new_response_handler
|
334
|
-
|
335
|
-
|
336
|
-
|
334
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
335
|
+
.is_api_response(true)
|
336
|
+
.convertor(ApiResponse.method(:create)))
|
337
337
|
.execute
|
338
338
|
end
|
339
339
|
end
|
@@ -48,9 +48,9 @@ module Square
|
|
48
48
|
.header_param(new_parameter('application/json', key: 'accept'))
|
49
49
|
.auth(Single.new('global')))
|
50
50
|
.response(new_response_handler
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
52
|
+
.is_api_response(true)
|
53
|
+
.convertor(ApiResponse.method(:create)))
|
54
54
|
.execute
|
55
55
|
end
|
56
56
|
|
@@ -74,9 +74,9 @@ module Square
|
|
74
74
|
.header_param(new_parameter('application/json', key: 'accept'))
|
75
75
|
.auth(Single.new('global')))
|
76
76
|
.response(new_response_handler
|
77
|
-
|
78
|
-
|
79
|
-
|
77
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
78
|
+
.is_api_response(true)
|
79
|
+
.convertor(ApiResponse.method(:create)))
|
80
80
|
.execute
|
81
81
|
end
|
82
82
|
|
@@ -104,9 +104,9 @@ module Square
|
|
104
104
|
.header_param(new_parameter('application/json', key: 'accept'))
|
105
105
|
.auth(Single.new('global')))
|
106
106
|
.response(new_response_handler
|
107
|
-
|
108
|
-
|
109
|
-
|
107
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
108
|
+
.is_api_response(true)
|
109
|
+
.convertor(ApiResponse.method(:create)))
|
110
110
|
.execute
|
111
111
|
end
|
112
112
|
|
@@ -134,9 +134,9 @@ module Square
|
|
134
134
|
.header_param(new_parameter('application/json', key: 'accept'))
|
135
135
|
.auth(Single.new('global')))
|
136
136
|
.response(new_response_handler
|
137
|
-
|
138
|
-
|
139
|
-
|
137
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
138
|
+
.is_api_response(true)
|
139
|
+
.convertor(ApiResponse.method(:create)))
|
140
140
|
.execute
|
141
141
|
end
|
142
142
|
end
|
@@ -29,10 +29,10 @@ module Square
|
|
29
29
|
.header_param(new_parameter('application/json', key: 'accept'))
|
30
30
|
.auth(Single.new('global')))
|
31
31
|
.response(new_response_handler
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
33
|
+
.is_api_response(true)
|
34
|
+
.convertor(ApiResponse.method(:create))
|
35
|
+
.is_response_array(true))
|
36
36
|
.execute
|
37
37
|
end
|
38
38
|
|
@@ -58,9 +58,9 @@ module Square
|
|
58
58
|
.header_param(new_parameter('application/json', key: 'accept'))
|
59
59
|
.auth(Single.new('global')))
|
60
60
|
.response(new_response_handler
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
62
|
+
.is_api_response(true)
|
63
|
+
.convertor(ApiResponse.method(:create)))
|
64
64
|
.execute
|
65
65
|
end
|
66
66
|
|
@@ -93,9 +93,9 @@ module Square
|
|
93
93
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
94
94
|
.auth(Single.new('global')))
|
95
95
|
.response(new_response_handler
|
96
|
-
|
97
|
-
|
98
|
-
|
96
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
97
|
+
.is_api_response(true)
|
98
|
+
.convertor(ApiResponse.method(:create)))
|
99
99
|
.execute
|
100
100
|
end
|
101
101
|
end
|
@@ -18,9 +18,9 @@ module Square
|
|
18
18
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
19
19
|
.auth(Single.new('global')))
|
20
20
|
.response(new_response_handler
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
22
|
+
.is_api_response(true)
|
23
|
+
.convertor(ApiResponse.method(:create)))
|
24
24
|
.execute
|
25
25
|
end
|
26
26
|
|
@@ -40,9 +40,9 @@ module Square
|
|
40
40
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
41
41
|
.auth(Single.new('global')))
|
42
42
|
.response(new_response_handler
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
44
|
+
.is_api_response(true)
|
45
|
+
.convertor(ApiResponse.method(:create)))
|
46
46
|
.execute
|
47
47
|
end
|
48
48
|
|
@@ -63,9 +63,9 @@ module Square
|
|
63
63
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
64
64
|
.auth(Single.new('global')))
|
65
65
|
.response(new_response_handler
|
66
|
-
|
67
|
-
|
68
|
-
|
66
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
67
|
+
.is_api_response(true)
|
68
|
+
.convertor(ApiResponse.method(:create)))
|
69
69
|
.execute
|
70
70
|
end
|
71
71
|
|
@@ -86,9 +86,9 @@ module Square
|
|
86
86
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
87
87
|
.auth(Single.new('global')))
|
88
88
|
.response(new_response_handler
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
90
|
+
.is_api_response(true)
|
91
|
+
.convertor(ApiResponse.method(:create)))
|
92
92
|
.execute
|
93
93
|
end
|
94
94
|
|
@@ -109,9 +109,9 @@ module Square
|
|
109
109
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
110
110
|
.auth(Single.new('global')))
|
111
111
|
.response(new_response_handler
|
112
|
-
|
113
|
-
|
114
|
-
|
112
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
113
|
+
.is_api_response(true)
|
114
|
+
.convertor(ApiResponse.method(:create)))
|
115
115
|
.execute
|
116
116
|
end
|
117
117
|
|
@@ -129,9 +129,9 @@ module Square
|
|
129
129
|
.header_param(new_parameter('application/json', key: 'accept'))
|
130
130
|
.auth(Single.new('global')))
|
131
131
|
.response(new_response_handler
|
132
|
-
|
133
|
-
|
134
|
-
|
132
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
133
|
+
.is_api_response(true)
|
134
|
+
.convertor(ApiResponse.method(:create)))
|
135
135
|
.execute
|
136
136
|
end
|
137
137
|
|
@@ -155,9 +155,9 @@ module Square
|
|
155
155
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
156
156
|
.auth(Single.new('global')))
|
157
157
|
.response(new_response_handler
|
158
|
-
|
159
|
-
|
160
|
-
|
158
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
159
|
+
.is_api_response(true)
|
160
|
+
.convertor(ApiResponse.method(:create)))
|
161
161
|
.execute
|
162
162
|
end
|
163
163
|
end
|
@@ -15,9 +15,9 @@ module Square
|
|
15
15
|
.header_param(new_parameter('application/json', key: 'accept'))
|
16
16
|
.auth(Single.new('global')))
|
17
17
|
.response(new_response_handler
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
19
|
+
.is_api_response(true)
|
20
|
+
.convertor(ApiResponse.method(:create)))
|
21
21
|
.execute
|
22
22
|
end
|
23
23
|
|
@@ -53,9 +53,9 @@ module Square
|
|
53
53
|
.header_param(new_parameter('application/json', key: 'accept'))
|
54
54
|
.auth(Single.new('global')))
|
55
55
|
.response(new_response_handler
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
57
|
+
.is_api_response(true)
|
58
|
+
.convertor(ApiResponse.method(:create)))
|
59
59
|
.execute
|
60
60
|
end
|
61
61
|
|
@@ -75,9 +75,9 @@ module Square
|
|
75
75
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
76
76
|
.auth(Single.new('global')))
|
77
77
|
.response(new_response_handler
|
78
|
-
|
79
|
-
|
80
|
-
|
78
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
79
|
+
.is_api_response(true)
|
80
|
+
.convertor(ApiResponse.method(:create)))
|
81
81
|
.execute
|
82
82
|
end
|
83
83
|
|
@@ -95,9 +95,9 @@ module Square
|
|
95
95
|
.header_param(new_parameter('application/json', key: 'accept'))
|
96
96
|
.auth(Single.new('global')))
|
97
97
|
.response(new_response_handler
|
98
|
-
|
99
|
-
|
100
|
-
|
98
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
99
|
+
.is_api_response(true)
|
100
|
+
.convertor(ApiResponse.method(:create)))
|
101
101
|
.execute
|
102
102
|
end
|
103
103
|
|
@@ -115,9 +115,9 @@ module Square
|
|
115
115
|
.header_param(new_parameter('application/json', key: 'accept'))
|
116
116
|
.auth(Single.new('global')))
|
117
117
|
.response(new_response_handler
|
118
|
-
|
119
|
-
|
120
|
-
|
118
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
119
|
+
.is_api_response(true)
|
120
|
+
.convertor(ApiResponse.method(:create)))
|
121
121
|
.execute
|
122
122
|
end
|
123
123
|
|
@@ -142,9 +142,9 @@ module Square
|
|
142
142
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
143
143
|
.auth(Single.new('global')))
|
144
144
|
.response(new_response_handler
|
145
|
-
|
146
|
-
|
147
|
-
|
145
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
146
|
+
.is_api_response(true)
|
147
|
+
.convertor(ApiResponse.method(:create)))
|
148
148
|
.execute
|
149
149
|
end
|
150
150
|
|
@@ -170,9 +170,9 @@ module Square
|
|
170
170
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
171
171
|
.auth(Single.new('global')))
|
172
172
|
.response(new_response_handler
|
173
|
-
|
174
|
-
|
175
|
-
|
173
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
174
|
+
.is_api_response(true)
|
175
|
+
.convertor(ApiResponse.method(:create)))
|
176
176
|
.execute
|
177
177
|
end
|
178
178
|
|
@@ -198,9 +198,9 @@ module Square
|
|
198
198
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
199
199
|
.auth(Single.new('global')))
|
200
200
|
.response(new_response_handler
|
201
|
-
|
202
|
-
|
203
|
-
|
201
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
202
|
+
.is_api_response(true)
|
203
|
+
.convertor(ApiResponse.method(:create)))
|
204
204
|
.execute
|
205
205
|
end
|
206
206
|
end
|
data/lib/square/client.rb
CHANGED
@@ -5,7 +5,7 @@ module Square
|
|
5
5
|
attr_reader :config, :auth_managers
|
6
6
|
|
7
7
|
def sdk_version
|
8
|
-
'38.1.
|
8
|
+
'38.1.1.20240717'
|
9
9
|
end
|
10
10
|
|
11
11
|
def square_version
|
@@ -274,7 +274,7 @@ module Square
|
|
274
274
|
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
275
275
|
retry_methods: %i[get put], http_callback: nil, environment: 'production',
|
276
276
|
custom_url: 'https://connect.squareup.com', access_token: nil,
|
277
|
-
bearer_auth_credentials: nil, square_version: '2024-
|
277
|
+
bearer_auth_credentials: nil, square_version: '2024-07-17',
|
278
278
|
user_agent_detail: '', additional_headers: {}, config: nil
|
279
279
|
)
|
280
280
|
@config = if config.nil?
|
data/lib/square/configuration.rb
CHANGED
@@ -24,7 +24,7 @@ module Square
|
|
24
24
|
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
25
25
|
retry_methods: %i[get put], http_callback: nil, environment: 'production',
|
26
26
|
custom_url: 'https://connect.squareup.com', access_token: nil,
|
27
|
-
bearer_auth_credentials: nil, square_version: '2024-
|
27
|
+
bearer_auth_credentials: nil, square_version: '2024-07-17',
|
28
28
|
user_agent_detail: '', additional_headers: {}
|
29
29
|
)
|
30
30
|
|
@@ -27,6 +27,23 @@ class WebhooksHelperTest < Minitest::Test
|
|
27
27
|
assert_equal true, is_valid
|
28
28
|
end
|
29
29
|
|
30
|
+
def test_signature_validation_escaped_pass
|
31
|
+
@logger.info('Running test_signature_validation_pass') # Log a message
|
32
|
+
|
33
|
+
escpaedRequestBody = '{"data":{"type":"webhooks","id":">id<"}}';
|
34
|
+
newSignatureHeader = "Cxt7+aTi4rKgcA0bC4g9EHdVtLSDWdqccmL5MvihU4U=";
|
35
|
+
signatureKey = "signature-key";
|
36
|
+
url = "https://webhook.site/webhooks";
|
37
|
+
|
38
|
+
is_valid = Square::WebhooksHelper.is_valid_webhook_event_signature(
|
39
|
+
escpaedRequestBody,
|
40
|
+
newSignatureHeader,
|
41
|
+
signatureKey,
|
42
|
+
url
|
43
|
+
)
|
44
|
+
assert_equal true, is_valid
|
45
|
+
end
|
46
|
+
|
30
47
|
def test_signature_validation_fails_on_notification_url_mismatch
|
31
48
|
@logger.info('Running test_signature_validation_fails_on_notification_url_mismatch') # Log a message
|
32
49
|
is_valid = Square::WebhooksHelper.is_valid_webhook_event_signature(
|
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: 38.1.
|
4
|
+
version: 38.1.1.20240717
|
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: 2024-
|
11
|
+
date: 2024-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apimatic_core_interfaces
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.2.
|
19
|
+
version: 0.2.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.2.
|
26
|
+
version: 0.2.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: apimatic_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.3.
|
33
|
+
version: 0.3.9
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.3.
|
40
|
+
version: 0.3.9
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: apimatic_faraday_client_adapter
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.1.
|
47
|
+
version: 0.1.4
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.1.
|
54
|
+
version: 0.1.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|