From e3d71965bba808afd024dcfb86cdd1ee520f315b Mon Sep 17 00:00:00 2001 From: khushal Date: Mon, 30 Dec 2024 10:53:31 +0530 Subject: [PATCH] (20241230) Method correction. --- .../finstitutions/trading/oauth/request.py | 2 +- controllers_v2/core/auth_token.py | 9 +++++++++ .../finstitutions/payments/all_payments.py | 5 +++++ controllers_v2/finstitutions/payments/base.py | 5 +++++ .../payments/safaricom_mpesa_express.py | 5 +++++ wsio/finstitutions/trading/main.py | 12 ++++++------ 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/api/blueprints/finstitutions/trading/oauth/request.py b/api/blueprints/finstitutions/trading/oauth/request.py index d4f4b73..1fba50b 100644 --- a/api/blueprints/finstitutions/trading/oauth/request.py +++ b/api/blueprints/finstitutions/trading/oauth/request.py @@ -112,7 +112,7 @@ def init(blueprint_setup_state): # --------------------------------------------------------------------------------------------------------------------- -@trading_oauth_request_bp.route("", methods = ["GET"]) +@trading_oauth_request_bp.route("", methods = ["GET", "POST"]) @set_api_version(api_version = "1.0.0") @read_input(sanitize_headers = False, sanitize_data = False) @get_session_info(key = "X-Session-Token", session_coro = "get_session") diff --git a/controllers_v2/core/auth_token.py b/controllers_v2/core/auth_token.py index 9ec024b..6b50519 100644 --- a/controllers_v2/core/auth_token.py +++ b/controllers_v2/core/auth_token.py @@ -394,6 +394,15 @@ class CoreAuthTokenController(CoreBaseModel): # Done here: return success + async def modify_status( + self, + sql_conn: AsyncMySQL, + mongo_data_conn: AsyncMongo, + auth_token: CoreAuthTokenModel, + ): + + pass + # ┏┓┳┓┳┳┳┓ ┳┓ • # ┃ ┣┫┃┃┃┃ ━━ ┣┫┏┓╋┏┓┓┏┓┓┏┏┓ # ┗┛┛┗┗┛┻┛ ┛┗┗ ┗┛ ┗┗ ┗┛┗ diff --git a/controllers_v2/finstitutions/payments/all_payments.py b/controllers_v2/finstitutions/payments/all_payments.py index 15328c1..c5bd59f 100644 --- a/controllers_v2/finstitutions/payments/all_payments.py +++ b/controllers_v2/finstitutions/payments/all_payments.py @@ -178,6 +178,11 @@ class AllPaymentsController(PaymentsController): :return: A structured response about the process of updating the payment event. """ + # There are 3 main steps here: + # 01. Add the payment's update event to the main record, + # 02. Add the receipt (if payment successful), + # 03. Disable the payment auth-token if the gateway says that the credentials are invalid. + raise NotImplementedError diff --git a/controllers_v2/finstitutions/payments/base.py b/controllers_v2/finstitutions/payments/base.py index 30d38d2..e8f16ad 100644 --- a/controllers_v2/finstitutions/payments/base.py +++ b/controllers_v2/finstitutions/payments/base.py @@ -538,6 +538,11 @@ class PaymentsController(CoreAuthTokenController, ABC): :return: A structured response about the process of updating the payment event. """ + # There are 3 main steps here: + # 01. Add the payment's update event to the main record, + # 02. Add the receipt (if payment successful), + # 03. Disable the payment auth-token if the gateway says that the credentials are invalid. + pass diff --git a/controllers_v2/finstitutions/payments/safaricom_mpesa_express.py b/controllers_v2/finstitutions/payments/safaricom_mpesa_express.py index cdf3872..121f9bd 100644 --- a/controllers_v2/finstitutions/payments/safaricom_mpesa_express.py +++ b/controllers_v2/finstitutions/payments/safaricom_mpesa_express.py @@ -269,6 +269,11 @@ class SafaricomMPesaExpressPaymentsController(PaymentsController): :return: A structured response about the process of updating the payment event. """ + # There are 3 main steps here: + # 01. Add the payment's update event to the main record, + # 02. Add the receipt (if payment successful), + # 03. Disable the payment auth-token if the gateway says that the credentials are invalid. + # Start by assuming failure: result = PaymentCallbackResult() diff --git a/wsio/finstitutions/trading/main.py b/wsio/finstitutions/trading/main.py index ff44ad3..8126f13 100644 --- a/wsio/finstitutions/trading/main.py +++ b/wsio/finstitutions/trading/main.py @@ -331,12 +331,12 @@ async def init(): cwd = files.get_cwd() parent_dir = cwd ssl_context = get_ssl_context( - ca_file = "/etc/ssl/dbu/ca.pem", - cert_file = "/etc/ssl/dbu/fullchain.pem", - key_file = "/etc/ssl/dbu/privkey.pem" - # ca_file = os.path.join(parent_dir, "creds", "kafka", "cert_authority.pem"), - # cert_file = os.path.join(parent_dir, "creds", "kafka", "fullchain.pem"), - # key_file = os.path.join(parent_dir, "creds", "kafka", "privkey.pem") + # ca_file = "/etc/ssl/dbu/ca.pem", + # cert_file = "/etc/ssl/dbu/fullchain.pem", + # key_file = "/etc/ssl/dbu/privkey.pem" + ca_file = os.path.join(parent_dir, "creds", "kafka", "cert_authority.pem"), + cert_file = os.path.join(parent_dir, "creds", "kafka", "fullchain.pem"), + key_file = os.path.join(parent_dir, "creds", "kafka", "privkey.pem") ) sio.start_background_task( ticks_from_kafka,