Sha256: 7168cfa01a55193b0fbb85ee539711bc443ce0e63782b2a2bc9d7f459aec4a36

Contents?: true

Size: 475 Bytes

Versions: 1

Compression:

Stored size: 475 Bytes

Contents

module SpreeSignifyd
  class CreateSignifydCase < ActiveJob::Base
    queue_as :default

    def perform(order_number_or_id)
      Rails.logger.info "Processing Signifyd case creation event: #{order_number_or_id}"
      order = Spree::Order.find_by(number: order_number_or_id) || Spree::Order.find(order_number_or_id)
      order_data = JSON.parse(OrderSerializer.new(order).to_json)
      Signifyd::Case.create(order_data, SpreeSignifyd::Config[:api_key])
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_signifyd-1.1.0 lib/spree_signifyd/create_signifyd_case.rb