Skip to content

Commit

Permalink
Merge pull request #74 from SiftScience/API-6558
Browse files Browse the repository at this point in the history
API-6558: Added return_route_info query param
  • Loading branch information
sbogolii-sift authored Jun 23, 2022
2 parents 1d88a66 + c646680 commit 0a97fe2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/sift/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/sift/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Sift
VERSION = "4.0.0"
VERSION = "4.1.0"
API_VERSION = "205"
end
5 changes: 3 additions & 2 deletions spec/unit/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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=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"})
Expand All @@ -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")
Expand Down

0 comments on commit 0a97fe2

Please sign in to comment.