From 1bd2b105aef94632fb3c1db54ad0594920ae8a51 Mon Sep 17 00:00:00 2001 From: Edwin Eames Date: Sun, 1 Feb 2026 12:36:58 -0500 Subject: [PATCH] Refactor imports in payment router - Move local imports of user_create and user_delete to top level - Clean up function bodies --- app/routers/payment.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/routers/payment.py b/app/routers/payment.py index 3b58f40..90959f4 100644 --- a/app/routers/payment.py +++ b/app/routers/payment.py @@ -7,7 +7,7 @@ from sqlalchemy.orm import Session from decimal import Decimal from .. import crud, models, schemas, database -from ..services import payment_service +from ..services import payment_service, user_create, user_delete from ..services.payment_service import parse_authnet_response from ..constants import TransactionStatus, TransactionType, STATE_ID_TO_ABBREVIATION from config import load_config @@ -98,7 +98,6 @@ def update_card_for_customer(customer_id: int, card_id: int, card_info: schemas. # If payment profile ID is null, refresh from Authorize.Net to sync if not db_card.auth_net_payment_profile_id: logger.debug(f"Payment profile ID is null for card {card_id}, refreshing from Authorize.Net") - from ..services import user_create user_create.refresh_customer_payment_profiles(db, customer_id, db_customer.auth_net_profile_id) # Re-fetch the card to get the updated payment profile ID @@ -107,7 +106,6 @@ def update_card_for_customer(customer_id: int, card_id: int, card_info: schemas. # Delete existing payment profile if it exists if db_card.auth_net_payment_profile_id: - from ..services import user_delete delete_success = user_delete._delete_payment_profile( db_customer.auth_net_profile_id, db_card.auth_net_payment_profile_id ) @@ -291,7 +289,6 @@ def authorize_saved_card(customer_id: int, transaction_req: schemas.TransactionA logger.debug(f"🔧 DETECTED PAYMENT PROFILE ISSUE - Triggering auto-recovery for customer {customer_id}") # Auto-recover: Refresh payment profiles before transaction - from ..services import user_create recovery_success = user_create.refresh_customer_payment_profiles( db, customer_id, db_customer.auth_net_profile_id )