qq 也可以获取支付二维码 成功微信支付了
This commit is contained in:
@@ -36,10 +36,12 @@ from pyvm.algorithm import build_plaintext, generate_encrypt_msg, generate_encry
|
||||
from pyvm.mall import MallSession, generate_encrypt_msg as mall_generate # noqa: E402
|
||||
from pyvm.session import SessionState, load_session # noqa: E402
|
||||
from pyvm.login_profile import midas_login_params # noqa: E402
|
||||
from pyvm.payment_errors import describe_payment_failure # noqa: E402
|
||||
|
||||
REPLAY = ROOT / "replay"
|
||||
DEFAULT_APPID = "1450243039"
|
||||
DEFAULT_SAVE_URL = f"https://api.unipay.qq.com/v1/r/{DEFAULT_APPID}/web_save"
|
||||
MALL_API_URL = "https://storeapi.pay.qq.com/api/CommonCallMpgo"
|
||||
ORDER_FIELDS = ["token_id", "openid", "openkey", "session_id", "session_type", "zoneid",
|
||||
"pay_method", "buy_quantity", "mb_pwd", "pay_id", "auth_key",
|
||||
"card_value", "accounttype", "provide_uin", "extend", "ts",
|
||||
@@ -367,7 +369,7 @@ def cmd_mall_submit(args) -> int:
|
||||
body_obj["call_param"]["call_param_json"] = json.dumps(cpj, ensure_ascii=False)
|
||||
new_body = json.dumps(body_obj, ensure_ascii=False)
|
||||
|
||||
url = "https://pagedooapi.pay.qq.com/api/CommonCallMpgo?t=" + str(int(time.time() * 1000))
|
||||
url = MALL_API_URL + "?t=" + str(int(time.time() * 1000))
|
||||
cookie_str = "; ".join(f"{k}={v}" for k, v in cookies.items())
|
||||
# midas 域 cookie 兜底(profile 导出常缺 midas_openid/midas_openkey,值为 openid/accesstoken)
|
||||
if "midas_openid" not in cookies and "openid" in cookies:
|
||||
@@ -552,7 +554,7 @@ def mall_getpaytoken(cookies: dict) -> tuple[list, str]:
|
||||
"login_check_param_json": json.dumps(login),
|
||||
},
|
||||
}
|
||||
url = "https://pagedooapi.pay.qq.com/api/CommonCallMpgo?t=" + str(int(time.time() * 1000))
|
||||
url = MALL_API_URL + "?t=" + str(int(time.time() * 1000))
|
||||
cookie_str = "; ".join(f"{k}={v}" for k, v in cookies.items())
|
||||
for k, v in [("midas_openid", "openid"), ("midas_openkey", "accesstoken")]:
|
||||
if k not in cookies and v in cookies:
|
||||
@@ -690,7 +692,7 @@ def cmd_mall_auto(args) -> int:
|
||||
for k, v in [("midas_openid", "openid"), ("midas_openkey", "accesstoken")]:
|
||||
if k not in cookies and v in cookies:
|
||||
cookie_str += f"; {k}=" + cookies[v]
|
||||
url = "https://pagedooapi.pay.qq.com/api/CommonCallMpgo?t=" + str(int(time.time() * 1000))
|
||||
url = MALL_API_URL + "?t=" + str(int(time.time() * 1000))
|
||||
req = urllib.request.Request(url, data=new_body.encode("utf-8"), headers={
|
||||
"Content-Type": "application/json", "Accept": "application/json, text/plain, */*",
|
||||
"Origin": "https://z.iwan.yyb.qq.com", "Referer": "https://z.iwan.yyb.qq.com/",
|
||||
@@ -722,6 +724,7 @@ def cmd_mall_auto(args) -> int:
|
||||
return 0
|
||||
detail = js.get("result_info", "") or call_reply.get("result_info", "") or ""
|
||||
print(f"❌ 下单失败 ret={ret} inner={inner_ret} ({detail})")
|
||||
print(f" {describe_payment_failure(str(cookies.get('logintype', '')), 'order', f'{ret} {inner_ret} {detail}')}")
|
||||
print(f" 响应已保存 → {out}")
|
||||
return 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user