From 87aba3678925b4cbc4ec4adfe0f2367ae523e11d Mon Sep 17 00:00:00 2001 From: Sasha Bogolii Date: Wed, 22 Jun 2022 14:21:50 +0300 Subject: [PATCH 1/3] API-6558: Added return_route_info query param --- HISTORY | 3 +++ lib/sift/client.rb | 2 ++ spec/unit/client_spec.rb | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index d2c8cc9..6e5f6f7 100644 --- a/HISTORY +++ b/HISTORY @@ -1,3 +1,6 @@ +=== 4.1.0 2022-06-22 +- Add return_route_info query param + === 4.0.0 2019-05-15 - Breaking change: Propagate exception in Client.track() – previously we were silently swallowing exceptions and now we are bubbling them up. You will need to add exception handling code. - Fix URL encoding diff --git a/lib/sift/client.rb b/lib/sift/client.rb index 2482978..e85134f 100644 --- a/lib/sift/client.rb +++ b/lib/sift/client.rb @@ -216,6 +216,7 @@ def track(event, properties = {}, opts = {}) return_score = opts[:return_score] return_action = opts[:return_action] return_workflow_status = opts[:return_workflow_status] + return_route_info = opts[:return_route_info] force_workflow_run = opts[:force_workflow_run] abuse_types = opts[:abuse_types] @@ -227,6 +228,7 @@ def track(event, properties = {}, opts = {}) query["return_score"] = "true" if return_score query["return_action"] = "true" if return_action query["return_workflow_status"] = "true" if return_workflow_status + query["return_route_info"] = "true" if return_route_info query["force_workflow_run"] = "true" if force_workflow_run query["abuse_types"] = abuse_types.join(",") if abuse_types diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb index faf3e8f..95adbf2 100644 --- a/spec/unit/client_spec.rb +++ b/spec/unit/client_spec.rb @@ -469,7 +469,7 @@ def fully_qualified_api_endpoint } stub_request(:post, - "https://api.siftscience.com/v205/events?return_workflow_status=true&abuse_types=legacy,payment_abuse") + "https://api.siftscience.com/v205/events?return_workflow_status=true&return_route_info&abuse_types=legacy,payment_abuse") .to_return(:status => 200, :body => MultiJson.dump(response_json), :headers => {"content-type"=>"application/json; charset=UTF-8", "content-length"=> "74"}) @@ -478,7 +478,8 @@ def fully_qualified_api_endpoint properties = valid_transaction_properties response = Sift::Client.new(:api_key => api_key) .track(event, properties, - :return_workflow_status => true, :abuse_types => ['legacy', 'payment_abuse']) + :return_workflow_status => true, :return_route_info => true, + :abuse_types => ['legacy', 'payment_abuse']) expect(response.ok?).to eq(true) expect(response.api_status).to eq(0) expect(response.api_error_message).to eq("OK") From c2fcf6af7811994f9281f841116a92b7584c5baa Mon Sep 17 00:00:00 2001 From: Sasha Bogolii Date: Wed, 22 Jun 2022 14:37:20 +0300 Subject: [PATCH 2/3] API-6558: Fixed stubbing in test --- spec/unit/client_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb index 95adbf2..4f6512d 100644 --- a/spec/unit/client_spec.rb +++ b/spec/unit/client_spec.rb @@ -469,7 +469,7 @@ def fully_qualified_api_endpoint } stub_request(:post, - "https://api.siftscience.com/v205/events?return_workflow_status=true&return_route_info&abuse_types=legacy,payment_abuse") + "https://api.siftscience.com/v205/events?return_workflow_status=true&return_route_info=true&abuse_types=legacy,payment_abuse") .to_return(:status => 200, :body => MultiJson.dump(response_json), :headers => {"content-type"=>"application/json; charset=UTF-8", "content-length"=> "74"}) From c6466802ab0e21dd5668276c4e93ca4bde8a2add Mon Sep 17 00:00:00 2001 From: Sasha Bogolii Date: Wed, 22 Jun 2022 14:38:24 +0300 Subject: [PATCH 3/3] API-6558: Updated version to 4.1.0 --- lib/sift/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sift/version.rb b/lib/sift/version.rb index 9ac8542..5859530 100644 --- a/lib/sift/version.rb +++ b/lib/sift/version.rb @@ -1,4 +1,4 @@ module Sift - VERSION = "4.0.0" + VERSION = "4.1.0" API_VERSION = "205" end