微信支付 微信支付上传的图片需要通过提供的API先上传下,然后获取一个Id来使用 https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter2_1_1.shtml 官方提供的接口Java实现 按照这个代码写,调多久都是不行的,因为这个还要先过下认证,微信接口真是XXXXXX String filePath = "/your/home/hellokitty.png";URI uri = new URI("https://api.mch.weixin.qq.com/v3/merchant/media/upload");File file = new File(filePath);try (FileInputStream ins1 = new FileInputStream(file)) { String sha256 = DigestUtils.sha256Hex(ins1); try (InputStream ins2 = new FileInputStream(file)) { HttpPost request = new WechatPayUploadHttpPost.Builder(uri) .withImage(file.getName(), sha256, ins2) .build(); CloseableHttpResponse response1 = httpClient.execute(request); }} 认证接口 需要先使用微信提供的微信认证接口完成下身份认证 public static String weChatUploadImage(String imgUrl) throws Exception {//首先通过你的参数进行微信认证Priv...