diff --git a/unipay/__pycache__/__init__.cpython-310.pyc b/unipay/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..b2c7c57 Binary files /dev/null and b/unipay/__pycache__/__init__.cpython-310.pyc differ diff --git a/unipay/__pycache__/core.cpython-310.pyc b/unipay/__pycache__/core.cpython-310.pyc new file mode 100644 index 0000000..e3a0a83 Binary files /dev/null and b/unipay/__pycache__/core.cpython-310.pyc differ diff --git a/unipay/__pycache__/init.cpython-310.pyc b/unipay/__pycache__/init.cpython-310.pyc new file mode 100644 index 0000000..c6b2745 Binary files /dev/null and b/unipay/__pycache__/init.cpython-310.pyc differ diff --git a/unipay/__pycache__/notify.cpython-310.pyc b/unipay/__pycache__/notify.cpython-310.pyc new file mode 100644 index 0000000..9311f98 Binary files /dev/null and b/unipay/__pycache__/notify.cpython-310.pyc differ diff --git a/unipay/__pycache__/payfee.cpython-310.pyc b/unipay/__pycache__/payfee.cpython-310.pyc new file mode 100644 index 0000000..c7efcd7 Binary files /dev/null and b/unipay/__pycache__/payfee.cpython-310.pyc differ diff --git a/unipay/__pycache__/paylog.cpython-310.pyc b/unipay/__pycache__/paylog.cpython-310.pyc new file mode 100644 index 0000000..dde9be5 Binary files /dev/null and b/unipay/__pycache__/paylog.cpython-310.pyc differ diff --git a/unipay/__pycache__/utils.cpython-310.pyc b/unipay/__pycache__/utils.cpython-310.pyc new file mode 100644 index 0000000..764b5ef Binary files /dev/null and b/unipay/__pycache__/utils.cpython-310.pyc differ diff --git a/unipay/providers/__pycache__/__init__.cpython-310.pyc b/unipay/providers/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..4c83fa9 Binary files /dev/null and b/unipay/providers/__pycache__/__init__.cpython-310.pyc differ diff --git a/unipay/providers/__pycache__/alipay.cpython-310.pyc b/unipay/providers/__pycache__/alipay.cpython-310.pyc new file mode 100644 index 0000000..10d2407 Binary files /dev/null and b/unipay/providers/__pycache__/alipay.cpython-310.pyc differ diff --git a/unipay/providers/__pycache__/paypal.cpython-310.pyc b/unipay/providers/__pycache__/paypal.cpython-310.pyc new file mode 100644 index 0000000..5dd3d23 Binary files /dev/null and b/unipay/providers/__pycache__/paypal.cpython-310.pyc differ diff --git a/unipay/providers/__pycache__/stripe.cpython-310.pyc b/unipay/providers/__pycache__/stripe.cpython-310.pyc new file mode 100644 index 0000000..30323ea Binary files /dev/null and b/unipay/providers/__pycache__/stripe.cpython-310.pyc differ diff --git a/unipay/providers/__pycache__/transfer.cpython-310.pyc b/unipay/providers/__pycache__/transfer.cpython-310.pyc new file mode 100644 index 0000000..8c6f96a Binary files /dev/null and b/unipay/providers/__pycache__/transfer.cpython-310.pyc differ diff --git a/unipay/providers/__pycache__/wechat.cpython-310.pyc b/unipay/providers/__pycache__/wechat.cpython-310.pyc new file mode 100644 index 0000000..4810daa Binary files /dev/null and b/unipay/providers/__pycache__/wechat.cpython-310.pyc differ diff --git a/unipay/providers/wechat.py b/unipay/providers/wechat.py index 55f359d..9e34947 100644 --- a/unipay/providers/wechat.py +++ b/unipay/providers/wechat.py @@ -172,9 +172,14 @@ class WechatGateway(Gateway): "Content-Type": "application/json" }) as resp: ret = await resp.json() - return ret.get("h5_url") - - return None + if resp.status != 200: + err_code = ret.get("code", "UNKNOWN") + err_msg = ret.get("message", str(ret)) + raise Exception(f"WeChat API error (HTTP {resp.status}): [{err_code}] {err_msg}") + h5_url = ret.get("h5_url") + if not h5_url: + raise Exception(f"WeChat API response missing h5_url: {json.dumps(ret, ensure_ascii=False)}") + return h5_url # ----------------------------------------------------- async def refund(self, payload: Dict[str, Any]) -> Dict[str, Any]: