Module: Castle::API::Risk
- Defined in:
- lib/castle/api/risk.rb
Overview
Module for risk endpoint
Class Method Summary collapse
-
.call(options = {}) ⇒ Object
return [Hash].
Class Method Details
.call(options = {}) ⇒ Object
return [Hash]
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/castle/api/risk.rb', line 10 def call( = {}) = Castle::Utils::DeepSymbolizeKeys.call( || {}) unless [:no_symbolize] .delete(:no_symbolize) http = .delete(:http) config = .delete(:config) || Castle.config response = Castle::API.call(Castle::Commands::Risk.build(), {}, http, config) response.merge(failover: false, failover_reason: nil) rescue Castle::RequestError, Castle::InternalServerError => e unless config.failover_strategy == :throw strategy = (config || Castle.config).failover_strategy return(Castle::Failover::PrepareResponse.new([:user][:id], reason: e.to_s, strategy: strategy).call) end raise e end |