lib/spree_signifyd.rb in solidus_signifyd-1.0.1 vs lib/spree_signifyd.rb in solidus_signifyd-1.1.0
- old
+ new
@@ -1,11 +1,10 @@
require 'spree_core'
require 'signifyd'
require 'spree_signifyd/create_signifyd_case'
require 'spree_signifyd/engine'
require 'spree_signifyd/request_verifier'
-require 'resque'
require 'devise'
module SpreeSignifyd
module_function
@@ -18,17 +17,17 @@
end
end
def approve(order:)
order.contents.approve(name: self.name)
- order.shipments.each { |shipment| shipment.ready! if shipment.pending? }
+ order.shipments.each { |shipment| shipment.ready! if shipment.can_ready? }
order.updater.update_shipment_state
order.save!
end
def create_case(order_number:)
Rails.logger.info "Queuing Signifyd case creation event: #{order_number}"
- Resque.enqueue(SpreeSignifyd::CreateSignifydCase, order_number)
+ SpreeSignifyd::CreateSignifydCase.perform_later(order_number)
end
def score_above_threshold?(score)
score > SpreeSignifyd::Config[:signifyd_score_threshold]
end