Fixed e00007 error

This commit is contained in:
2025-09-28 10:17:35 -04:00
parent 5b4a05566a
commit 940be20852
10 changed files with 179 additions and 124 deletions

View File

@@ -28,6 +28,9 @@ class TransactionType(enum.IntEnum):
CHARGE = 0
AUTHORIZE = 1
CAPTURE = 3
# --- NEW CIM CORE FUNCTIONS ---
STATE_ID_TO_ABBREVIATION = {
0: "MA",
@@ -54,7 +57,7 @@ def _parse_authnet_response(response: Optional[AuthNetResponse]) -> Tuple[Transa
else:
print("DEBUG: No messages attribute")
if response is not None and hasattr(response, 'messages') and response.messages.resultCode == "Ok":
if response.messages.resultCode == "Ok":
print("DEBUG: Taking APPROVED path")
status = TransactionStatus.APPROVED
auth_net_transaction_id = None
@@ -491,8 +494,11 @@ def _nuclear_e00121_payment_profile_cleanup(db: Session, customer_id: int, card_
customer = crud.get_customer(db, customer_id)
# Format card data for recreation
exp_year = card.expiration_year.zfill(4) if len(card.expiration_year) < 4 else card.expiration_year
exp_month = card.expiration_month.zfill(2) if len(card.expiration_month) < 2 else card.expiration_month
# Convert to string first to handle cases where database returns int instead of string
exp_year_str = str(card.expiration_year)
exp_month_str = str(card.expiration_month)
exp_year = exp_year_str.zfill(4) if len(exp_year_str) < 4 else exp_year_str
exp_month = exp_month_str.zfill(2) if len(exp_month_str) < 2 else exp_month_str
exp_date = f"{exp_year}-{exp_month}"
card_create_data = schemas.CardCreate(