no message
This commit is contained in:
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@ -67,6 +67,7 @@ pipeline {
|
|||||||
--network sczx-net \
|
--network sczx-net \
|
||||||
-p 8019:8019 \
|
-p 8019:8019 \
|
||||||
-e JAVA_OPTS="-Xms256m -Xmx512m -Duser.timezone=Asia/Shanghai" \
|
-e JAVA_OPTS="-Xms256m -Xmx512m -Duser.timezone=Asia/Shanghai" \
|
||||||
|
-v /root/cert:/root/cert:ro \
|
||||||
--restart always \
|
--restart always \
|
||||||
\${DOCKER_IMAGE}
|
\${DOCKER_IMAGE}
|
||||||
"""
|
"""
|
||||||
|
|||||||
@ -58,6 +58,8 @@ public class WechatPayService {
|
|||||||
@Value("${wechat.pay.refund-notify-url}")
|
@Value("${wechat.pay.refund-notify-url}")
|
||||||
private String refundNotifyUrl;
|
private String refundNotifyUrl;
|
||||||
|
|
||||||
|
@Value("${cert-path}")
|
||||||
|
private String certPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目初始化时获取服务器公网IP
|
* 项目初始化时获取服务器公网IP
|
||||||
@ -266,19 +268,14 @@ public class WechatPayService {
|
|||||||
refundNotifyUrl
|
refundNotifyUrl
|
||||||
);
|
);
|
||||||
|
|
||||||
String certPath = "classpath*:cert/"+companyConfig.getMchId()+".p12";
|
String path = certPath+companyConfig.getMchId()+".p12";
|
||||||
String certAbsolutePath = getCertAbsolutePath(certPath);
|
String certAbsolutePath = getCertAbsolutePath(path);
|
||||||
wxPayConfig.setCertPath(certAbsolutePath);
|
wxPayConfig.setCertPath(certAbsolutePath);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WXPay wxPay = new WXPay(wxPayConfig);
|
WXPay wxPay = new WXPay(wxPayConfig);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 退款需要证书,这里调用带证书的接口
|
// 退款需要证书,这里调用带证书的接口
|
||||||
Map<String, String> result = wxPay.refund(reqData);
|
Map<String, String> result = wxPay.refund(reqData);
|
||||||
|
|
||||||
|
|||||||
67
src/main/resources/application-dev.yml
Normal file
67
src/main/resources/application-dev.yml
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
|
||||||
|
server:
|
||||||
|
port: 8019
|
||||||
|
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: sczx-singlepay # 微服务名称
|
||||||
|
http:
|
||||||
|
encoding:
|
||||||
|
charset: UTF-8
|
||||||
|
enabled: true
|
||||||
|
force: true
|
||||||
|
mvc:
|
||||||
|
async:
|
||||||
|
request-timeout: -1
|
||||||
|
jackson:
|
||||||
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
|
time-zone: GMT+8
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: 115.190.8.52:8848 # Nacos 地址
|
||||||
|
group: DEFAULT_GROUP
|
||||||
|
metadata:
|
||||||
|
version: 1.0.0
|
||||||
|
env: dev
|
||||||
|
lifecycle:
|
||||||
|
timeout-per-shutdown-phase: 30s # 设置优雅停机时间
|
||||||
|
datasource:
|
||||||
|
url: jdbc:mysql://115.190.8.52:3306/sczx?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
|
||||||
|
username: sczx_user
|
||||||
|
password: Sczx123@
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
hikari:
|
||||||
|
maximum-pool-size: 10
|
||||||
|
auto-commit: true
|
||||||
|
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
exposure:
|
||||||
|
include: "*" # 暴露所有监控端点
|
||||||
|
endpoint:
|
||||||
|
health:
|
||||||
|
show-details: always
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mybatis-plus:
|
||||||
|
mapper-locations: classpath*:mapper/**/*.xml
|
||||||
|
type-aliases-package: com.sczx.pay.po # 实体类包路径
|
||||||
|
configuration:
|
||||||
|
mapUnderscoreToCamelCase: true
|
||||||
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 控制台打印 SQL(调试用)
|
||||||
|
|
||||||
|
|
||||||
|
wechat:
|
||||||
|
pay:
|
||||||
|
app-id: wx25e1ad1a70c326de
|
||||||
|
mch-id: your_mch_id
|
||||||
|
key: your_api_key
|
||||||
|
notify-url: https://www.minbo.wang:8020/api/payment/notify
|
||||||
|
refund-notify-url: https://www.minbo.wang:8020/api/payment/refundNotify
|
||||||
|
|
||||||
|
|
||||||
|
cert-path: /root/cert/
|
||||||
67
src/main/resources/application-local.yml
Normal file
67
src/main/resources/application-local.yml
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
|
||||||
|
server:
|
||||||
|
port: 8019
|
||||||
|
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: sczx-singlepay # 微服务名称
|
||||||
|
http:
|
||||||
|
encoding:
|
||||||
|
charset: UTF-8
|
||||||
|
enabled: true
|
||||||
|
force: true
|
||||||
|
mvc:
|
||||||
|
async:
|
||||||
|
request-timeout: -1
|
||||||
|
jackson:
|
||||||
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
|
time-zone: GMT+8
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: 115.190.8.52:8848 # Nacos 地址
|
||||||
|
group: DEFAULT_GROUP
|
||||||
|
metadata:
|
||||||
|
version: 1.0.0
|
||||||
|
env: dev
|
||||||
|
lifecycle:
|
||||||
|
timeout-per-shutdown-phase: 30s # 设置优雅停机时间
|
||||||
|
datasource:
|
||||||
|
url: jdbc:mysql://115.190.8.52:3306/sczx?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
|
||||||
|
username: sczx_user
|
||||||
|
password: Sczx123@
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
hikari:
|
||||||
|
maximum-pool-size: 10
|
||||||
|
auto-commit: true
|
||||||
|
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
exposure:
|
||||||
|
include: "*" # 暴露所有监控端点
|
||||||
|
endpoint:
|
||||||
|
health:
|
||||||
|
show-details: always
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mybatis-plus:
|
||||||
|
mapper-locations: classpath*:mapper/**/*.xml
|
||||||
|
type-aliases-package: com.sczx.pay.po # 实体类包路径
|
||||||
|
configuration:
|
||||||
|
mapUnderscoreToCamelCase: true
|
||||||
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 控制台打印 SQL(调试用)
|
||||||
|
|
||||||
|
|
||||||
|
wechat:
|
||||||
|
pay:
|
||||||
|
app-id: wx25e1ad1a70c326de
|
||||||
|
mch-id: your_mch_id
|
||||||
|
key: your_api_key
|
||||||
|
notify-url: https://www.minbo.wang:8020/api/payment/notify
|
||||||
|
refund-notify-url: https://www.minbo.wang:8020/api/payment/refundNotify
|
||||||
|
|
||||||
|
|
||||||
|
cert-path: E:\cert\
|
||||||
@ -62,3 +62,6 @@ wechat:
|
|||||||
key: your_api_key
|
key: your_api_key
|
||||||
notify-url: https://www.minbo.wang:8020/api/payment/notify
|
notify-url: https://www.minbo.wang:8020/api/payment/notify
|
||||||
refund-notify-url: https://www.minbo.wang:8020/api/payment/refundNotify
|
refund-notify-url: https://www.minbo.wang:8020/api/payment/refundNotify
|
||||||
|
|
||||||
|
|
||||||
|
cert-path: /root/cert/
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user