This commit is contained in:
yumoqing 2026-07-17 10:50:51 +08:00
parent df6aa60006
commit 0cebfd140f

View File

@ -167,13 +167,16 @@ class WechatGateway(Gateway):
auth = self._sign("POST", url_path, body_str)
async with aiohttp.ClientSession() as session:
async with session.post(url, data=body_str, headers={
"Authorization": f"WECHATPAY2-SHA256-RSA2048 {auth}",
"Content-Type": "application/json"
}) as resp:
ret = await resp.json()
return ret.get("h5_url")
try:
async with session.post(url, data=body_str, headers={
"Authorization": f"WECHATPAY2-SHA256-RSA2048 {auth}",
"Content-Type": "application/json"
}) as resp:
ret = await resp.json()
return ret.get("h5_url")
except EXception as e:
exception(f'{e}, {url=}, {body_str=}, {auth=}')
raise e
return None
# -----------------------------------------------------