已经申请到了mchId与appid后,通过https://api.mch.weixin.qq.com/sandboxnew/pay/getsignkey接口,拿到了沙箱环境的密钥。
java通过demo提供的的WXPayExample,调用统一下单接口:https://api.mch.weixin.qq.com/sandboxnew/pay/unifiedorder
一切正常并返回报文如下:
appid,mch_id,prepay_id,nonce_str,sign已替换。
将同样的代码放到springboot中执行时报错如下:
2020-08-18 21:16:19.006 DEBUG 7 --- [io-10000-exec-1] io.sdk.wxpay.WXPayRequest : ---url=https://api.mch.weixin.qq.com/sandboxnew/pay/unifiedorder
2020-08-18 21:16:19.280 INFO 7 --- [pool-3-thread-1] wxpay java sdk : try get remain report msg
javax.net.ssl.SSLHandshakeException: No X509TrustManager implementation available
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
。。。。
at io.sdk.wxpay.WXPayRequest.requestOnce(WXPayRequest.java:111)
at io.sdk.wxpay.WXPayRequest.request(WXPayRequest.java:130)
at io.sdk.wxpay.WXPayRequest.requestWithoutCert(WXPayRequest.java:235)
at io.sdk.wxpay.WXPay.requestWithoutCert(WXPay.java:160)
at io.sdk.wxpay.WXPay.unifiedOrder(WXPay.java:366)
at io.sdk.wxpay.WXPay.unifiedOrder(WXPay.java:342)
现在不知道是什么原因导致统一下单接口不能正常返回
你好,麻烦确认下你这个是沙箱环境的报错还是正式环境调用报错?
springboot是放在k8s里部署的