Sha256: 232eaf0504ae47f985b2f283fc9b84c73262affebec8792de6cba7c38963d41f

Contents?: true

Size: 566 Bytes

Versions: 18

Compression:

Stored size: 566 Bytes

Contents

# frozen_string_literal: true

module FlowcommerceSpree
  module Webhooks
    class ExperienceUpsertedV2
      attr_accessor :errors
      alias full_messages errors

      def self.process(data, opts = {})
        new(data, opts).process
      end

      def initialize(data, opts = {})
        @data = data
        @opts = opts
        @errors = []
      end

      def process
        experience = @data['experience']
        Spree::Zones::Product.find_or_initialize_by(name: experience['key'].titleize).store_flow_io_data(experience)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
flowcommerce_spree-0.0.22 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.21 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.20 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.19 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.18 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.17 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.16 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.15 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.14 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.13 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.12 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.11 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.10 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.9 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.8 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.7 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.6 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb
flowcommerce_spree-0.0.5 app/services/flowcommerce_spree/webhooks/experience_upserted_v2.rb