Skip to content

Commit d371275

Browse files
authored
Feature/improve hmac validator (#260)
* Update util.py * Update util.py
1 parent 1dee6ce commit d371275

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Adyen/util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ def generate_notification_sig(dict_object, hmac_key):
3737
def is_valid_hmac_notification(dict_object, hmac_key):
3838
dict_object = dict_object.copy()
3939

40+
if 'notificationItems' in dict_object:
41+
dict_object = dict_object['notificationItems'][0]['NotificationRequestItem']
42+
4043
if 'additionalData' in dict_object:
4144
if dict_object['additionalData']['hmacSignature'] == "":
4245
raise ValueError("Must Provide hmacSignature in additionalData")

0 commit comments

Comments
 (0)