Sha256: b142d830d8ae480f9186baef0a043e59f4e3dab736fa36b4e25539802318623d

Contents?: true

Size: 473 Bytes

Versions: 10

Compression:

Stored size: 473 Bytes

Contents

# frozen_string_literal: true

module SolidusBolt
  module Handlers
    class BaseHandler
      attr_reader :params

      def initialize(params)
        @params = params
      end

      def self.call(params)
        new(params).call
      end

      def call
        raise NotImplementedError, 'Missing #call method on class'
      end

      private

      def payment
        Spree::Payment.find_by(response_code: params[:data][:reference])
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
solidus_bolt-0.7.2 app/webhooks/solidus_bolt/handlers/base_handler.rb
solidus_bolt-0.7.1 app/webhooks/solidus_bolt/handlers/base_handler.rb
solidus_bolt-0.7.0 app/webhooks/solidus_bolt/handlers/base_handler.rb
solidus_bolt-0.6.0 app/webhooks/solidus_bolt/handlers/base_handler.rb
solidus_bolt-0.5.0 app/webhooks/solidus_bolt/handlers/base_handler.rb
solidus_bolt-0.4.0 app/webhooks/solidus_bolt/handlers/base_handler.rb
solidus_bolt-0.3.0 app/webhooks/solidus_bolt/handlers/base_handler.rb
solidus_bolt-0.2.0 app/webhooks/solidus_bolt/handlers/base_handler.rb
solidus_bolt-0.1.0 app/webhooks/solidus_bolt/handlers/base_handler.rb
solidus_bolt-0.0.1 app/webhooks/solidus_bolt/handlers/base_handler.rb