Updated config

This commit is contained in:
2025-09-19 19:20:32 -04:00
parent 8a6da448bb
commit 569e76f21e
6 changed files with 43 additions and 19 deletions

View File

@@ -9,12 +9,20 @@ logger = logging.getLogger(__name__)
# Load Authorize.net credentials
ApplicationConfig = load_config()
API_LOGIN_ID = '9U6w96gZmX' # Sandbox credentials
TRANSACTION_KEY = '94s6Qy458mMNJr7G'
API_LOGIN_ID = ApplicationConfig.API_LOGIN_ID
TRANSACTION_KEY = ApplicationConfig.TRANSACTION_KEY
# Set Authorize.net environment based on configuration
from authorizenet.constants import constants
constants.show_url_on_request = True
if ApplicationConfig.CURRENT_SETTINGS == 'PRODUCTION':
constants.environment = constants.PRODUCTION
else:
constants.environment = constants.SANDBOX
constants.show_url_on_request = True
def verify_customer_authorize_account(db: Session, customer_id: int) -> dict:
"""
Verify if customer has a valid Authorize.net account set up for charging.

View File

@@ -19,16 +19,17 @@ logger = logging.getLogger(__name__)
# Load Authorize.net credentials
ApplicationConfig = load_config()
# API_LOGIN_ID = ApplicationConfig.API_LOGIN_ID
# TRANSACTION_KEY = ApplicationConfig.TRANSACTION_KEY
# Authorize.net credentials (Sandbox Test Credentials)
API_LOGIN_ID = '9U6w96gZmX'
TRANSACTION_KEY = '94s6Qy458mMNJr7G'
# --- MODIFICATION: Set the environment globally ---
# Set this to SANDBOX for testing, PRODUCTION for live
constants.show_url_on_request = True # Very useful for debugging
API_LOGIN_ID = ApplicationConfig.API_LOGIN_ID
TRANSACTION_KEY = ApplicationConfig.TRANSACTION_KEY
# Set Authorize.net environment based on configuration
if ApplicationConfig.CURRENT_SETTINGS == 'PRODUCTION':
constants.environment = constants.PRODUCTION
else:
constants.environment = constants.SANDBOX
constants.show_url_on_request = True # Very useful for debugging
def _get_authnet_error_message(response):

View File

@@ -17,11 +17,17 @@ logger = logging.getLogger(__name__)
# Load Authorize.net credentials
ApplicationConfig = load_config()
API_LOGIN_ID = '9U6w96gZmX'
TRANSACTION_KEY = '94s6Qy458mMNJr7G'
constants.show_url_on_request = True
API_LOGIN_ID = ApplicationConfig.API_LOGIN_ID
TRANSACTION_KEY = ApplicationConfig.TRANSACTION_KEY
# Set Authorize.net environment based on configuration
if ApplicationConfig.CURRENT_SETTINGS == 'PRODUCTION':
constants.environment = constants.PRODUCTION
else:
constants.environment = constants.SANDBOX
constants.show_url_on_request = True
def _get_error_message(response):
"""

View File

@@ -13,11 +13,17 @@ logger = logging.getLogger(__name__)
# Load Authorize.net credentials
ApplicationConfig = load_config()
API_LOGIN_ID = '9U6w96gZmX'
TRANSACTION_KEY = '94s6Qy458mMNJr7G'
constants.show_url_on_request = True
API_LOGIN_ID = ApplicationConfig.API_LOGIN_ID
TRANSACTION_KEY = ApplicationConfig.TRANSACTION_KEY
# Set Authorize.net environment based on configuration
if ApplicationConfig.CURRENT_SETTINGS == 'PRODUCTION':
constants.environment = constants.PRODUCTION
else:
constants.environment = constants.SANDBOX
constants.show_url_on_request = True
def _get_authnet_error_message(response):
"""

View File

@@ -13,6 +13,9 @@ def load_config(mode=os.environ.get('MODE')):
return ApplicationConfig
elif mode == 'DEVELOPMENT':
print("poop")
print("poop")
print("poop")
from settings_dev import ApplicationConfig
return ApplicationConfig
else:

View File

@@ -4,6 +4,8 @@ class ApplicationConfig:
"""
Basic Configuration for a generic User
"""
API_LOGIN_ID = '9U6w96gZmX'
TRANSACTION_KEY = '94s6Qy458mMNJr7G'
CURRENT_SETTINGS = 'DEVELOPMENT'
# databases info
POSTGRES_USERNAME = 'postgres'
@@ -32,5 +34,3 @@ class ApplicationConfig:
# # Authorize.net credentials (Sandbox Test Credentials)
# API_LOGIN_ID = '5KP3u95bQpv'
# TRANSACTION_KEY = '346HZ32z3fP4hTG2'
API_LOGIN_ID = '9U6w96gZmX'
TRANSACTION_KEY = '94s6Qy458mMNJr7G'