feat: 优化支付码队列与支付超时
This commit is contained in:
@@ -99,7 +99,7 @@ def extract_pay_qr_code(html: str) -> str:
|
||||
return code if is_alipay_url(code) else ""
|
||||
|
||||
|
||||
def resolve_pay_targets(pay_url: str, *, timeout: float = 6.0) -> PayTargets:
|
||||
def resolve_pay_targets(pay_url: str, *, timeout: float = 15.0) -> PayTargets:
|
||||
"""跟随支付宝网关的 302,取**收银台页面**和页面里**真正的扫码内容**。
|
||||
|
||||
真机实测(2026-10-15):`openapi.alipay.com/gateway.do?...` 会 302 到
|
||||
@@ -139,6 +139,6 @@ def resolve_pay_targets(pay_url: str, *, timeout: float = 6.0) -> PayTargets:
|
||||
return PayTargets(cashier_url=final_url, qr_code=extract_pay_qr_code(html))
|
||||
|
||||
|
||||
def resolve_pay_entry_url(pay_url: str, *, timeout: float = 6.0) -> str:
|
||||
def resolve_pay_entry_url(pay_url: str, *, timeout: float = 15.0) -> str:
|
||||
"""只要收银台直达地址(约 93 字符);解析不到返回空串。"""
|
||||
return resolve_pay_targets(pay_url, timeout=timeout).cashier_url
|
||||
|
||||
Reference in New Issue
Block a user