Sha256: 6c72734a51280c9a477811568e9eb01f921e885d9962f23d044414cf5dec269b
Contents?: true
Size: 947 Bytes
Versions: 4
Compression:
Stored size: 947 Bytes
Contents
# frozen_string_literal: true module DuodealerApp class WebhooksController < ApplicationController include DuodealerApp::WebhookVerification class DuodealerApp::MissingWebhookJobError < StandardError; end def receive params.permit! job_args = { account_domain: account_domain, webhook: webhook_params.to_h } webhook_job_klass.perform_later(job_args) head :no_content end private def webhook_params params.except(:controller, :action, :type) end def webhook_job_klass webhook_job_klass_name.safe_constantize || raise(DuodealerApp::MissingWebhookJobError) end def webhook_job_klass_name(type = webhook_type) [webhook_namespace, "#{type}_job"].compact.join("/").classify end def webhook_type params[:type] end def webhook_namespace DuodealerApp.configuration.webhook_jobs_namespace end end end
Version data entries
4 entries across 4 versions & 1 rubygems