Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 19, 2025

用户反馈无法找到小游戏道具直购功能支持。根据微信官方文档,添加 present_goods API 实现。

新增内容

  • API 接口WxMaXPayService.presentGoods()
  • 请求 BeanWxMaXPayPresentGoodsRequest - 包含 openid、env、order_id、device_type、goods_id、goods_number
  • 响应 BeanWxMaXPayPresentGoodsResponse - 返回 order_id
  • URL 常量WxMaApiUrlConstants.XPay.PRESENT_GOODS_URL

使用示例

WxMaXPayPresentGoodsRequest request = WxMaXPayPresentGoodsRequest.builder()
    .openid("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o")
    .env(0)
    .orderId("ORDER_20231219001")
    .deviceType(0)
    .goodsId("ITEM_001")
    .goodsNumber(1)
    .build();

WxMaXPayPresentGoodsResponse response = wxMaService.getXPayService()
    .presentGoods(request, sigParams);

实现模式与现有虚拟支付 API(如 presentCurrency)保持一致。

Original prompt

This section details on the original issue you should resolve

<issue_title>请问小游戏的道具直购有支持吗?我没找到</issue_title>
<issue_description>这是道具直购的文档:
https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/goods.html</issue_description>

Comments on the Issue (you are @copilot in this section)

Custom agent used: 全部用中文
需要用中文,包括PR标题和分析总结过程


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add support for direct purchase of game props 添加小游戏道具直购(present_goods)API支持 Dec 19, 2025
Copilot AI requested a review from binarywang December 19, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

请问小游戏的道具直购有支持吗?我没找到

2 participants