Add process_mmg_responses

Refactor process_firetext_responses
Removed the abstract ClientResponses for firetext and mmg. There is a map for each response to handle the status codes sent by each client.
Since MMG has about 20 different status code, none of which seem to be a pending state (unlike firetext that has 3 status one for pending - network delay).
For MMG status codes, look for 00 as successful, everything else is assumed to be a failure.
This commit is contained in:
Rebecca Law
2016-04-06 14:31:33 +01:00
parent f2ee8f3eb7
commit 4806123d5c
11 changed files with 343 additions and 191 deletions

View File

@@ -313,9 +313,6 @@ def send_email(service_id, notification_id, subject, from_address, encrypted_not
@notify_celery.task(name='send-sms-code')
def send_sms_code(encrypted_verification):
verification_message = encryption.decrypt(encrypted_verification)
# send_sms_via_firetext(validate_and_format_phone_number(verification_message['to']),
# verification_message['secret_code'],
# 'send-sms-code')
try:
mmg_client.send_sms(validate_and_format_phone_number(verification_message['to']),
verification_message['secret_code'],