Comments (6)
wechatpay-java 依赖的是 OkHttp 4.x,你项目中引入的是 3.x。
建议谨慎地升级,参考adding-constraints-transitive-deps 指定 OkHttp 4.x 版本。按照 OkHttp 官方的迁移指南,OkHttp 4.x 和 OkHttp 3.x 是二进制和 Java 源代码兼容。
希望收到你兼容性的报告。
from wechatpay-java.
可是我是直接引的jar包呀,
com.github.wechatpay-apiv3
wechatpay-java
0.2.0
意思是这个打好的jar里面引用错了,需要我自己去引OkHttp 4.x 版本?
from wechatpay-java.
猜测是你在项目主动依赖了 OkHttp 3.x
或者依赖的其他组件依赖了。你用 IDE 或者 gradle 查看下项目的依赖就知道了。
也可以参考下其他项目 类似问题的指引。
from wechatpay-java.
@xl277541808 我跟你遇到了一样的问题 按照如下所示修改 pom 文件得以解决
<dependency>
<groupId>com.github.wechatpay-apiv3</groupId>
<artifactId>wechatpay-java</artifactId>
<version>0.2.1</version>
<exclusions>
<exclusion>
<artifactId>okhttp</artifactId>
<groupId>com.squareup.okhttp3</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.10.0</version>
</dependency>
@xy-peng 我查看了下依赖树 发现 wechatpay-java-core 引入的 okhttp 版本是 3.14.9 如下图所示
from wechatpay-java.
@xl277541808 我跟你遇到了一样的问题 按照如下所示修改 pom 文件得以解决
<dependency> <groupId>com.github.wechatpay-apiv3</groupId> <artifactId>wechatpay-java</artifactId> <version>0.2.1</version> <exclusions> <exclusion> <artifactId>okhttp</artifactId> <groupId>com.squareup.okhttp3</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <version>4.10.0</version> </dependency>
@xy-peng 我查看了下依赖树 发现 wechatpay-java-core 引入的 okhttp 版本是 3.14.9 如下图所示
@zijianrs
大佬,我按照你说的试过。原本是这样, wechatpay-java-core 自身内部依赖的是okhttp 3.14.9
然后,改了之后:
运行报错,提示同样的问题
from wechatpay-java.
@zijianrs
后来,为了赶时间,没有研究了。用了另一种方式:wechatpay-apache-httpclient
这个感觉挺简单的。拿进来就能用了,
然后是调用接口,二维码地址一下就出来了
我猜,是不是环境不一样。我是在spring-boot api 里面使用的
from wechatpay-java.
Related Issues (20)
- JsapiServiceExtension的prepayWithRequestPayment预下单接口 HOT 2
- 总是提示验签失败 HOT 2
- 缺少NATIVE 下单通知响应相关API,可以参考统一下单支付成功的通知。
- 沙箱环境问题 HOT 1
- privateKeyPath 能不能动态加载多个不同的文件 比如多个商户号多个证书文件 HOT 2
- 你们这Java Bean就不能合并提取一下么,一个名字一大堆,关键接口都是同一个 HOT 1
- 文档回调通知代码错误 HOT 1
- JsapiServiceExtension能添加static修饰成全局变量吗?是否线程安全? HOT 2
- 付款码支付推荐用3.0的SDK,结果SDK里面压根儿就没包含付款码的请求
- 下单之后,没有立刻支付,此时再去查订单状态,到底是啥closed?还是notpay, HOT 3
- 发起商家转账,设置回调,InitiateBatchTransferRequest根本没法设置回调 HOT 11
- APP 支付问题
- 您好,我在接预扣费通知API,请问可以使用咱们提供的微信支付 APIv3 Java SDK吗
- 当前不支持合单支付接口的调用,希望更新版本并支持合单支付
- 为什么私钥路径一定要是绝对路径,多个项目成员如何管理这个路径 HOT 1
- 【电子发票】电子发票Java实现
- 生成h5领券链接 错误码 268697610 是什么情况,官方文档没有说明 HOT 1
- Illegal base64 character 2d 报错 HOT 1
- 为什么需要公众号ID? HOT 1
- h5支付初始化参数异常
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wechatpay-java.