s''
This commit is contained in:
@@ -136,6 +136,15 @@ class ZPayProvider(PaymentProvider):
|
||||
result = {}
|
||||
if not isinstance(result, dict):
|
||||
result = {}
|
||||
# 部分环境下 ZPAY 将成功数据放在 msg 中(msg 为 JSON 字符串)
|
||||
msg_val = result.get("msg")
|
||||
if isinstance(msg_val, str) and msg_val.strip().startswith("{"):
|
||||
try:
|
||||
inner = json.loads(msg_val)
|
||||
if isinstance(inner, dict) and int(float(inner.get("code", 0))) == 1:
|
||||
result = inner
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
code = int(float(result.get("code", 0)))
|
||||
except (TypeError, ValueError):
|
||||
@@ -145,7 +154,7 @@ class ZPayProvider(PaymentProvider):
|
||||
"status": "ok",
|
||||
"provider": self.name,
|
||||
"payurl": result.get("payurl"),
|
||||
"payurl2": result.get("payurl2"), # 微信 H5
|
||||
"payurl2": result.get("payurl2"), # 微信 H5,手机浏览器打开可唤醒微信
|
||||
"qrcode": result.get("qrcode"),
|
||||
"img": result.get("img"),
|
||||
"O_id": result.get("O_id"),
|
||||
|
||||
Reference in New Issue
Block a user