(20241227) Payment auth fixed.

This commit is contained in:
2024-12-27 09:53:32 +05:30
parent a26bb2e85f
commit 2349bf3d3e
2 changed files with 11 additions and 7 deletions
+5 -5
View File
@@ -140,9 +140,9 @@ class PaymentController:
success = False success = False
# Get a token id: # Get a token id:
token_key = await current_app.core_auth_token_controller.get_token_key( token_key = await current_app.core_auth_token_controller.generate_token_key(
db_conn = db_conn, sql_conn = db_conn,
mongo_conn = mongo_conn, mongo_data_conn = mongo_conn,
auth_token = auth_token, auth_token = auth_token,
token_notes = {}, token_notes = {},
session_token = session_token session_token = session_token
@@ -150,8 +150,8 @@ class PaymentController:
# Immediately save the details against that token id: # Immediately save the details against that token id:
success = await current_app.core_auth_token_controller.set_token( success = await current_app.core_auth_token_controller.set_token(
db_conn = db_conn, sql_conn = db_conn,
mongo_conn = mongo_conn, mongo_data_conn = mongo_conn,
token_key = token_key, token_key = token_key,
auth_token = auth_token, auth_token = auth_token,
token_notes = {}, token_notes = {},
+6 -2
View File
@@ -182,6 +182,11 @@ def main():
api_key = creds["apiKey"] api_key = creds["apiKey"]
access_token = creds["accessToken"] access_token = creds["accessToken"]
# Get the instruments of interest:
response = httpx.post(url = r"https://api.thecaoffice.com/markets/watchlist/distincts")
instruments_of_interest = response.json()["data"]["rs0"]
symbols_of_interest = [i["symbol"] for i in instruments_of_interest]
# Create an instance of Zerodha's Kite connection: # Create an instance of Zerodha's Kite connection:
kite = KiteConnect(api_key = api_key) kite = KiteConnect(api_key = api_key)
kite.set_access_token(access_token) kite.set_access_token(access_token)
@@ -196,8 +201,7 @@ def main():
instruments += kite.instruments(exchange = "BCD") instruments += kite.instruments(exchange = "BCD")
# Pick the instruments of interest: # Pick the instruments of interest:
instruments = instruments[:1250] instruments = [TradingSymbol.from_zerodha_kite(i) for i in instruments if i["tradingsymbol"] in symbols_of_interest]
instruments = [TradingSymbol.from_zerodha_kite(i) for i in instruments]
# Create the lookup: # Create the lookup:
for i in instruments: for i in instruments: