This commit is contained in:
eric
2026-03-08 06:43:29 -05:00
parent f725104c8a
commit d77f90cb8c
8 changed files with 155 additions and 13 deletions

View File

@@ -115,8 +115,13 @@ class ZPayProvider(PaymentProvider):
params["sign"] = self._md5_sign(params)
resp = requests.post(self.MAPI_URL, data=params, timeout=15)
result = resp.json() if resp.headers.get("content-type", "").startswith("application/json") else {}
if isinstance(result, dict) and result.get("code") == 1:
try:
result = resp.json()
except Exception:
result = {}
if not isinstance(result, dict):
result = {}
if int(result.get("code", 0)) == 1:
return {
"status": "ok",
"provider": self.name,