Skip to content

Commit 2395a63

Browse files
Sudipta MohapatraSudipta Mohapatra
authored andcommitted
adding postback for updates
1 parent 98cdba3 commit 2395a63

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

sailthru/sailthru_client.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,30 @@ def receive_verify_post(self, post_params):
597597

598598
return True
599599

600+
def receive_update_post(self, post_params):
601+
"""
602+
Update postbacks
603+
"""
604+
605+
if isinstance(post_params, dict):
606+
required_params = ['action', 'email', 'sig']
607+
if not self.check_for_valid_postback_actions(required_params, post_params):
608+
return False
609+
else:
610+
return False
611+
612+
if post_params['action'] != 'update':
613+
return False
614+
615+
signature = post_params['sig']
616+
post_params = post_params.copy()
617+
del post_params['sig']
618+
619+
if signature != get_signature_hash(post_params, self.secret):
620+
return False
621+
622+
return True
623+
600624
def receive_optout_post(self, post_params):
601625
"""
602626
Optout postbacks

0 commit comments

Comments
 (0)