Class: Spree::Api::SpreeSignifyd::OrdersController

Inherits:
ActionController::Base
  • Object
show all
Includes:
SpreeSignifyd::RequestVerifier
Defined in:
app/controllers/spree/api/spree_signifyd/orders_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/spree/api/spree_signifyd/orders_controller.rb', line 9

def update
  SpreeSignifyd.set_score(order: @order, score: score)

  if is_fraudulent?
    @order.cancel!
  elsif should_approve?
    SpreeSignifyd.approve(order: @order)
  end

  render nothing: true, status: 200
end