文档里面的格式是这样的: { "media_id" : "file752398_7983424" }
微信支付消费者投诉2.0图片上传接口返回结果是.png结尾如题所述,主要想问下有没有同行的大佬帮忙看看这个问题。主要代码贴下: public JsonResult upload(MultipartFile file) { String fileName = file.getOriginalFilename(); String[] arr = fileName.split("\\."); log.info(fileName); log.info(arr[0]); String path = "tmp/"; String uuid = UUID.randomUUID().toString() + "." + arr[1]; File dest = new File(new File(path).getAbsolutePath()+ "/" + uuid); if (!dest.getParentFile().exists()) { dest.getParentFile().mkdirs(); } InputStream is = null; FileSystemResource resource = new FileSystemResource(dest); // 创建一个临时文件 File tempFile; try { file.transferTo(dest); // 保存文件 is = new FileInputStream(dest); } catch (FileNotFoundException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } //文件sha256值 String fileSha256; try { fileSha256 = DigestUtils.sha256Hex(is); log.info(fileSha256); } catch (IOException e) { throw new RuntimeException(e); } try { is.close(); } catch (IOException e) { throw new RuntimeException(e); } fileName = uuid; JSONObject jsonObject = new JSONObject(); jsonObject.put("filename", fileName); jsonObject.put("sha256", fileSha256); String body = jsonObject.toString(); log.info(body); String method = "POST"; String postUrl = complaintDomain + "/v3/merchant-service/images/upload"; HttpUrl httpurl = HttpUrl.parse(postUrl); String token = null; try { token = getToken(method, httpurl, body); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } catch (SignatureException e) { throw new RuntimeException(e); } catch (InvalidKeyException e) { throw new RuntimeException(e); } String authStr = schema + " " + token; HttpHeaders headers = new HttpHeaders(); headers.set("Authorization", authStr); log.info("Authorization: {}", authStr); headers.set("Accept", "application/json"); headers.set("Content-Type", "multipart/form-data"); MultiValueMap<String,Object> params = new LinkedMultiValueMap<>(); params.add("file", resource); params.add("meta", jsonObject); HttpEntity<MultiValueMap<String, Object>> strEntity = new HttpEntity<>(params, headers); JSONObject result = JSONObject.parseObject(restTemplate.postForObject(postUrl, strEntity, String.class)); log.info("result: {}", result); Map<String, String> map = new HashMap<>(); map.put("mediaId", result.getString("media_id")); return new JsonResult<>(map); } 返回结果如下: {"media_id":"91FE32BF33A3EC2F2CEED2BAF330C96F.png"} 问客服说估计是我的问题,但我看了半天也没看出来
2023-10-26线下已经跟用户沟通过了,她把费用退还了,然后找不到取消投诉的入口,很无奈
小程序用户投诉导致要缴纳保证金,怎么解决?小程序用户使用发生异常,第二天后台全额退还订单了,第三天用户投诉的。当时我们想都全额退款了应该没啥事就没注意这个投诉。然后说超出这个纠纷限制期平台先行赔付,我们补上了订单费用。然后昨晚通知我们扣除7个交易体验分,还让我们缴纳七千多的保证金,不然就限制我们小程序使用。我们申诉了也不知道啥时候处理,打了一圈电话让到这个平台发帖,现在只能等这个帖子有专门的人员看到帮忙解决了。在线等!
2023-03-22