added config for authorize
This commit is contained in:
@@ -22,6 +22,10 @@ from authorizenet.apicontrollers import (
|
|||||||
createCustomerPaymentProfileController
|
createCustomerPaymentProfileController
|
||||||
|
|
||||||
)
|
)
|
||||||
|
from config import load_config # Assuming you have this
|
||||||
|
|
||||||
|
# Load Authorize.net credentials
|
||||||
|
ApplicationConfig = load_config()
|
||||||
# --- ROUTER DEFINITION ---
|
# --- ROUTER DEFINITION ---
|
||||||
|
|
||||||
router = APIRouter(
|
router = APIRouter(
|
||||||
@@ -30,11 +34,20 @@ router = APIRouter(
|
|||||||
responses={404: {"description": "Not found"}},
|
responses={404: {"description": "Not found"}},
|
||||||
)
|
)
|
||||||
|
|
||||||
API_LOGIN_ID = '9U6w96gZmX'
|
if ApplicationConfig.CURRENT_SETTINGS == 'PRODUCTION':
|
||||||
TRANSACTION_KEY = '94s6Qy458mMNJr7G'
|
constants.environment = constants.PRODUCTION
|
||||||
|
VALIDATION_MODE = "liveMode"
|
||||||
|
API_LOGIN_ID = ApplicationConfig.API_LOGIN_ID
|
||||||
|
TRANSACTION_KEY = ApplicationConfig.TRANSACTION_KEY
|
||||||
|
else:
|
||||||
|
constants.environment = constants.SANDBOX
|
||||||
|
constants.show_url_on_request = True
|
||||||
|
VALIDATION_MODE = "testMode"
|
||||||
|
API_LOGIN_ID = ApplicationConfig.API_LOGIN_ID
|
||||||
|
TRANSACTION_KEY = ApplicationConfig.TRANSACTION_KEY
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
constants.show_url_on_request = True
|
|
||||||
constants.environment = constants.SANDBOX
|
|
||||||
state_abbrevs = ['MA', 'RI', 'NH', 'ME', 'VT', 'CT', 'NY']
|
state_abbrevs = ['MA', 'RI', 'NH', 'ME', 'VT', 'CT', 'NY']
|
||||||
|
|
||||||
@router.post("/maintenance/migrate-cards-now")
|
@router.post("/maintenance/migrate-cards-now")
|
||||||
@@ -176,8 +189,12 @@ def run_card_migration_synchronously():
|
|||||||
validationMode="testMode"
|
validationMode="testMode"
|
||||||
)
|
)
|
||||||
controller = createCustomerPaymentProfileController(request)
|
controller = createCustomerPaymentProfileController(request)
|
||||||
controller.setenvironment(constants.PRODUCTION)
|
if ApplicationConfig.CURRENT_SETTINGS == 'PRODUCTION':
|
||||||
controller.execute()
|
controller.setenvironment(constants.PRODUCTION)
|
||||||
|
controller.execute()
|
||||||
|
else:
|
||||||
|
controller.execute()
|
||||||
|
|
||||||
response = controller.getresponse()
|
response = controller.getresponse()
|
||||||
if response.messages.resultCode == "Ok":
|
if response.messages.resultCode == "Ok":
|
||||||
return str(response.customerPaymentProfileId)
|
return str(response.customerPaymentProfileId)
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ class ApplicationConfig:
|
|||||||
"""
|
"""
|
||||||
Basic Configuration for a generic User
|
Basic Configuration for a generic User
|
||||||
"""
|
"""
|
||||||
CURRENT_SETTINGS = 'LOCAL'
|
|
||||||
|
print("USING TESTING APPLICATIONCONFIG!!!!!")
|
||||||
|
CURRENT_SETTINGS = 'DEVELOPMENT'
|
||||||
# databases info
|
# databases info
|
||||||
POSTGRES_USERNAME = 'postgres'
|
POSTGRES_USERNAME = 'postgres'
|
||||||
POSTGRES_PW = 'password'
|
POSTGRES_PW = 'password'
|
||||||
@@ -16,5 +18,17 @@ class ApplicationConfig:
|
|||||||
POSTGRES_SERVER,
|
POSTGRES_SERVER,
|
||||||
POSTGRES_DBNAME00
|
POSTGRES_DBNAME00
|
||||||
)
|
)
|
||||||
|
|
||||||
SQLALCHEMY_BINDS = {'eamco': SQLALCHEMY_DATABASE_URI}
|
SQLALCHEMY_BINDS = {'eamco': SQLALCHEMY_DATABASE_URI}
|
||||||
|
|
||||||
|
origins = [
|
||||||
|
"http://localhost:9000",
|
||||||
|
"https://localhost:9513",
|
||||||
|
"http://localhost:9514",
|
||||||
|
"http://localhost:9512",
|
||||||
|
"http://localhost:9511",
|
||||||
|
"http://localhost:5173", # Frontend port
|
||||||
|
"http://localhost:9516", # Authorize service port
|
||||||
|
|
||||||
|
]
|
||||||
|
API_LOGIN_ID = '9U6w96gZmX'
|
||||||
|
TRANSACTION_KEY = '94s6Qy458mMNJr7G'
|
||||||
|
|||||||
Reference in New Issue
Block a user