From 467cffb97d5603d707d4a269257e1343c51c35c2 Mon Sep 17 00:00:00 2001 From: wwwwwwwww <526125649@qq.com> Date: Thu, 11 Jun 2026 09:07:44 +0800 Subject: [PATCH] 1 --- video-gen-api/app/services/payment.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/video-gen-api/app/services/payment.py b/video-gen-api/app/services/payment.py index dd4bc232..546e7af4 100644 --- a/video-gen-api/app/services/payment.py +++ b/video-gen-api/app/services/payment.py @@ -142,7 +142,7 @@ _alipay_client = None _alipay_client_app_id = None -def _get_alipay_client(app_id: str, private_key: str, public_key: str, gateway: str = ""): +def _get_alipay_client(app_id: str, private_key: str, public_key: str, gateway: str = "", notify_url: str = ""): """Get or create an Alipay client. Recreated if app_id changes.""" global _alipay_client, _alipay_client_app_id @@ -166,6 +166,8 @@ def _get_alipay_client(app_id: str, private_key: str, public_key: str, gateway: config.alipay_public_key = public_key config.sign_type = "RSA2" config.charset = "utf-8" + config.notify_url = notify_url + config.notify_type = "json" # 先尝试使用 certifi 证书 config.ca_certificates = certifi.where() @@ -305,12 +307,13 @@ def _create_alipay_order(order: PaymentOrder, db_configs: dict[str, str]) -> str private_key = db_configs.get("payment_alipay_private_key", "") public_key = db_configs.get("payment_alipay_public_key", "") gateway = db_configs.get("payment_alipay_gateway", "") + notify_url = db_configs.get("payment_alipay_notify_url", "") if not app_id or not private_key: logger.warning("Alipay config missing in database (app_id / private_key)") return None - client = _get_alipay_client(app_id, private_key, public_key, gateway) + client = _get_alipay_client(app_id, private_key, public_key, gateway, notify_url) if client is None: return None