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