Skip to content

Commit

Permalink
deal with SUCCESSFUL pinpoint receipts
Browse files Browse the repository at this point in the history
  • Loading branch information
sastels committed May 9, 2024
1 parent 6770073 commit cb37bf2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/celery/process_pinpoint_receipts_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def process_pinpoint_results(self, response):
provider_response = receipt["messageStatusDescription"]

notification_status = determine_pinpoint_status(status, provider_response)

if notification_status == NOTIFICATION_SENT:
return # we don't want to update the status to sent if it's already sent

if not notification_status:
current_app.logger.warning(f"unhandled provider response for reference {reference}, received '{provider_response}'")
notification_status = NOTIFICATION_TECHNICAL_FAILURE # revert to tech failure by default
Expand Down Expand Up @@ -125,6 +129,8 @@ def determine_pinpoint_status(status: str, provider_response: str) -> Union[str,

if status == "DELIVERED":
return NOTIFICATION_DELIVERED
elif status == "SUCCESSFUL": # carrier has accepted the message but it hasn't gone to the phone yet
return NOTIFICATION_SENT

response_lower = provider_response.lower()

Expand Down

0 comments on commit cb37bf2

Please sign in to comment.