shopify_api 10.1.0 → 11.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +0 -1
- data/.github/workflows/cla.yml +22 -0
- data/.rubocop.yml +1 -1
- data/BREAKING_CHANGES_FOR_OLDER_VERSIONS.md +110 -0
- data/CHANGELOG.md +63 -49
- data/Gemfile.lock +26 -21
- data/README.md +5 -108
- data/RELEASING.md +2 -1
- data/docs/usage/graphql.md +1 -1
- data/lib/shopify_api/admin_versions.rb +2 -3
- data/lib/shopify_api/auth/file_session_storage.rb +2 -0
- data/lib/shopify_api/auth/jwt_payload.rb +16 -5
- data/lib/shopify_api/auth/session.rb +6 -6
- data/lib/shopify_api/auth.rb +26 -0
- data/lib/shopify_api/context.rb +6 -2
- data/lib/shopify_api/errors/missing_required_argument_error.rb +9 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/abandoned_checkout.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/access_scope.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/android_pay_key.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/apple_pay_certificate.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/application_charge.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/application_credit.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/article.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/asset.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/assigned_fulfillment_order.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/balance.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/blog.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/cancellation_request.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/carrier_service.rb +0 -3
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/checkout.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collect.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collection.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collection_listing.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/comment.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/country.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/currency.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/custom_collection.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer.rb +12 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer_address.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer_saved_search.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/deprecated_api_call.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/discount_code.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/dispute.rb +0 -0
- data/lib/shopify_api/rest/resources/2022_07/dispute_evidence.rb +117 -0
- data/lib/shopify_api/rest/resources/2022_07/dispute_file_upload.rb +81 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/draft_order.rb +6 -1
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/event.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment.rb +5 -49
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_event.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_order.rb +83 -1
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_request.rb +5 -1
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_service.rb +3 -3
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/gift_card.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/gift_card_adjustment.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/image.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/inventory_item.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/inventory_level.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/location.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/locations_for_move.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/marketing_event.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/metafield.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/mobile_platform_application.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/order.rb +3 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/order_risk.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/page.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment_gateway.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment_transaction.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payout.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/policy.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/price_rule.rb +3 -3
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product_listing.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product_resource_feedback.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/province.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/recurring_application_charge.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/redirect.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/refund.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/report.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/resource_feedback.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/script_tag.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/shipping_zone.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/shop.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/smart_collection.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/storefront_access_token.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/tender_transaction.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/theme.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/transaction.rb +3 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/usage_charge.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/user.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/variant.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/webhook.rb +0 -0
- data/lib/shopify_api/utils/hmac_validator.rb +16 -6
- data/lib/shopify_api/version.rb +1 -1
- data/lib/shopify_api/webhooks/request.rb +1 -1
- data/sorbet/rbi/todo.rbi +0 -1
- metadata +83 -78
- data/.github/probots.yml +0 -2
@@ -21,6 +21,8 @@ module ShopifyAPI
|
|
21
21
|
@delivery_method = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
22
22
|
@destination = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
23
23
|
@fulfill_at = T.let(nil, T.nilable(String))
|
24
|
+
@fulfill_by = T.let(nil, T.nilable(String))
|
25
|
+
@fulfillment_holds = T.let(nil, T.nilable(T::Array[T.untyped]))
|
24
26
|
@id = T.let(nil, T.nilable(Integer))
|
25
27
|
@international_duties = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
26
28
|
@line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
|
@@ -39,9 +41,12 @@ module ShopifyAPI
|
|
39
41
|
{http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/fulfillment_orders.json"},
|
40
42
|
{http_method: :post, operation: :cancel, ids: [:id], path: "fulfillment_orders/<id>/cancel.json"},
|
41
43
|
{http_method: :post, operation: :close, ids: [:id], path: "fulfillment_orders/<id>/close.json"},
|
44
|
+
{http_method: :post, operation: :hold, ids: [:id], path: "fulfillment_orders/<id>/hold.json"},
|
42
45
|
{http_method: :post, operation: :move, ids: [:id], path: "fulfillment_orders/<id>/move.json"},
|
43
46
|
{http_method: :post, operation: :open, ids: [:id], path: "fulfillment_orders/<id>/open.json"},
|
44
|
-
{http_method: :post, operation: :
|
47
|
+
{http_method: :post, operation: :release_hold, ids: [:id], path: "fulfillment_orders/<id>/release_hold.json"},
|
48
|
+
{http_method: :post, operation: :reschedule, ids: [:id], path: "fulfillment_orders/<id>/reschedule.json"},
|
49
|
+
{http_method: :post, operation: :set_fulfillment_orders_deadline, ids: [], path: "fulfillment_orders/set_fulfillment_orders_deadline.json"}
|
45
50
|
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
46
51
|
|
47
52
|
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
@@ -54,6 +59,10 @@ module ShopifyAPI
|
|
54
59
|
attr_reader :destination
|
55
60
|
sig { returns(T.nilable(String)) }
|
56
61
|
attr_reader :fulfill_at
|
62
|
+
sig { returns(T.nilable(String)) }
|
63
|
+
attr_reader :fulfill_by
|
64
|
+
sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
|
65
|
+
attr_reader :fulfillment_holds
|
57
66
|
sig { returns(T.nilable(Integer)) }
|
58
67
|
attr_reader :id
|
59
68
|
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
@@ -159,6 +168,33 @@ module ShopifyAPI
|
|
159
168
|
)
|
160
169
|
end
|
161
170
|
|
171
|
+
sig do
|
172
|
+
params(
|
173
|
+
reason: T.untyped,
|
174
|
+
reason_notes: T.untyped,
|
175
|
+
notify_merchant: T.untyped,
|
176
|
+
body: T.untyped,
|
177
|
+
kwargs: T.untyped
|
178
|
+
).returns(T.untyped)
|
179
|
+
end
|
180
|
+
def hold(
|
181
|
+
reason: nil,
|
182
|
+
reason_notes: nil,
|
183
|
+
notify_merchant: nil,
|
184
|
+
body: nil,
|
185
|
+
**kwargs
|
186
|
+
)
|
187
|
+
self.class.request(
|
188
|
+
http_method: :post,
|
189
|
+
operation: :hold,
|
190
|
+
session: @session,
|
191
|
+
ids: {id: @id},
|
192
|
+
params: {reason: reason, reason_notes: reason_notes, notify_merchant: notify_merchant}.merge(kwargs).compact,
|
193
|
+
body: body,
|
194
|
+
entity: self,
|
195
|
+
)
|
196
|
+
end
|
197
|
+
|
162
198
|
sig do
|
163
199
|
params(
|
164
200
|
new_location_id: T.untyped,
|
@@ -203,6 +239,27 @@ module ShopifyAPI
|
|
203
239
|
)
|
204
240
|
end
|
205
241
|
|
242
|
+
sig do
|
243
|
+
params(
|
244
|
+
body: T.untyped,
|
245
|
+
kwargs: T.untyped
|
246
|
+
).returns(T.untyped)
|
247
|
+
end
|
248
|
+
def release_hold(
|
249
|
+
body: nil,
|
250
|
+
**kwargs
|
251
|
+
)
|
252
|
+
self.class.request(
|
253
|
+
http_method: :post,
|
254
|
+
operation: :release_hold,
|
255
|
+
session: @session,
|
256
|
+
ids: {id: @id},
|
257
|
+
params: {}.merge(kwargs).compact,
|
258
|
+
body: body,
|
259
|
+
entity: self,
|
260
|
+
)
|
261
|
+
end
|
262
|
+
|
206
263
|
sig do
|
207
264
|
params(
|
208
265
|
body: T.untyped,
|
@@ -224,5 +281,30 @@ module ShopifyAPI
|
|
224
281
|
)
|
225
282
|
end
|
226
283
|
|
284
|
+
sig do
|
285
|
+
params(
|
286
|
+
fulfillment_order_ids: T.untyped,
|
287
|
+
fulfillment_deadline: T.untyped,
|
288
|
+
body: T.untyped,
|
289
|
+
kwargs: T.untyped
|
290
|
+
).returns(T.untyped)
|
291
|
+
end
|
292
|
+
def set_fulfillment_orders_deadline(
|
293
|
+
fulfillment_order_ids: nil,
|
294
|
+
fulfillment_deadline: nil,
|
295
|
+
body: nil,
|
296
|
+
**kwargs
|
297
|
+
)
|
298
|
+
self.class.request(
|
299
|
+
http_method: :post,
|
300
|
+
operation: :set_fulfillment_orders_deadline,
|
301
|
+
session: @session,
|
302
|
+
ids: {},
|
303
|
+
params: {fulfillment_order_ids: fulfillment_order_ids, fulfillment_deadline: fulfillment_deadline}.merge(kwargs).compact,
|
304
|
+
body: body,
|
305
|
+
entity: self,
|
306
|
+
)
|
307
|
+
end
|
308
|
+
|
227
309
|
end
|
228
310
|
end
|
@@ -59,12 +59,16 @@ module ShopifyAPI
|
|
59
59
|
sig do
|
60
60
|
params(
|
61
61
|
message: T.untyped,
|
62
|
+
reason: T.untyped,
|
63
|
+
line_items: T.untyped,
|
62
64
|
body: T.untyped,
|
63
65
|
kwargs: T.untyped
|
64
66
|
).returns(T.untyped)
|
65
67
|
end
|
66
68
|
def reject(
|
67
69
|
message: nil,
|
70
|
+
reason: nil,
|
71
|
+
line_items: nil,
|
68
72
|
body: nil,
|
69
73
|
**kwargs
|
70
74
|
)
|
@@ -73,7 +77,7 @@ module ShopifyAPI
|
|
73
77
|
operation: :reject,
|
74
78
|
session: @session,
|
75
79
|
ids: {fulfillment_order_id: @fulfillment_order_id},
|
76
|
-
params: {message: message}.merge(kwargs).compact,
|
80
|
+
params: {message: message, reason: reason, line_items: line_items}.merge(kwargs).compact,
|
77
81
|
body: body,
|
78
82
|
entity: self,
|
79
83
|
)
|
@@ -18,13 +18,13 @@ module ShopifyAPI
|
|
18
18
|
|
19
19
|
@admin_graphql_api_id = T.let(nil, T.nilable(String))
|
20
20
|
@callback_url = T.let(nil, T.nilable(String))
|
21
|
-
@format = T.let(nil, T.nilable(String))
|
22
21
|
@fulfillment_orders_opt_in = T.let(nil, T.nilable(T::Boolean))
|
23
22
|
@handle = T.let(nil, T.nilable(String))
|
24
23
|
@id = T.let(nil, T.nilable(Integer))
|
25
24
|
@inventory_management = T.let(nil, T.nilable(T::Boolean))
|
26
25
|
@location_id = T.let(nil, T.nilable(Integer))
|
27
26
|
@name = T.let(nil, T.nilable(String))
|
27
|
+
@permits_sku_sharing = T.let(nil, T.nilable(T::Boolean))
|
28
28
|
@provider_id = T.let(nil, T.nilable(String))
|
29
29
|
@requires_shipping_method = T.let(nil, T.nilable(T::Boolean))
|
30
30
|
@tracking_support = T.let(nil, T.nilable(T::Boolean))
|
@@ -44,8 +44,6 @@ module ShopifyAPI
|
|
44
44
|
attr_reader :admin_graphql_api_id
|
45
45
|
sig { returns(T.nilable(String)) }
|
46
46
|
attr_reader :callback_url
|
47
|
-
sig { returns(T.nilable(String)) }
|
48
|
-
attr_reader :format
|
49
47
|
sig { returns(T.nilable(T::Boolean)) }
|
50
48
|
attr_reader :fulfillment_orders_opt_in
|
51
49
|
sig { returns(T.nilable(String)) }
|
@@ -58,6 +56,8 @@ module ShopifyAPI
|
|
58
56
|
attr_reader :location_id
|
59
57
|
sig { returns(T.nilable(String)) }
|
60
58
|
attr_reader :name
|
59
|
+
sig { returns(T.nilable(T::Boolean)) }
|
60
|
+
attr_reader :permits_sku_sharing
|
61
61
|
sig { returns(T.nilable(String)) }
|
62
62
|
attr_reader :provider_id
|
63
63
|
sig { returns(T.nilable(T::Boolean)) }
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -60,6 +60,7 @@ module ShopifyAPI
|
|
60
60
|
@original_total_duties_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
61
61
|
@payment_details = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
62
62
|
@payment_gateway_names = T.let(nil, T.nilable(T::Array[T.untyped]))
|
63
|
+
@payment_terms = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
63
64
|
@phone = T.let(nil, T.nilable(String))
|
64
65
|
@presentment_currency = T.let(nil, T.nilable(String))
|
65
66
|
@processed_at = T.let(nil, T.nilable(String))
|
@@ -202,6 +203,8 @@ module ShopifyAPI
|
|
202
203
|
attr_reader :payment_details
|
203
204
|
sig { returns(T.nilable(T::Array[String])) }
|
204
205
|
attr_reader :payment_gateway_names
|
206
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
207
|
+
attr_reader :payment_terms
|
205
208
|
sig { returns(T.nilable(String)) }
|
206
209
|
attr_reader :phone
|
207
210
|
sig { returns(T.nilable(String)) }
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -19,6 +19,7 @@ module ShopifyAPI
|
|
19
19
|
@allocation_limit = T.let(nil, T.nilable(Integer))
|
20
20
|
@allocation_method = T.let(nil, T.nilable(String))
|
21
21
|
@created_at = T.let(nil, T.nilable(String))
|
22
|
+
@customer_segment_prerequisite_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
22
23
|
@customer_selection = T.let(nil, T.nilable(String))
|
23
24
|
@ends_at = T.let(nil, T.nilable(String))
|
24
25
|
@entitled_collection_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
@@ -31,7 +32,6 @@ module ShopifyAPI
|
|
31
32
|
@prerequisite_customer_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
32
33
|
@prerequisite_product_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
33
34
|
@prerequisite_quantity_range = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
34
|
-
@prerequisite_saved_search_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
35
35
|
@prerequisite_shipping_price_range = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
36
36
|
@prerequisite_subtotal_range = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
37
37
|
@prerequisite_to_entitlement_purchase = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
@@ -64,6 +64,8 @@ module ShopifyAPI
|
|
64
64
|
attr_reader :allocation_method
|
65
65
|
sig { returns(T.nilable(String)) }
|
66
66
|
attr_reader :created_at
|
67
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
68
|
+
attr_reader :customer_segment_prerequisite_ids
|
67
69
|
sig { returns(T.nilable(String)) }
|
68
70
|
attr_reader :customer_selection
|
69
71
|
sig { returns(T.nilable(String)) }
|
@@ -88,8 +90,6 @@ module ShopifyAPI
|
|
88
90
|
attr_reader :prerequisite_product_ids
|
89
91
|
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
90
92
|
attr_reader :prerequisite_quantity_range
|
91
|
-
sig { returns(T.nilable(T::Array[Integer])) }
|
92
|
-
attr_reader :prerequisite_saved_search_ids
|
93
93
|
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
94
94
|
attr_reader :prerequisite_shipping_price_range
|
95
95
|
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -33,6 +33,7 @@ module ShopifyAPI
|
|
33
33
|
@order_id = T.let(nil, T.nilable(Integer))
|
34
34
|
@parent_id = T.let(nil, T.nilable(Integer))
|
35
35
|
@payment_details = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
36
|
+
@payments_refund_attributes = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
36
37
|
@processed_at = T.let(nil, T.nilable(String))
|
37
38
|
@receipt = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
38
39
|
@source_name = T.let(nil, T.nilable(String))
|
@@ -84,6 +85,8 @@ module ShopifyAPI
|
|
84
85
|
attr_reader :parent_id
|
85
86
|
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
86
87
|
attr_reader :payment_details
|
88
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
89
|
+
attr_reader :payments_refund_attributes
|
87
90
|
sig { returns(T.nilable(String)) }
|
88
91
|
attr_reader :processed_at
|
89
92
|
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -13,18 +13,28 @@ module ShopifyAPI
|
|
13
13
|
def validate(verifiable_query)
|
14
14
|
return false unless verifiable_query.hmac
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
result = validate_signature(verifiable_query, Context.api_secret_key)
|
17
|
+
if result || Context.old_api_secret_key.blank?
|
18
|
+
result
|
19
|
+
else
|
20
|
+
validate_signature(verifiable_query, T.must(Context.old_api_secret_key))
|
21
|
+
end
|
19
22
|
end
|
20
23
|
|
21
24
|
private
|
22
25
|
|
23
|
-
sig { params(
|
24
|
-
def
|
26
|
+
sig { params(verifiable_query: VerifiableQuery, secret: String).returns(T::Boolean) }
|
27
|
+
def validate_signature(verifiable_query, secret)
|
28
|
+
received_signature = verifiable_query.hmac
|
29
|
+
computed_signature = compute_signature(verifiable_query.to_signable_string, secret)
|
30
|
+
OpenSSL.secure_compare(computed_signature, received_signature)
|
31
|
+
end
|
32
|
+
|
33
|
+
sig { params(signable_string: String, secret: String).returns(String) }
|
34
|
+
def compute_signature(signable_string, secret)
|
25
35
|
OpenSSL::HMAC.hexdigest(
|
26
36
|
OpenSSL::Digest.new("sha256"),
|
27
|
-
|
37
|
+
secret,
|
28
38
|
signable_string,
|
29
39
|
)
|
30
40
|
end
|
data/lib/shopify_api/version.rb
CHANGED
@@ -35,7 +35,7 @@ module ShopifyAPI
|
|
35
35
|
sig { params(raw_body: String, headers: T::Hash[String, T.untyped]).void }
|
36
36
|
def initialize(raw_body:, headers:)
|
37
37
|
# normalize the headers by forcing lowercase, removing any prepended "http"s, and changing underscores to dashes
|
38
|
-
headers = headers.to_h { |k, v| [k.downcase.sub("http_", "").gsub("_", "-"), v] }
|
38
|
+
headers = headers.to_h { |k, v| [k.to_s.downcase.sub("http_", "").gsub("_", "-"), v] }
|
39
39
|
|
40
40
|
missing_headers = []
|
41
41
|
[
|
data/sorbet/rbi/todo.rbi
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 11.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -247,10 +247,11 @@ files:
|
|
247
247
|
- ".github/CODEOWNERS"
|
248
248
|
- ".github/ISSUE_TEMPLATE.md"
|
249
249
|
- ".github/dependabot.yml"
|
250
|
-
- ".github/probots.yml"
|
251
250
|
- ".github/pull_request_template.md"
|
252
251
|
- ".github/workflows/build.yml"
|
252
|
+
- ".github/workflows/cla.yml"
|
253
253
|
- ".rubocop.yml"
|
254
|
+
- BREAKING_CHANGES_FOR_OLDER_VERSIONS.md
|
254
255
|
- CHANGELOG.md
|
255
256
|
- CONTRIBUTING.md
|
256
257
|
- Gemfile
|
@@ -273,6 +274,7 @@ files:
|
|
273
274
|
- docs/usage/webhooks.md
|
274
275
|
- lib/shopify_api.rb
|
275
276
|
- lib/shopify_api/admin_versions.rb
|
277
|
+
- lib/shopify_api/auth.rb
|
276
278
|
- lib/shopify_api/auth/associated_user.rb
|
277
279
|
- lib/shopify_api/auth/auth_scopes.rb
|
278
280
|
- lib/shopify_api/auth/file_session_storage.rb
|
@@ -301,6 +303,7 @@ files:
|
|
301
303
|
- lib/shopify_api/errors/invalid_webhook_registration_error.rb
|
302
304
|
- lib/shopify_api/errors/max_http_retries_exceeded_error.rb
|
303
305
|
- lib/shopify_api/errors/missing_jwt_token_error.rb
|
306
|
+
- lib/shopify_api/errors/missing_required_argument_error.rb
|
304
307
|
- lib/shopify_api/errors/no_active_session_error.rb
|
305
308
|
- lib/shopify_api/errors/no_session_cookie_error.rb
|
306
309
|
- lib/shopify_api/errors/no_webhook_handler.rb
|
@@ -314,80 +317,6 @@ files:
|
|
314
317
|
- lib/shopify_api/inflector.rb
|
315
318
|
- lib/shopify_api/rest/base.rb
|
316
319
|
- lib/shopify_api/rest/base_errors.rb
|
317
|
-
- lib/shopify_api/rest/resources/2021_07/abandoned_checkout.rb
|
318
|
-
- lib/shopify_api/rest/resources/2021_07/access_scope.rb
|
319
|
-
- lib/shopify_api/rest/resources/2021_07/android_pay_key.rb
|
320
|
-
- lib/shopify_api/rest/resources/2021_07/apple_pay_certificate.rb
|
321
|
-
- lib/shopify_api/rest/resources/2021_07/application_charge.rb
|
322
|
-
- lib/shopify_api/rest/resources/2021_07/application_credit.rb
|
323
|
-
- lib/shopify_api/rest/resources/2021_07/article.rb
|
324
|
-
- lib/shopify_api/rest/resources/2021_07/asset.rb
|
325
|
-
- lib/shopify_api/rest/resources/2021_07/assigned_fulfillment_order.rb
|
326
|
-
- lib/shopify_api/rest/resources/2021_07/balance.rb
|
327
|
-
- lib/shopify_api/rest/resources/2021_07/blog.rb
|
328
|
-
- lib/shopify_api/rest/resources/2021_07/cancellation_request.rb
|
329
|
-
- lib/shopify_api/rest/resources/2021_07/carrier_service.rb
|
330
|
-
- lib/shopify_api/rest/resources/2021_07/checkout.rb
|
331
|
-
- lib/shopify_api/rest/resources/2021_07/collect.rb
|
332
|
-
- lib/shopify_api/rest/resources/2021_07/collection.rb
|
333
|
-
- lib/shopify_api/rest/resources/2021_07/collection_listing.rb
|
334
|
-
- lib/shopify_api/rest/resources/2021_07/comment.rb
|
335
|
-
- lib/shopify_api/rest/resources/2021_07/country.rb
|
336
|
-
- lib/shopify_api/rest/resources/2021_07/currency.rb
|
337
|
-
- lib/shopify_api/rest/resources/2021_07/custom_collection.rb
|
338
|
-
- lib/shopify_api/rest/resources/2021_07/customer.rb
|
339
|
-
- lib/shopify_api/rest/resources/2021_07/customer_address.rb
|
340
|
-
- lib/shopify_api/rest/resources/2021_07/customer_saved_search.rb
|
341
|
-
- lib/shopify_api/rest/resources/2021_07/deprecated_api_call.rb
|
342
|
-
- lib/shopify_api/rest/resources/2021_07/discount_code.rb
|
343
|
-
- lib/shopify_api/rest/resources/2021_07/dispute.rb
|
344
|
-
- lib/shopify_api/rest/resources/2021_07/draft_order.rb
|
345
|
-
- lib/shopify_api/rest/resources/2021_07/event.rb
|
346
|
-
- lib/shopify_api/rest/resources/2021_07/fulfillment.rb
|
347
|
-
- lib/shopify_api/rest/resources/2021_07/fulfillment_event.rb
|
348
|
-
- lib/shopify_api/rest/resources/2021_07/fulfillment_order.rb
|
349
|
-
- lib/shopify_api/rest/resources/2021_07/fulfillment_request.rb
|
350
|
-
- lib/shopify_api/rest/resources/2021_07/fulfillment_service.rb
|
351
|
-
- lib/shopify_api/rest/resources/2021_07/gift_card.rb
|
352
|
-
- lib/shopify_api/rest/resources/2021_07/gift_card_adjustment.rb
|
353
|
-
- lib/shopify_api/rest/resources/2021_07/image.rb
|
354
|
-
- lib/shopify_api/rest/resources/2021_07/inventory_item.rb
|
355
|
-
- lib/shopify_api/rest/resources/2021_07/inventory_level.rb
|
356
|
-
- lib/shopify_api/rest/resources/2021_07/location.rb
|
357
|
-
- lib/shopify_api/rest/resources/2021_07/locations_for_move.rb
|
358
|
-
- lib/shopify_api/rest/resources/2021_07/marketing_event.rb
|
359
|
-
- lib/shopify_api/rest/resources/2021_07/metafield.rb
|
360
|
-
- lib/shopify_api/rest/resources/2021_07/mobile_platform_application.rb
|
361
|
-
- lib/shopify_api/rest/resources/2021_07/order.rb
|
362
|
-
- lib/shopify_api/rest/resources/2021_07/order_risk.rb
|
363
|
-
- lib/shopify_api/rest/resources/2021_07/page.rb
|
364
|
-
- lib/shopify_api/rest/resources/2021_07/payment.rb
|
365
|
-
- lib/shopify_api/rest/resources/2021_07/payment_gateway.rb
|
366
|
-
- lib/shopify_api/rest/resources/2021_07/payment_transaction.rb
|
367
|
-
- lib/shopify_api/rest/resources/2021_07/payout.rb
|
368
|
-
- lib/shopify_api/rest/resources/2021_07/policy.rb
|
369
|
-
- lib/shopify_api/rest/resources/2021_07/price_rule.rb
|
370
|
-
- lib/shopify_api/rest/resources/2021_07/product.rb
|
371
|
-
- lib/shopify_api/rest/resources/2021_07/product_listing.rb
|
372
|
-
- lib/shopify_api/rest/resources/2021_07/product_resource_feedback.rb
|
373
|
-
- lib/shopify_api/rest/resources/2021_07/province.rb
|
374
|
-
- lib/shopify_api/rest/resources/2021_07/recurring_application_charge.rb
|
375
|
-
- lib/shopify_api/rest/resources/2021_07/redirect.rb
|
376
|
-
- lib/shopify_api/rest/resources/2021_07/refund.rb
|
377
|
-
- lib/shopify_api/rest/resources/2021_07/report.rb
|
378
|
-
- lib/shopify_api/rest/resources/2021_07/resource_feedback.rb
|
379
|
-
- lib/shopify_api/rest/resources/2021_07/script_tag.rb
|
380
|
-
- lib/shopify_api/rest/resources/2021_07/shipping_zone.rb
|
381
|
-
- lib/shopify_api/rest/resources/2021_07/shop.rb
|
382
|
-
- lib/shopify_api/rest/resources/2021_07/smart_collection.rb
|
383
|
-
- lib/shopify_api/rest/resources/2021_07/storefront_access_token.rb
|
384
|
-
- lib/shopify_api/rest/resources/2021_07/tender_transaction.rb
|
385
|
-
- lib/shopify_api/rest/resources/2021_07/theme.rb
|
386
|
-
- lib/shopify_api/rest/resources/2021_07/transaction.rb
|
387
|
-
- lib/shopify_api/rest/resources/2021_07/usage_charge.rb
|
388
|
-
- lib/shopify_api/rest/resources/2021_07/user.rb
|
389
|
-
- lib/shopify_api/rest/resources/2021_07/variant.rb
|
390
|
-
- lib/shopify_api/rest/resources/2021_07/webhook.rb
|
391
320
|
- lib/shopify_api/rest/resources/2021_10/abandoned_checkout.rb
|
392
321
|
- lib/shopify_api/rest/resources/2021_10/access_scope.rb
|
393
322
|
- lib/shopify_api/rest/resources/2021_10/android_pay_key.rb
|
@@ -610,6 +539,82 @@ files:
|
|
610
539
|
- lib/shopify_api/rest/resources/2022_04/user.rb
|
611
540
|
- lib/shopify_api/rest/resources/2022_04/variant.rb
|
612
541
|
- lib/shopify_api/rest/resources/2022_04/webhook.rb
|
542
|
+
- lib/shopify_api/rest/resources/2022_07/abandoned_checkout.rb
|
543
|
+
- lib/shopify_api/rest/resources/2022_07/access_scope.rb
|
544
|
+
- lib/shopify_api/rest/resources/2022_07/android_pay_key.rb
|
545
|
+
- lib/shopify_api/rest/resources/2022_07/apple_pay_certificate.rb
|
546
|
+
- lib/shopify_api/rest/resources/2022_07/application_charge.rb
|
547
|
+
- lib/shopify_api/rest/resources/2022_07/application_credit.rb
|
548
|
+
- lib/shopify_api/rest/resources/2022_07/article.rb
|
549
|
+
- lib/shopify_api/rest/resources/2022_07/asset.rb
|
550
|
+
- lib/shopify_api/rest/resources/2022_07/assigned_fulfillment_order.rb
|
551
|
+
- lib/shopify_api/rest/resources/2022_07/balance.rb
|
552
|
+
- lib/shopify_api/rest/resources/2022_07/blog.rb
|
553
|
+
- lib/shopify_api/rest/resources/2022_07/cancellation_request.rb
|
554
|
+
- lib/shopify_api/rest/resources/2022_07/carrier_service.rb
|
555
|
+
- lib/shopify_api/rest/resources/2022_07/checkout.rb
|
556
|
+
- lib/shopify_api/rest/resources/2022_07/collect.rb
|
557
|
+
- lib/shopify_api/rest/resources/2022_07/collection.rb
|
558
|
+
- lib/shopify_api/rest/resources/2022_07/collection_listing.rb
|
559
|
+
- lib/shopify_api/rest/resources/2022_07/comment.rb
|
560
|
+
- lib/shopify_api/rest/resources/2022_07/country.rb
|
561
|
+
- lib/shopify_api/rest/resources/2022_07/currency.rb
|
562
|
+
- lib/shopify_api/rest/resources/2022_07/custom_collection.rb
|
563
|
+
- lib/shopify_api/rest/resources/2022_07/customer.rb
|
564
|
+
- lib/shopify_api/rest/resources/2022_07/customer_address.rb
|
565
|
+
- lib/shopify_api/rest/resources/2022_07/customer_saved_search.rb
|
566
|
+
- lib/shopify_api/rest/resources/2022_07/deprecated_api_call.rb
|
567
|
+
- lib/shopify_api/rest/resources/2022_07/discount_code.rb
|
568
|
+
- lib/shopify_api/rest/resources/2022_07/dispute.rb
|
569
|
+
- lib/shopify_api/rest/resources/2022_07/dispute_evidence.rb
|
570
|
+
- lib/shopify_api/rest/resources/2022_07/dispute_file_upload.rb
|
571
|
+
- lib/shopify_api/rest/resources/2022_07/draft_order.rb
|
572
|
+
- lib/shopify_api/rest/resources/2022_07/event.rb
|
573
|
+
- lib/shopify_api/rest/resources/2022_07/fulfillment.rb
|
574
|
+
- lib/shopify_api/rest/resources/2022_07/fulfillment_event.rb
|
575
|
+
- lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb
|
576
|
+
- lib/shopify_api/rest/resources/2022_07/fulfillment_request.rb
|
577
|
+
- lib/shopify_api/rest/resources/2022_07/fulfillment_service.rb
|
578
|
+
- lib/shopify_api/rest/resources/2022_07/gift_card.rb
|
579
|
+
- lib/shopify_api/rest/resources/2022_07/gift_card_adjustment.rb
|
580
|
+
- lib/shopify_api/rest/resources/2022_07/image.rb
|
581
|
+
- lib/shopify_api/rest/resources/2022_07/inventory_item.rb
|
582
|
+
- lib/shopify_api/rest/resources/2022_07/inventory_level.rb
|
583
|
+
- lib/shopify_api/rest/resources/2022_07/location.rb
|
584
|
+
- lib/shopify_api/rest/resources/2022_07/locations_for_move.rb
|
585
|
+
- lib/shopify_api/rest/resources/2022_07/marketing_event.rb
|
586
|
+
- lib/shopify_api/rest/resources/2022_07/metafield.rb
|
587
|
+
- lib/shopify_api/rest/resources/2022_07/mobile_platform_application.rb
|
588
|
+
- lib/shopify_api/rest/resources/2022_07/order.rb
|
589
|
+
- lib/shopify_api/rest/resources/2022_07/order_risk.rb
|
590
|
+
- lib/shopify_api/rest/resources/2022_07/page.rb
|
591
|
+
- lib/shopify_api/rest/resources/2022_07/payment.rb
|
592
|
+
- lib/shopify_api/rest/resources/2022_07/payment_gateway.rb
|
593
|
+
- lib/shopify_api/rest/resources/2022_07/payment_transaction.rb
|
594
|
+
- lib/shopify_api/rest/resources/2022_07/payout.rb
|
595
|
+
- lib/shopify_api/rest/resources/2022_07/policy.rb
|
596
|
+
- lib/shopify_api/rest/resources/2022_07/price_rule.rb
|
597
|
+
- lib/shopify_api/rest/resources/2022_07/product.rb
|
598
|
+
- lib/shopify_api/rest/resources/2022_07/product_listing.rb
|
599
|
+
- lib/shopify_api/rest/resources/2022_07/product_resource_feedback.rb
|
600
|
+
- lib/shopify_api/rest/resources/2022_07/province.rb
|
601
|
+
- lib/shopify_api/rest/resources/2022_07/recurring_application_charge.rb
|
602
|
+
- lib/shopify_api/rest/resources/2022_07/redirect.rb
|
603
|
+
- lib/shopify_api/rest/resources/2022_07/refund.rb
|
604
|
+
- lib/shopify_api/rest/resources/2022_07/report.rb
|
605
|
+
- lib/shopify_api/rest/resources/2022_07/resource_feedback.rb
|
606
|
+
- lib/shopify_api/rest/resources/2022_07/script_tag.rb
|
607
|
+
- lib/shopify_api/rest/resources/2022_07/shipping_zone.rb
|
608
|
+
- lib/shopify_api/rest/resources/2022_07/shop.rb
|
609
|
+
- lib/shopify_api/rest/resources/2022_07/smart_collection.rb
|
610
|
+
- lib/shopify_api/rest/resources/2022_07/storefront_access_token.rb
|
611
|
+
- lib/shopify_api/rest/resources/2022_07/tender_transaction.rb
|
612
|
+
- lib/shopify_api/rest/resources/2022_07/theme.rb
|
613
|
+
- lib/shopify_api/rest/resources/2022_07/transaction.rb
|
614
|
+
- lib/shopify_api/rest/resources/2022_07/usage_charge.rb
|
615
|
+
- lib/shopify_api/rest/resources/2022_07/user.rb
|
616
|
+
- lib/shopify_api/rest/resources/2022_07/variant.rb
|
617
|
+
- lib/shopify_api/rest/resources/2022_07/webhook.rb
|
613
618
|
- lib/shopify_api/utils/graphql_proxy.rb
|
614
619
|
- lib/shopify_api/utils/hmac_validator.rb
|
615
620
|
- lib/shopify_api/utils/http_utils.rb
|
@@ -701,7 +706,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
701
706
|
- !ruby/object:Gem::Version
|
702
707
|
version: '0'
|
703
708
|
requirements: []
|
704
|
-
rubygems_version: 3.
|
709
|
+
rubygems_version: 3.3.3
|
705
710
|
signing_key:
|
706
711
|
specification_version: 4
|
707
712
|
summary: The gem for accessing the Shopify API
|
data/.github/probots.yml
DELETED