补充视频号小店订单管理缺失的13个接口#4038
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ef299b20b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| String PRESENT_NOTE_ADD_URL = "https://api.weixin.qq.com/channels/ec/order/presentnote/add"; | ||
| /** 获取礼物单的子单列表 */ | ||
| String PRESENT_SUB_ORDER_GET_URL = "https://api.weixin.qq.com/channels/ec/order/presentsuborder/get"; | ||
| /** 获取待发货前更换sku待处理请求 */ | ||
| String PRE_SHIPMENT_CHANGE_SKU_GET_URL = "https://api.weixin.qq.com/channels/ec/order/preshipmentchangesku/get"; |
There was a problem hiding this comment.
Use documented order API paths
These new URL constants do not match the order-management endpoints exposed by the WeChat shop docs for the same operations: gift notes/suborders use channels/ec/order/present/note and channels/ec/order/present/sublist, and pending SKU changes use channels/ec/order/sku/change/list, not the presentnote/add, presentsuborder/get, or preshipmentchangesku/get paths added here. Any caller of these newly added methods will post to an invalid API path before the request body is even considered.
Useful? React with 👍 / 👎.
| String ADD_PHONE_URL = "https://api.weixin.qq.com/channels/ec/merchant/privatenumber/addphone"; | ||
| /** 获取短信验证码 */ | ||
| String SEND_VERIFY_CODE_URL = "https://api.weixin.qq.com/channels/ec/merchant/privatenumber/sendverifycode"; | ||
| /** 获取小店手机号认证状态 */ | ||
| String GET_PHONE_URL = "https://api.weixin.qq.com/channels/ec/merchant/privatenumber/getphone"; |
There was a problem hiding this comment.
Send private-number requests to the order phone APIs
The phone verification endpoints documented for these order-management operations are under channels/ec/order/phone/... (verifycode/add, verifycode/send, and status), but these constants point to channels/ec/merchant/privatenumber/.... In a real shop integration, addPrivatePhone, sendPrivatePhoneVerifyCode, and getPrivatePhone will therefore hit unrelated/nonexistent endpoints and fail with an API error.
Useful? React with 👍 / 👎.
| public WxChannelBaseResponse applyRealNumber(String orderId) throws WxErrorException { | ||
| OrderIdParam param = new OrderIdParam(orderId); | ||
| String resJson = shopService.post(REAL_NUMBER_APPLY_URL, param); |
There was a problem hiding this comment.
Include the required reason when applying for real numbers
The real-number application API requires a merchant-supplied reason in addition to order_id, but this method constructs an OrderIdParam and the public signature only accepts orderId. Callers cannot provide the required reason, so every request made through this new method is missing mandatory data and will be rejected by WeChat.
Useful? React with 👍 / 👎.
| public WxChannelBaseResponse approvePreShipmentChangeSku(String orderId) throws WxErrorException { | ||
| OrderIdParam param = new OrderIdParam(orderId); | ||
| String resJson = shopService.post(PRE_SHIPMENT_CHANGE_SKU_APPROVE_URL, param); |
There was a problem hiding this comment.
Pass the SKU-change id when approving a change
Approving a pre-shipment SKU change requires identifying the specific change request with sku_change_id as well as the order, but this implementation posts only order_id. For orders with a pending SKU-change request, WeChat cannot know which request to approve, and the new API method will be rejected rather than approving the change.
Useful? React with 👍 / 👎.
WxChannelOrderService缺少礼物订单、发货前换SKU、真实号码/虚拟号管理、商家私密手机号及订单补发货等共13个接口的实现。变更内容
URL 常量(
WxChannelApiUrlConstants)Order接口新增10个常量(PRESENT_NOTE_ADD_URL、PRE_SHIPMENT_CHANGE_SKU_*、REAL_NUMBER_*、VIRTUAL_NUMBER_*、DELIVERY_COMPENSATION_URL)PrivateNumber接口,包含3个商家私密手机号相关URL常量新增 Bean 类
PresentNoteAddParamPresentSubOrderResponsePreShipmentChangeSkuResponsePreShipmentChangeSkuRejectParamRealNumberViewAuditResponsePrivateNumberAddPhoneParam/PrivateNumberSendVerifyCodeParamPrivateNumberGetPhoneResponse/PrivateNumberPhoneInfoOrderCompensationDeliveryParam服务接口与实现
WxChannelOrderService及WxChannelOrderServiceImpl新增以下13个方法:WxChannelOrderServiceImplTest同步新增对应的13个测试方法。