Skip to content

Commit

Permalink
Add support for metafield_namespaces in webhook registration
Browse files Browse the repository at this point in the history
This is an extension on Shopify/shopify-api-ruby#1186, allowing users of the shopify_app ruby/rails library to register webhooks and expect them to return with metafields back.
  • Loading branch information
fourseven committed Nov 8, 2023
1 parent 40aaa60 commit f9e9362
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/shopify_app/managers/webhooks_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def add_registrations
path: webhook_path,
handler: delivery_method == :http ? webhook_job_klass(webhook_path) : nil,
fields: attributes[:fields],
metafield_namespaces: attributes[:metafield_namespaces],
)
end
end
Expand Down
2 changes: 2 additions & 0 deletions test/shopify_app/managers/webhooks_manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ShopifyApp::WebhooksManagerTest < ActiveSupport::TestCase
path: "webhooks/orders_updated",
handler: OrdersUpdatedJob,
fields: nil,
metafield_namespaces: nil,
}

ShopifyAPI::Webhooks::Registry.expects(:add_registration).with(expected_hash).once
Expand All @@ -40,6 +41,7 @@ class ShopifyApp::WebhooksManagerTest < ActiveSupport::TestCase
path: "/webhooks/orders_updated",
handler: OrdersUpdatedJob,
fields: nil,
metafield_namespaces: nil,
}

ShopifyAPI::Webhooks::Registry.expects(:add_registration).with(expected_hash).once
Expand Down

0 comments on commit f9e9362

Please sign in to comment.