Sha256: 64f15c75ff77fc28ebec713eba652bfaed214636df86e85fe2aabb286e114ce4

Contents?: true

Size: 445 Bytes

Versions: 2

Compression:

Stored size: 445 Bytes

Contents

# frozen_string_literal: true

module Webhooks
  class <%= @controller_class_name %> < ApplicationController
    include ShopifyApp::WebhookVerification

    def receive
      webhook_request = ShopifyAPI::Webhooks::Request.new(raw_body: request.raw_post, headers: request.headers.to_h)
      <%= @job_class_name %>.perform_later(shop_domain: webhook_request.shop, webhook: webhook_request.parsed_body)
      head(:no_content)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shopify_app-22.5.0 lib/generators/shopify_app/add_declarative_webhook/templates/webhook_controller.rb.tt
shopify_app-22.4.0 lib/generators/shopify_app/add_declarative_webhook/templates/webhook_controller.rb.tt