fix payment
This commit is contained in:
1 parent
4f7486152c
commit
bb3ddd1610
47 files changed
+2137
-51
No files matched your search
@@ -4,6 +4,12 @@ The input is the customer local mobile number, retaining its leading zero.
|
||||
This is a deterministic identifier, not a random or unique-per-notice value.
|
||||
"""
|
||||
|
||||
def normalize_deposit_identifier(value):
|
||||
"""Remove leading zeroes from deposit IDs only; retain internal/check digits."""
|
||||
value = str(value or '').translate(str.maketrans('۰۱۲۳۴۵۶۷۸۹٠١٢٣٤٥٦٧٨٩', '01234567890123456789')).strip()
|
||||
return (value.lstrip('0') or '0') if value else ''
|
||||
|
||||
|
||||
def generate_id_algorithm(id_code: str) -> str:
|
||||
"""
|
||||
Calculates the verification code based on the reverse-engineered logic:
|
||||
@@ -39,4 +45,4 @@ def generate_id_algorithm(id_code: str) -> str:
|
||||
# فرمتدهی دو رقمی (مثلاً 6 میشود 06)
|
||||
check_digit_str = f"{check_digit:02}"
|
||||
|
||||
return f"{id_code}{check_digit_str}"
|
||||
return normalize_deposit_identifier(f"{id_code}{check_digit_str}")
|
||||
Reference in new issue
Block a user