's'
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user