소스 검색

Merge branch 'master' of https://git.oschina.net/52itstyle/spring-boot-pay

小柒2012 6 년 전
부모
커밋
6cbdf56540
3개의 변경된 파일53개의 추가작업 그리고 17개의 파일을 삭제
  1. 38 6
      README.md
  2. 5 4
      pom.xml
  3. 10 7
      src/main/resources/zfbinfo.properties

+ 38 - 6
README.md

@@ -65,10 +65,6 @@ JDK1.7、Maven、Eclipse、SpringBoot1.5.2、spring-boot-starter-thymeleaf、Dub
 
 ![模拟支付](https://git.oschina.net/uploads/images/2017/0802/191125_6958b9b3_87650.png "2.png")
 
-![扫码模式一](https://git.oschina.net/uploads/images/2017/0803/184824_420ca96d_87650.png "123.png")
-
-
-
 ## 支付宝
 
 签约功能列表:
@@ -187,14 +183,14 @@ CERT_PATH = apiclient_cert.p12
 
 ## 升级说明
 
-##### 2018-10-10 更新说明:
+#### 2018-10-10 更新说明:
 
 - 原当当 Dubbox 2.8.4 替换为 Dubbo 2.6.2
 - 原spring-context-dubbo.xml 配置 替换为 dubbo-spring-boot-starter 2.0.0
 - 原 zkclient 0.6 替换为 curator-recipes 4.0.1
 - 原 zookeeper 3.4.6 升级为 zookeeper 3.5.3
 
-##### 2018-10-17 更新说明:
+#### 2018-10-17 更新说明:
 
 ```
 {"alipay_trade_precreate_response":{"code":"40003","msg":"Insufficient Conditions","sub_code":"isv.missing-signature-config","sub_msg":"应用未配置对应签名算法的公钥或者证书"}}
@@ -202,6 +198,42 @@ CERT_PATH = apiclient_cert.p12
 
 二维码支付报错:应用未配置对应签名算法的公钥或者证书。记得17年申请的时候貌似不需要门店,如果是18年申请二维码支付需要门店并申请签约才可以使用。
 
+#### 2018-10-24 更新说明:
+
+- [支付宝支付密钥RSA1升级到RSA2](http://https://blog.52itstyle.com/archives/3453/)
+
+- 微信支付SDK漏洞xxe漏洞修复。
+
+#### 2018-11-19 更新说明:
+
+- [升级阿里官方SDk](https://mvnrepository.com/artifact/com.alipay.sdk/alipay-sdk-java)
+
+- 支付密钥sign_type升级为RSA2注意事项:
+
+1)当面付(扫码支付)
+
+pom.xml中下载最新的alipay-trade-sdk,并在配置zfbinfo.properties参数中增加以下参数:
+
+```
+# 签名类型: RSA->SHA1withRsa,RSA2->SHA256withRsa
+sign_type = RSA2
+```
+
+2)电脑支付或者手机支付
+
+需要在创建AlipayClient传入RSA2即可:
+
+```
+AlipayClient alipayClient = new DefaultAlipayClient(
+                                               Configs.getOpenApiDomain(), Configs.getAppid(),
+                                               Configs.getPrivateKey(), "json", "UTF-8",
+                                               Configs.getAlipayPublicKey(),"RSA2");
+```
+
+
+
+
+
 ## 推荐阅读
 
 

+ 5 - 4
pom.xml

@@ -37,16 +37,17 @@
 			<artifactId>spring-boot-starter-thymeleaf</artifactId>
 		</dependency>
 		<!-- 支付宝 SDK(项目中的支付宝SDk需要自行去官网下载打入本地仓库或者私服)-->
-		<!-- 项目中的支付宝SDk需要自行去官网下载打入本地仓库或者私服,提供下载地址:http://pan.baidu.com/s/1mi5LfhI -->
+		<!-- 项目中的支付宝SDk需要自行去官网下载打入本地仓库或者私服,提供下载地址:https://pan.baidu.com/s/1B2_uyrz2uKN1Z_Ivbv7lgw -->
 		<dependency>
 		    <groupId>com.acts</groupId>
 		    <artifactId>alipay-trade-sdk</artifactId>
 		    <version>1.0.0</version>
 		</dependency>
+		<!-- 官方SDK  https://mvnrepository.com/artifact/com.alipay.sdk/alipay-sdk-java -->
 		<dependency>
-		    <groupId>com.acts</groupId>
-		    <artifactId>alipay-sdk-java</artifactId>
-		    <version>1.0.0</version>
+			<groupId>com.alipay.sdk</groupId>
+			<artifactId>alipay-sdk-java</artifactId>
+			<version>3.4.27.ALL</version>
 		</dependency>
 		<dependency>
 		    <groupId>org.apache.commons</groupId>

+ 10 - 7
src/main/resources/zfbinfo.properties

@@ -1,24 +1,27 @@
-# \u652f\u4ed8\u5b9d\u7f51\u5173\u540d\u3001partnerId\u548cappId \u6b22\u8fce\u5173\u6ce8https://blog.52itstyle.com/
+# 支付宝网关名、partnerId和appId 欢迎关注https://blog.52itstyle.com/
 open_api_domain = https://openapi.alipay.com/gateway.do
 mcloud_api_domain = http://mcloudmonitor.com/gateway.do
-#\u6b64\u5904\u8bf7\u586b\u5199\u4f60\u7684PID
+#此处请填写你的PID
 pid =XXXXXXXXXXXXXXXX
-#\u6b64\u5904\u8bf7\u586b\u5199\u4f60\u5f53\u9762\u4ed8\u7684APPID 
+#此处请填写你当面付的APPID 
 appid =XXXXXXXXXXXXXXXX
 
-# RSA\u79c1\u94a5\u3001\u516c\u94a5\u548c\u652f\u4ed8\u5b9d\u516c\u94a5
+# RSA私钥、公钥和支付宝公钥
 private_key = XXXXXXXXXXXXXXXX
 public_key = XXXXXXXXXXXXXXXX
 alipay_public_key = XXXXXXXXXXXXXXXX
 
-# \u5f53\u9762\u4ed8\u6700\u5927\u67e5\u8be2\u6b21\u6570\u548c\u67e5\u8be2\u95f4\u9694\uff08\u6beb\u79d2\uff09
+# 签名类型: RSA->SHA1withRsa,RSA2->SHA256withRsa
+sign_type = RSA2
+
+# 当面付最大查询次数和查询间隔(毫秒)
 max_query_retry = 5
 query_duration = 5000
 
-# \u5f53\u9762\u4ed8\u6700\u5927\u64a4\u9500\u6b21\u6570\u548c\u64a4\u9500\u95f4\u9694\uff08\u6beb\u79d2\uff09
+# 当面付最大撤销次数和撤销间隔(毫秒)
 max_cancel_retry = 3
 cancel_duration = 2000
 
-# \u4ea4\u6613\u4fdd\u969c\u7ebf\u7a0b\u7b2c\u4e00\u6b21\u8c03\u5ea6\u5ef6\u8fdf\u548c\u8c03\u5ea6\u95f4\u9694\uff08\u79d2\uff09
+# 交易保障线程第一次调度延迟和调度间隔(秒)
 heartbeat_delay = 5
 heartbeat_duration = 900