你好请问这个回调,是针对那个功能回调呀,关注视频号能回调吗 用户进注小店能回调吗
如何接收视频号订单的回调信息?[图片] 在视频号管理后台配置的服务器地址是个get请求,为了验证数据的,我参考的是https://developers.weixin.qq.com/doc/channels/API/basics/message_push.html 这篇文档,这个接口要通的话返回的是入参中的echostr,将这个接口配置在图中“服务器地址”处是能成功的。但是回调接口的文档是https://developers.weixin.qq.com/doc/channels/API/order/callback/channels_ec_order_cancel.html,无论是参数还是响应都和上述文档不一样,而且无法将这个回调逻辑的地址配置在“服务器地址”处。那么我的业务逻辑该写在哪个接口呢? @GetMapping("/wechatChannel/callback/validation") public Long wechatChannelOrderCallbackValidation(@RequestParam String signature, @RequestParam String timestamp, @RequestParam String nonce, @RequestParam String echostr ) { String[] strings = {WECHAT_CHANNEL_ORDER_CALLBACK_TOKEN, timestamp, nonce}; // 使用Arrays.sort方法和Comparator进行字典排序 Arrays.sort(strings); log.info("字典排序后的参数{}", JSON.toJSONString(strings)); String sign = SignUtils.callbackSign(Lists.newArrayList(strings)); log.info("视频号回调签名:{},{},{}", sign, signature, sign.equals(signature)); if(sign.equals(signature)){ return Long.valueOf(echostr); } return 0L; } @PostMapping("/wechatChannel/paySuccess/callback") public String wechatChannelOrderPaySuccessCallback(@RequestParam String signature, @RequestParam String timestamp, @RequestParam String nonce, @RequestParam(required = false) String openid, @RequestParam(required = false, defaultValue = "aes") String encrypt_type, @RequestParam String msg_signature, @RequestBody WechatChannelOrderPaySuccessCallbackRequest request) throws AesException { log.info("收到视频号消息推送,参数:{},appId:{}, {}, {}", JSON.toJSONString(request), request.getToUserName(), appId, request.getToUserName().equals(appId)); WXBizJsonMsgCrypt wxcpt = new WXBizJsonMsgCrypt(WECHAT_CHANNEL_ORDER_CALLBACK_TOKEN, WECHAT_CHANNEL_ORDER_CALLBACK_ENCODING_AES_KEY, appId); WechatChannelOrderPaySuccessCallbackData data = null; try { String sMsg = wxcpt.DecryptMsg(msg_signature, timestamp, nonce, JSON.toJSONString(request)); log.info("视频号订单回调,解密出的参数为:{}", sMsg); JSONObject jsonObject = JSON.parseObject(sMsg, JSONObject.class); String debugStr = jsonObject.getString("debug_str"); data = JSON.parseObject(debugStr, WechatChannelOrderPaySuccessCallbackData.class); } catch (Exception e) { log.error("视频号订单支付完成回调解析参数失败,参数:{}", JSON.toJSONString(request), e); return Constants.FAIL; } try{ if(data != null){ if(WechatChannelEventTypeEnum.PAY_SUCCESS.getEvent().equals(data.getEvent())){ wechatChannelService.orderPaySuccessCallback(data); } } } catch(Exception e){ log.error("视频号订单支付完成回调失败", e); } return "success"; } 上面一个接口可以配置在店铺里面,但是仅仅是做了验签;下面一个接口有业务逻辑,但是没法配置在店铺管理里面。
07-02https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token={{token}}&userid=111 我也一下没有 下边3个字段了,这些这段是有地方可以设置展示不展示吗,字段没了直接让我代码报错 "mobile": "15913215421", "gender": "1", "avatar": { "errcode": 0, "errmsg": "ok", "userid": "XXXX", "name": "XXXX", "department": [ 70 ], "position": "", "status": 1, "isleader": 0, "extattr": { "attrs": [] }, "telephone": "", "enable": 1, "hide_mobile": 0, "order": [ 8192 ], "external_profile": { "external_attr": [], "external_corp_name": "" }, "main_department": 70, "alias": "", "is_leader_in_dept": [ 0 ], "direct_leader": [] }
调用读取成员API,无法获取用户头像地址调用读取成员API,无法获取用户头像地址,没有返回avatar的值 https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&userid=USERID
2022-06-21