Sha256: 1d95cb620fd1f951e0ea59853e9a4afa4a3fff5a15c2170d15d06353a1c75f4f
Contents?: true
Size: 592 Bytes
Versions: 4
Compression:
Stored size: 592 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}'") raise ActiveRecord::RecordNotFound, "Shop Not Found" end shop.with_shopify_session do |session| ## webhook processing logic end end end
Version data entries
4 entries across 4 versions & 1 rubygems