Skip to content

Commit 896f990

Browse files
authored
Update fraud check (#261)
* only sending verify v2 fraud_check when set to false * Bump version: 3.5.0 → 3.5.1
1 parent c0f1a5b commit 896f990

File tree

6 files changed

+18
-3
lines changed

6 files changed

+18
-3
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 3.5.0
2+
current_version = 3.5.1
33
commit = True
44
tag = False
55

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 3.5.1
2+
- Updating the internal use of the `fraud_check` parameter in the Vonage Verify V2 API
3+
14
# 3.5.0
25
- Adding support for V2 of the Vonage Verify API
36
- Multiple authentication channels are supported (sms, voice, email, whatsapp, whatsapp interactive messages and silent authentication)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name="vonage",
14-
version="3.5.0",
14+
version="3.5.1",
1515
description="Vonage Server SDK for Python",
1616
long_description=long_description,
1717
long_description_content_type="text/markdown",

src/vonage/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .client import *
22
from .ncco_builder.ncco import *
33

4-
__version__ = "3.5.0"
4+
__version__ = "3.5.1"

src/vonage/verify2.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def __init__(self, client):
2222
self._auth_type = 'jwt'
2323

2424
def new_request(self, params: dict):
25+
self._remove_unnecessary_fraud_check(params)
2526
try:
2627
params_to_verify = copy.deepcopy(params)
2728
Verify2.VerifyRequest.parse_obj(params_to_verify)
@@ -61,6 +62,10 @@ def cancel_verification(self, request_id: str):
6162
auth_type=self._auth_type,
6263
)
6364

65+
def _remove_unnecessary_fraud_check(self, params):
66+
if 'fraud_check' in params and params['fraud_check'] != False:
67+
del params['fraud_check']
68+
6469
class VerifyRequest(BaseModel):
6570
brand: str
6671
workflow: List[dict]

tests/test_verify2.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,3 +452,10 @@ def test_cancel_verification_error_not_found():
452452
str(err.value)
453453
== "Not Found: Request 'c11236f4-00bf-4b89-84ba-88b25df97315' was not found or it has been verified already. (https://developer.nexmo.com/api-errors#not-found)"
454454
)
455+
456+
457+
def test_remove_unnecessary_fraud_check():
458+
params = {'brand': 'ACME, Inc', 'workflow': [{'channel': 'sms', 'to': '447700900000'}], 'fraud_check': True}
459+
verify2._remove_unnecessary_fraud_check(params)
460+
461+
assert 'fraud_check' not in params

0 commit comments

Comments
 (0)