(20241216) Payment auth bug fix.
This commit is contained in:
@@ -170,33 +170,21 @@ async def authorize_payment_gateway(
|
||||
|
||||
if inbound_data.client == "safaricomMPesaExpress":
|
||||
|
||||
auth_token = CoreAuthTokenModel(
|
||||
serviceType = "paymentGateway",
|
||||
client = inbound_data.client,
|
||||
authType = "auth",
|
||||
auth = inbound_data.auth.model_dump(),
|
||||
user = kwargs.get("session_info"),
|
||||
clientUserId = {
|
||||
"businessShortCode": inbound_data.auth.businessShortCode
|
||||
},
|
||||
status = "active",
|
||||
syncFreq = 60
|
||||
)
|
||||
|
||||
token_id = await current_app.core_auth_token_controller.get_token_id(
|
||||
success = await current_app.payment_controller.set_token_direct(
|
||||
db_conn = current_app.sql_writer,
|
||||
mongo_conn = current_app.data_mongo,
|
||||
auth_token = auth_token,
|
||||
token_notes = {},
|
||||
session_token = inbound_headers["X-Session-Token"]
|
||||
)
|
||||
|
||||
success = await current_app.core_auth_token_controller.set_token(
|
||||
db_conn = current_app.sql_writer,
|
||||
mongo_conn = current_app.data_mongo,
|
||||
token_id = token_id,
|
||||
auth_token = auth_token,
|
||||
token_notes = {},
|
||||
auth_token = CoreAuthTokenModel(
|
||||
serviceType = "paymentGateway",
|
||||
client = inbound_data.client,
|
||||
authType = "auth",
|
||||
auth = inbound_data.auth.model_dump(),
|
||||
user = kwargs.get("session_info"),
|
||||
clientUserId = {
|
||||
"businessShortCode": inbound_data.auth.businessShortCode
|
||||
},
|
||||
status = "active",
|
||||
syncFreq = 60
|
||||
),
|
||||
session_token = inbound_headers["X-Session-Token"]
|
||||
)
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ from utils_v2.api.async_quart import (
|
||||
|
||||
# GMail-related utils:
|
||||
from utils_v2.goog.gmail.gmail_client import SCOPES_GMAIL_MAIL_MANAGEMENT
|
||||
from utils_v2.goog.models.data.auth_tokens import GoogleAuthTokens
|
||||
from utils_v2.goog.models.auth_tokens import GoogleAuthTokens
|
||||
|
||||
# Common:
|
||||
from shared import constants
|
||||
|
||||
@@ -64,7 +64,7 @@ from utils_v2.api.async_quart import (
|
||||
|
||||
# GMail-related utils:
|
||||
from utils_v2.goog.gmail.gmail_client import SCOPES_GMAIL_MAIL_MANAGEMENT
|
||||
from utils_v2.goog.models.data.auth_tokens import GoogleAuthTokens
|
||||
from utils_v2.goog.models.auth_tokens import GoogleAuthTokens
|
||||
|
||||
# Common:
|
||||
from shared import constants
|
||||
|
||||
@@ -64,7 +64,7 @@ from utils_v2.api.async_quart import (
|
||||
|
||||
# GMail-related utils:
|
||||
from utils_v2.goog.gmail.gmail_client import SCOPES_GMAIL_MAIL_MANAGEMENT
|
||||
from utils_v2.goog.models.data.auth_tokens import GoogleAuthTokens
|
||||
from utils_v2.goog.models.auth_tokens import GoogleAuthTokens
|
||||
|
||||
# Common:
|
||||
from shared import constants
|
||||
|
||||
@@ -63,7 +63,7 @@ from utils_v2.api.async_quart import (
|
||||
|
||||
# GMail-related utils:
|
||||
from utils_v2.goog.gmail.gmail_client import SCOPES_GMAIL_MAIL_MANAGEMENT
|
||||
from utils_v2.goog.models.data.auth_tokens import GoogleAuthTokens
|
||||
from utils_v2.goog.models.auth_tokens import GoogleAuthTokens
|
||||
|
||||
# Common:
|
||||
from shared import constants
|
||||
|
||||
@@ -166,7 +166,7 @@ async def authorize_sms_client(
|
||||
|
||||
if inbound_data.smsClient == "nimbusSmsIndia":
|
||||
|
||||
success = await current_app.sms_controller.set_token(
|
||||
success = await current_app.sms_controller.set_token_direct(
|
||||
db_conn = current_app.sql_writer,
|
||||
mongo_conn = current_app.data_mongo,
|
||||
auth_token = CoreAuthTokenModel(
|
||||
@@ -193,7 +193,7 @@ async def authorize_sms_client(
|
||||
|
||||
elif inbound_data.smsClient == "savvyBulkSmsKenya":
|
||||
|
||||
success = await current_app.sms_controller.set_token(
|
||||
success = await current_app.sms_controller.set_token_direct(
|
||||
db_conn = current_app.sql_writer,
|
||||
mongo_conn = current_app.data_mongo,
|
||||
auth_token = CoreAuthTokenModel(
|
||||
|
||||
Reference in New Issue
Block a user