This commit is contained in:
eric
2026-03-10 04:55:15 -05:00
parent 7dbee54fc4
commit ab720d312b

View File

@@ -4,6 +4,7 @@ ZPAY 支付渠道实现
支持页面跳转支付、API 接口支付、异步通知验签
"""
import hashlib
import json
from typing import Any, Dict, Optional
import requests
@@ -119,6 +120,12 @@ class ZPayProvider(PaymentProvider):
result = resp.json()
except Exception:
result = {}
# ZPAY 可能返回二次编码的 JSONbody 为 JSON 字符串),需再次解析
if isinstance(result, str):
try:
result = json.loads(result)
except Exception:
result = {}
if not isinstance(result, dict):
result = {}
try: