请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

系统异常,预下单状态未知

图片描述
老师你好 我目前在配置支付宝沙箱环境 当面付的demo,请问appid pid 支付宝公钥 应用公钥和之前与应用公钥生成的私钥是这页的信息吗,因为我配置了之后运行main函数得到的是
Juni 12, 2019 10:23:58 VORM. com.alipay.demo.trade.config.Configs init
INFO: 配置文件名: zfbinfo.properties
Juni 12, 2019 10:23:59 VORM. com.alipay.demo.trade.config.Configs init
INFO: Configs{支付宝openapi网关: https://openapi.alipaydev.com/gateway.do
, 支付宝mcloudapi网关域名: http://mcloudmonitor.com/gateway.do
, pid: 2088102177667755
, appid: 2016092800616703
, 商户RSA私钥: MIIEvg******EvPXvH
, 商户RSA公钥: MIIBIj******IDAQAB
, 支付宝RSA公钥: MIIBIj******IDAQAB
, 签名类型: RSA2
, 查询重试次数: 5
, 查询间隔(毫秒): 5000
, 撤销尝试次数: 3
, 撤销重试间隔(毫秒): 2000
, 交易保障调度延迟(秒): 5
, 交易保障调度间隔(秒): 900
}
Juni 12, 2019 10:23:59 VORM. com.alipay.demo.trade.service.impl.AbsAlipayTradeService tradePrecreate
INFO: trade.precreate bizContent:{“out_trade_no”:“tradeprecreate1560327839035304930”,“seller_id”:"",“total_amount”:“0.01”,“undiscountable_amount”:“0”,“subject”:“xxx品牌xxx门店当面付扫码消费”,“body”:“购买商品3件共20.00元”,“goods_detail”:[{“goods_id”:“goods_id001”,“goods_name”:“xxx小面包”,“quantity”:1,“price”:“10”},{“goods_id”:“goods_id002”,“goods_name”:“xxx牙刷”,“quantity”:2,“price”:“5”}],“operator_id”:“test_operator_id”,“store_id”:“test_store_id”,“extend_params”:{“sys_service_provider_id”:“2088100200300400500”},“timeout_express”:“120m”}
Juni 12, 2019 10:24:01 VORM. com.alipay.api.internal.util.AlipayLogger _logCommError
SEVERE: 2019-06-12 16:24:01_alipay.trade.precreate_null_10.184.145.184_Windows 10_alipay-sdk-java-3.3.0_https://openapi.alipaydev.com/gateway.do?charset=utf-8&method=alipay.trade.precreate&sign=ahC9HBlmaIydvZ%2B3GGsArUCm0txC7OL4eOOidEPwgDtESVvJcERdDwpEM21iokOblQ5bN3aTu7FY2HRNE0XFDe1m5%2FGOtach%2Fit%2Bfq4n6FAc9RtUvwg%2BCo9DiCMbgPDcazVKAWeAZnc6LB9qDI9lhCXlyb8JVwHCJmiRpCM%2B1bsDBri1KNGgDsHEJKD6KBw%2F1Gg6zsNW0i7c7M1AsXti%2B2Id0zZ%2BexwVEkcrLEwrDGzLG8cdTCH1Kf25EgG%2BS1ezTP3dIi9wVWSInNh7XeXajblXzxu3We7nTOLta5YhG%2Bob2C4dVFzCbFgcxcpt%2BVcwKR1nMHcaBmTMl8tcsvVfww%3D%3D&version=1.0&app_id=2016092800616703&sign_type=RSA2&timestamp=2019-06-12+16%3A23%3A59&alipay_sdk=alipay-sdk-java-3.3.0&format=json__Connection refused: connect
com.alipay.api.AlipayApiException: java.net.ConnectException: Connection refused: connect
at com.alipay.api.AbstractAlipayClient.doPost(AbstractAlipayClient.java:460)
at com.alipay.api.AbstractAlipayClient._execute(AbstractAlipayClient.java:375)
at com.alipay.api.AbstractAlipayClient.execute(AbstractAlipayClient.java:103)
at com.alipay.api.AbstractAlipayClient.execute(AbstractAlipayClient.java:90)
at com.alipay.api.AbstractAlipayClient.execute(AbstractAlipayClient.java:84)
at com.alipay.demo.trade.service.impl.AbsAlipayService.getResponse(AbsAlipayService.java:32)
at com.alipay.demo.trade.service.impl.AbsAlipayTradeService.tradePrecreate(AbsAlipayTradeService.java:102)
at com.alipay.demo.trade.service.impl.AlipayTradeServiceImpl.tradePrecreate(AlipayTradeServiceImpl.java:1)
at com.alipay.demo.trade.Main.test_trade_precreate(Main.java:426)
at com.alipay.demo.trade.Main.main(Main.java:101)
Caused by: java.net.ConnectException: Connection refused: connect
at java.base/java.net.PlainSocketImpl.waitForConnect(Native Method)
at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:107)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
at java.base/java.net.Socket.connect(Socket.java:591)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:285)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
at java.base/sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:265)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:372)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1181)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1075)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1356)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1331)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:242)
at com.alipay.api.internal.util.WebUtils.doPost(WebUtils.java:153)
at com.alipay.api.internal.util.WebUtils.doPost(WebUtils.java:116)
at com.alipay.api.AbstractAlipayClient.doPost(AbstractAlipayClient.java:456)
… 9 more
Juni 12, 2019 10:24:01 VORM. com.alipay.demo.trade.Main test_trade_precreate
SEVERE: 系统异常,预下单状态未知!!!

正在回答

2回答

支付宝报告Connection refused就是链接被拒绝,检查一下公钥和私钥是否正确,主要看看配置参数是不是正确。然后我把支付宝二维码支付的接口文档给你,里面有示例代码,你把对应的参数改成自己的:https://docs.open.alipay.com/api_1/alipay.trade.precreate

下面是alipay的maven仓库jar包,用来之后可以不需要老师给的jar文件

<dependency>

    <groupId>com.alipay.sdk</groupId>

    <artifactId>alipay-sdk-java</artifactId>

    <version>3.7.89.ALL</version>

</dependency>


0 回复 有任何疑惑可以回复我~
  • 提问者 慕桂英4676473 #1
    谢谢老师的答复,我目前其实非常简单我只想打开支付宝demo然后运行获取二维码信息,我目前还尚未没有添加任何其他项目之后会跟着老师继续开发。如果只是希望简单运行demo,获得二维码信息。而不做任何设置,我还需要改代码中的参数吗,还是只需要匹配公钥和私钥
    回复 有任何疑惑可以回复我~ 2019-06-12 17:06:02
  • geelylucky 回复 提问者 慕桂英4676473 #2
    你看我给你的支付宝文档,里面有一段示例代码,可以直接把那段代码拿过来,然后把里面对应的参数改成自己的,这个代码我也测试过,是可以的。你可以尝试一下。
    回复 有任何疑惑可以回复我~ 2019-06-12 18:03:30
  • 提问者 慕桂英4676473 回复 geelylucky #3
    嗯嗯好的!谢谢老师 我去尝试一下
    回复 有任何疑惑可以回复我~ 2019-06-12 18:16:15
提问者 慕桂英4676473 2019-06-12 17:02:08

谢谢老师的答复,我目前其实非常简单我只想打开支付宝demo然后运行获取二维码信息,我目前还尚未没有添加任何其他项目之后会跟着老师继续开发。如果只是希望简单运行demo,获得二维码信息。而不做任何设置,我还需要改代码中的参数吗,还是只需要匹配公钥和私钥

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信