Class: ShopifyClient::CreateWebhook
- Inherits:
-
Object
- Object
- ShopifyClient::CreateWebhook
- Defined in:
- lib/shopify-client/create_webhook.rb
Instance Method Summary collapse
-
#call(client, webhook) ⇒ Hash
Response data.
Instance Method Details
#call(client, webhook) ⇒ Hash
Returns response data.
11 12 13 14 15 16 17 18 19 |
# File 'lib/shopify-client/create_webhook.rb', line 11 def call(client, webhook) client.post('webhooks', webhook: webhook.merge( address: ShopifyClient.config.webhook_uri, )) rescue Response::Error => e raise e unless e.response.errors.([ /has already been taken/, ]) end |