Sha256: f48088e12ad943a2970cdad318e34c40e1f6ed23e3e5244887d3b8ae7d100842

Contents?: true

Size: 503 Bytes

Versions: 14

Compression:

Stored size: 503 Bytes

Contents

class <%= @job_class_name %> < ActiveJob::Base
  extend ShopifyAPI::Webhooks::Handler

  class << self
    def handle(topic:, shop:, body:)
      perform_later(topic: topic, shop_domain: shop, webhook: body)
    end
  end

  def perform(topic:, shop_domain:, webhook:)
    shop = Shop.find_by(shopify_domain: shop_domain)

    if shop.nil?
      logger.error("#{self.class} failed: cannot find shop with domain '#{shop_domain}'")
      return
    end

    shop.with_shopify_session do
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
shopify_app-21.2.0 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-21.1.1 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-21.1.0 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-21.0.0 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-20.2.0 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-20.1.1 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-20.1.0 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-20.0.2 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-20.0.1 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-20.0.0 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-19.1.0 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-19.0.2 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-19.0.1 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt
shopify_app-19.0.0 lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt