fix(payments): improve payment activation error handling
Add validation for provider payment IDs in YooKassa webhook processing and ensure activation details are checked for null values in CryptoPay, FreeKassa, Platega, and Stars services. This prevents potential runtime errors during payment processing and enhances logging for better debugging.
This commit is contained in:
@@ -272,6 +272,10 @@ class PlategaService:
|
||||
sale_mode=sale_mode,
|
||||
traffic_gb=payment_months if sale_mode == "traffic" else None,
|
||||
)
|
||||
if not activation or not activation.get("end_date"):
|
||||
raise RuntimeError(
|
||||
f"Platega webhook: activation failed for payment {payment.payment_id}"
|
||||
)
|
||||
|
||||
referral_bonus = None
|
||||
if sale_mode != "traffic":
|
||||
|
||||
Reference in New Issue
Block a user