do not use microPay ()
this API, uses requestWithoutCert ()
Wechat JDK method is all wrong, blinded my eyes.
available:
"C:\Program Files\Java\jdk1.8.0_191\bin\java.exe" "-javaagent:F:\IntelliJ IDEA 2018.1.2\lib\idea_rt.jar=34212:F:\IntelliJ IDEA 2018.1.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_191\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_191\jre\lib\rt.jar;D:\spring-boot-weixinpay-demo\demo\target\classes;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.1.1.RELEASE\spring-boot-starter-web-2.1.1.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\boot\spring-boot-starter\2.1.1.RELEASE\spring-boot-starter-2.1.1.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\boot\spring-boot\2.1.1.RELEASE\spring-boot-2.1.1.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.1.1.RELEASE\spring-boot-autoconfigure-2.1.1.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.1.1.RELEASE\spring-boot-starter-logging-2.1.1.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\Users\SeeClanUkyo\.m2\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\Users\SeeClanUkyo\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.11.1\log4j-to-slf4j-2.11.1.jar;C:\Users\SeeClanUkyo\.m2\repository\org\apache\logging\log4j\log4j-api\2.11.1\log4j-api-2.11.1.jar;C:\Users\SeeClanUkyo\.m2\repository\org\slf4j\jul-to-slf4j\1.7.25\jul-to-slf4j-1.7.25.jar;C:\Users\SeeClanUkyo\.m2\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;C:\Users\SeeClanUkyo\.m2\repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\boot\spring-boot-starter-json\2.1.1.RELEASE\spring-boot-starter-json-2.1.1.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.7\jackson-databind-2.9.7.jar;C:\Users\SeeClanUkyo\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;C:\Users\SeeClanUkyo\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.7\jackson-core-2.9.7.jar;C:\Users\SeeClanUkyo\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.7\jackson-datatype-jdk8-2.9.7.jar;C:\Users\SeeClanUkyo\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.7\jackson-datatype-jsr310-2.9.7.jar;C:\Users\SeeClanUkyo\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.7\jackson-module-parameter-names-2.9.7.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\2.1.1.RELEASE\spring-boot-starter-tomcat-2.1.1.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.13\tomcat-embed-core-9.0.13.jar;C:\Users\SeeClanUkyo\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.13\tomcat-embed-el-9.0.13.jar;C:\Users\SeeClanUkyo\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.13\tomcat-embed-websocket-9.0.13.jar;C:\Users\SeeClanUkyo\.m2\repository\org\hibernate\validator\hibernate-validator\6.0.13.Final\hibernate-validator-6.0.13.Final.jar;C:\Users\SeeClanUkyo\.m2\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;C:\Users\SeeClanUkyo\.m2\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;C:\Users\SeeClanUkyo\.m2\repository\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\spring-web\5.1.3.RELEASE\spring-web-5.1.3.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\spring-beans\5.1.3.RELEASE\spring-beans-5.1.3.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\spring-webmvc\5.1.3.RELEASE\spring-webmvc-5.1.3.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\spring-aop\5.1.3.RELEASE\spring-aop-5.1.3.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\spring-context\5.1.3.RELEASE\spring-context-5.1.3.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\spring-expression\5.1.3.RELEASE\spring-expression-5.1.3.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\spring-core\5.1.3.RELEASE\spring-core-5.1.3.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\springframework\spring-jcl\5.1.3.RELEASE\spring-jcl-5.1.3.RELEASE.jar;C:\Users\SeeClanUkyo\.m2\repository\org\apache\httpcomponents\httpclient\4.5.3\httpclient-4.5.3.jar;C:\Users\SeeClanUkyo\.m2\repository\org\apache\httpcomponents\httpcore\4.4.10\httpcore-4.4.10.jar;C:\Users\SeeClanUkyo\.m2\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;C:\Users\SeeClanUkyo\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar" com.wechat.demo.main.TestWxPay
14:29:49.449 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default
14:29:49.469 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
14:29:49.471 [main] DEBUG org.apache.http.impl.conn.BasicHttpClientConnectionManager - Get connection for route {s}->https://api.mch.weixin.qq.com:443
14:29:49.490 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Opening connection {s}->https://api.mch.weixin.qq.com:443
14:29:49.558 [main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connecting to api.mch.weixin.qq.com/123.151.79.109:443
14:29:49.559 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Connecting socket to api.mch.weixin.qq.com/123.151.79.109:443 with timeout 6000
14:29:49.640 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2]
14:29:49.640 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
14:29:49.640 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Starting handshake
14:29:49.746 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Secure session established
14:29:49.746 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - negotiated protocol: TLSv1.2
14:29:49.746 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - negotiated cipher suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
14:29:49.746 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - peer principal: CN=payapp.weixin.qq.com, OU=R&D, O=Tencent Technology (Shenzhen) Company Limited, L=Shenzhen, ST=Guangdong, C=CN
14:29:49.747 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - peer alternative names: [payapp.weixin.qq.com, api2.mch.weixin.qq.com, apihk.mch.weixin.qq.com, log.weixin.qq.com, fraud.mch.weixin.qq.com, za.pay.wechat.com, action.weixin.qq.com, mch.weixin.qq.com, api.mch.weixin.qq.com, apius.mch.weixin.qq.com, fraudus.mch.weixin.qq.com, apitest.mch.weixin.qq.com, oz.weixin.qq.com, fraudhk.mch.weixin.qq.com, act.weixin.qq.com, pay.weops.qq.com, wx.gtimg.com, api.oz.weixin.qq.com, api.pay.weixin.qq.com, pay.weixin.qq.com]
14:29:49.747 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - issuer principal: CN=GeoTrust RSA CA 2018, OU=www.digicert.com, O=DigiCert Inc, C=US
14:29:49.752 [main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connection established 192.168.1.88:34217<->123.151.79.109:443
14:29:49.752 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: set socket timeout to 8000
14:29:49.752 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Executing request POST /sandboxnew/pay/getsignkey HTTP/1.1
14:29:49.752 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Target auth state: UNCHALLENGED
14:29:49.753 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED
14:29:49.754 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> POST /sandboxnew/pay/getsignkey HTTP/1.1
14:29:49.754 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Type: text/xml
14:29:49.757 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: WXPaySDK/3.0.9 (amd64 Windows 10 10.0) Java/1.8.0_191 HttpClient/4.5.3 1391042002
14:29:49.757 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 204
14:29:49.757 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: api.mch.weixin.qq.com
14:29:49.757 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
14:29:49.757 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
14:29:49.758 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "POST /sandboxnew/pay/getsignkey HTTP/1.1[\r][\n]"
14:29:49.758 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: text/xml[\r][\n]"
14:29:49.758 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: WXPaySDK/3.0.9 (amd64 Windows 10 10.0) Java/1.8.0_191 HttpClient/4.5.3 1391042002[\r][\n]"
14:29:49.758 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 204[\r][\n]"
14:29:49.758 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: api.mch.weixin.qq.com[\r][\n]"
14:29:49.758 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
14:29:49.758 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
14:29:49.759 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
14:29:49.759 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "<?xml version="1.0" encoding="UTF-8" standalone="no"?>[\r][\n]"
14:29:49.759 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "<xml>[\r][\n]"
14:29:49.759 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "<nonce_str>lT32nr8c25R2gHJiNId2UY80MXaM6Jig</nonce_str>[\r][\n]"
14:29:49.759 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "<sign>D11F3CBE102948E827312A49036AC0BC</sign>[\r][\n]"
14:29:49.759 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "<mch_id>1391042002</mch_id>[\r][\n]"
14:29:49.759 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "</xml>[\r][\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Server: nginx[\r][\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Date: Wed, 19 Dec 2018 06:29:54 GMT[\r][\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Type: text/plain;charset=utf-8[\r][\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Length: 185[\r][\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Connection: keep-alive[\r][\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Keep-Alive: timeout=8[\r][\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "from: sandbox[\r][\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "<xml>[\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << " <return_code><![CDATA[SUCCESS]]></return_code>[\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << " <return_msg><![CDATA[ok]]></return_msg>[\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << " <sandbox_signkey><![CDATA[a24d43852df9d28af467151605a0bbf9]]></sandbox_signkey>[\n]"
14:29:51.554 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "</xml>"
14:29:51.556 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 200 OK
14:29:51.556 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Server: nginx
14:29:51.556 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Wed, 19 Dec 2018 06:29:54 GMT
14:29:51.556 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Type: text/plain;charset=utf-8
14:29:51.556 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Length: 185
14:29:51.556 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Connection: keep-alive
14:29:51.556 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Keep-Alive: timeout=8
14:29:51.556 [main] DEBUG org.apache.http.headers - http-outgoing-0 << from: sandbox
14:29:51.561 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection can be kept alive for 8000 MILLISECONDS
14:29:51.563 [main] DEBUG org.apache.http.impl.conn.BasicHttpClientConnectionManager - Releasing connection 192.168.1.88:34217<->123.151.79.109:443
14:29:51.563 [main] DEBUG org.apache.http.impl.conn.BasicHttpClientConnectionManager - Connection can be kept alive for 8000 MILLISECONDS
14:29:51.566 [main] INFO wxpay java sdk - report v1.1,WXPaySDK/3.0.9,lT32nr8c25R2gHJiNId2UY80MXaM6Jig,1545200991,2983,api.mch.weixin.qq.com,true,6000,8000,0,0,0,191B4E07E7F203580C6CB6E0CDAD513D46EE6C7CF6088B9301FB9960E02DAD07
14:29:51.577 [main] INFO wxpay java sdk - retrieveSandboxSignKey:{sandbox_signkey=a24d43852df9d28af467151605a0bbf9, return_msg=ok, return_code=SUCCESS}
a24d43852df9d28af467151605a0bbf9