(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
+13 -25
View File
@@ -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"]
)