s''
This commit is contained in:
@@ -136,6 +136,15 @@ class ZPayProvider(PaymentProvider):
|
|||||||
result = {}
|
result = {}
|
||||||
if not isinstance(result, dict):
|
if not isinstance(result, dict):
|
||||||
result = {}
|
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:
|
try:
|
||||||
code = int(float(result.get("code", 0)))
|
code = int(float(result.get("code", 0)))
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
@@ -145,7 +154,7 @@ class ZPayProvider(PaymentProvider):
|
|||||||
"status": "ok",
|
"status": "ok",
|
||||||
"provider": self.name,
|
"provider": self.name,
|
||||||
"payurl": result.get("payurl"),
|
"payurl": result.get("payurl"),
|
||||||
"payurl2": result.get("payurl2"), # 微信 H5
|
"payurl2": result.get("payurl2"), # 微信 H5,手机浏览器打开可唤醒微信
|
||||||
"qrcode": result.get("qrcode"),
|
"qrcode": result.get("qrcode"),
|
||||||
"img": result.get("img"),
|
"img": result.get("img"),
|
||||||
"O_id": result.get("O_id"),
|
"O_id": result.get("O_id"),
|
||||||
|
|||||||
Reference in New Issue
Block a user