bugfix
This commit is contained in:
parent
9484266b9e
commit
9a767c2b93
@ -141,7 +141,7 @@ class TransferGateway(Gateway):
|
|||||||
c += str(randint(0,9))
|
c += str(randint(0,9))
|
||||||
return c
|
return c
|
||||||
|
|
||||||
async def run(self):
|
async def run(self, app):
|
||||||
"""后台轮询邮箱,匹配转账码并完成充值入账"""
|
"""后台轮询邮箱,匹配转账码并完成充值入账"""
|
||||||
debug(f'mail check loop will starting')
|
debug(f'mail check loop will starting')
|
||||||
self.running = True
|
self.running = True
|
||||||
|
|||||||
@ -155,15 +155,11 @@ class WechatGateway(Gateway):
|
|||||||
"amount": {
|
"amount": {
|
||||||
"total": int(payload["amount"] * 100),
|
"total": int(payload["amount"] * 100),
|
||||||
"currency": payload.get("currency", "CNY")
|
"currency": payload.get("currency", "CNY")
|
||||||
},
|
|
||||||
"scene_info": {
|
|
||||||
"payer_client_ip": payload.get("client_ip", "127.0.0.1"),
|
|
||||||
"h5_info": {"type": "Wap"}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
body_str = json.dumps(body, ensure_ascii=False)
|
body_str = json.dumps(body, ensure_ascii=False)
|
||||||
|
|
||||||
url_path = "/v3/pay/transactions/h5"
|
url_path = "/v3/pay/transactions/native"
|
||||||
url = WECHAT_API_BASE + url_path
|
url = WECHAT_API_BASE + url_path
|
||||||
auth = self._sign("POST", url_path, body_str)
|
auth = self._sign("POST", url_path, body_str)
|
||||||
|
|
||||||
@ -174,11 +170,11 @@ class WechatGateway(Gateway):
|
|||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
}) as resp:
|
}) as resp:
|
||||||
ret = await resp.json()
|
ret = await resp.json()
|
||||||
returl = ret.get("h5_url")
|
returl = ret.get("code_url")
|
||||||
if returl is None:
|
if returl is None:
|
||||||
e = Exception(f'{ret=} error')
|
e = Exception(f'{ret=} error')
|
||||||
raise e
|
raise e
|
||||||
return ret.get("h5_url")
|
return ret.get("code_url")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
exception(f'{e}, {url=}, {body_str=}, {auth=}')
|
exception(f'{e}, {url=}, {body_str=}, {auth=}')
|
||||||
raise e
|
raise e
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user