-
Notifications
You must be signed in to change notification settings - Fork 25
(For Gary or Jintae) Add get session decisions #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added API client method for calling user session get decisions API described here: https://siftscience.com/developers/docs/curl/decisions-api/decision-status for SiftScience/code#25317
sift/client.py
Outdated
| Args: | ||
| user_id: The ID of a user. | ||
| session_id: The ID of a session |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: . is missing (for the sake of consistency)
tests/test_client.py
Outdated
|
|
||
| def test_get_session_decisions(self): | ||
| mock_response = mock.Mock() | ||
| mock_response.content = '{"decisions":{"payment_abuse":{"decision":{"id":"user_decision"},"time":1468707128659,"webhook_succeeded":false}}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More realistic example will be account_takeover instead of payment_abuse. It will be also better if we have session_decision as an ID, as we're adding a function to query session decisions.
As for the examples in the real world, I'll sync up with you on how we can use api3 client tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good. Left a couple of comments. Please make sure to add an example in README.md, as well. cc @mjouahri
tests/test_client.py
Outdated
|
|
||
| def test_get_session_decisions(self): | ||
| mock_response = mock.Mock() | ||
| mock_response.content = '{"decisions":{"account_abuse": {"decision": {"id": "session_decision"},"time": 1461963839151,"webhook_succeeded": true}}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant account_takeover here because session decision is only available for ATO, though it doesn't affect the test result itself.
jintaekim20
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left another comment regarding mock response. Otherwise, LGTM.
Purpose:
Technical overview:
Testing Plan
Deployment
Related: https://github.com/SiftScience/code/issues/25317