feat(huya): 统一积分兑换并完善兑换记录
This commit is contained in:
+54
-1
@@ -105,7 +105,7 @@ SEQ_ACTIVITY_BIZ = 0x1D000109
|
||||
SEQ_POINTS_BIZ = 0x1D000107
|
||||
SEQ_POINTS_ORDER = 0x1D000108
|
||||
# 积分中心通道里用 0x1d000108 的两帧
|
||||
POINTS_ORDER_METHODS = frozenset({"createOrderV5", "payOrderSubmitV5"})
|
||||
POINTS_ORDER_METHODS = frozenset({"createOrderV5", "createOrderV6", "payOrderSubmitV5"})
|
||||
|
||||
|
||||
class WssCommand:
|
||||
@@ -1309,6 +1309,59 @@ class HuyaWssClient:
|
||||
"shopMiddleUI", "createOrderV5", req, CreateOrderRsp, timeout=15.0
|
||||
)
|
||||
|
||||
async def create_order_v6(
|
||||
self,
|
||||
uid: int,
|
||||
guid: str,
|
||||
cookie: str,
|
||||
pid: int,
|
||||
items,
|
||||
source_id: str = "yellowcarlist",
|
||||
game_id: str = "0",
|
||||
biz_params: str = JIFENCENTER_BIZ_PARAMS,
|
||||
):
|
||||
"""积分兑换多商品下单(``shopMiddleUI.createOrderV6``)。"""
|
||||
from .shop_structs import (
|
||||
CreateOrderAccountParam,
|
||||
CreateOrderExtraParam,
|
||||
CreateOrderItemReqV6,
|
||||
CreateOrderPromotionParam,
|
||||
CreateOrderReqV6,
|
||||
CreateOrderRspV6,
|
||||
)
|
||||
|
||||
req = CreateOrderReqV6()
|
||||
req.userId = self._build_biz_user(uid, cookie)
|
||||
req.shopAppInfo = self._build_shop_app(source_id, SHOP_APP_SCENE)
|
||||
req.items = []
|
||||
for item in items:
|
||||
row = CreateOrderItemReqV6()
|
||||
row.spuId = str(item.get("spu_id") or "")
|
||||
row.skuId = int(item.get("sku_id") or 0)
|
||||
row.itemCount = int(item.get("item_count") or 1)
|
||||
row.goodsType = int(item.get("goods_type") or 0)
|
||||
row.virtualType = int(item.get("virtual_type") or 0)
|
||||
req.items.append(row)
|
||||
req.pid = int(pid or 0)
|
||||
req.gameId = str(game_id or "0")
|
||||
req.src = 2
|
||||
req.orderType = 6
|
||||
extra = CreateOrderExtraParam()
|
||||
extra.bizParams = biz_params
|
||||
req.extraParam = extra
|
||||
req.sourceId = source_id
|
||||
req.env = self._build_order_env()
|
||||
req.orderScene = 3
|
||||
req.promotionParam = CreateOrderPromotionParam()
|
||||
req.accountParam = CreateOrderAccountParam()
|
||||
return await self.call_rpc(
|
||||
"shopMiddleUI",
|
||||
"createOrderV6",
|
||||
req,
|
||||
CreateOrderRspV6,
|
||||
timeout=15.0,
|
||||
)
|
||||
|
||||
async def pay_order_submit(
|
||||
self,
|
||||
uid: int,
|
||||
|
||||
Reference in New Issue
Block a user