(20241216) Payment auth bug fix.

This commit is contained in:
2024-12-16 16:00:52 +05:30
parent 064495163f
commit 0b9976fadb
19 changed files with 589 additions and 473 deletions
+9 -17
View File
@@ -21,7 +21,8 @@
N/A
"""
import asyncio
# *****************************************************************************************************************
# ***** ****
# *** IMPORT ***
@@ -58,9 +59,9 @@ from models.api.sms.send import (
)
# SMS Clients:
from utils_v2.sms.models.behaviour.nimbus.async_nimbus import AsyncNimbusSMS
from utils_v2.sms.models.behaviour.savvy_bulk_sms.async_savvy_bulk_sms import AsyncSavvyBulkSMS
from utils_v2.sms.models.data.sms_message import SentSMSMessageModel
from utils_v2.sms.india.nimbus.controllers.async_nimbus import AsyncNimbusSMS
from utils_v2.sms.kenya.savvy_bulk_sms.controllers.async_savvy_bulk_sms import AsyncSavvyBulkSMS
from utils_v2.sms.models.sms_message import SentSMSMessageModel
# To work with MongoDB:
from bson import ObjectId
@@ -72,6 +73,9 @@ from typing import Literal, List, Dict, Any
# To make API calls:
import httpx
# For asynchronous activities:
import asyncio
# *****************************************************************************************************************
# ***** ****
@@ -130,7 +134,7 @@ class SMSController:
# ┛┗┗┻┗┛┗
@staticmethod
async def set_token(
async def set_token_direct(
db_conn: AsyncMySQL,
mongo_conn: AsyncMongo,
auth_token: CoreAuthTokenModel,
@@ -292,7 +296,6 @@ class SMSController:
self,
mongo_conn: AsyncMongo,
http_client: httpx.AsyncClient,
# token_id: ObjectId | str,
auth_token: CoreAuthTokenModel,
messages: List[NimbusSMSIndiaMessage | SavvyBulkSMSKenyaMessage]
) -> SMSSendManyResults:
@@ -300,17 +303,6 @@ class SMSController:
# Start by assuming failure:
send_results = SMSSendManyResults()
# # We first load the authorization tokens:
# auth_token = await self.get_token(
# mongo_conn = mongo_conn,
# token_id = token_id,
# )
#
# # If we failed to load the authorization tokens:
# if not auth_token:
# send_results.message = f"no such token id '{token_id}'"
# return send_results
# Now we route the message to the appropriate client:
match auth_token.client:
case "nimbusSmsIndia":