Merge remote-tracking branch 'origin/dev' into master

This commit is contained in:
terrfly 2021-07-19 18:01:45 +08:00
commit 63bbef99f5
39 changed files with 1016 additions and 122 deletions

View File

@ -9,37 +9,82 @@
# 该yml文件只配置与环境相关的参数 其他配置读取项目下的配置项
#
#################################
server:
port: 9217 #设置端口为 9217
port: 9217 #设置端口
servlet:
context-path: / #设置应用的目录. 前缀需要带/, 无需设置后缀, 示例 【 /xxx 】 or 【 / 】
spring:
servlet:
multipart:
enabled: true #是否启用http上传处理
max-request-size: 10MB #最大请求文件的大小
max-file-size: 10MB #设置单个文件最大长度
resources:
static-locations: classpath:/static #项目静态资源路径 可直接通过http访问
freemarker:
template-loader-path: classpath:/templates #freemarker模板目录
template-encoding: UTF-8
suffix: .ftl
settings:
classic_compatible: true # 如果变量为null,转化为空字符串,比如做比较的时候按照空字符做比较
number_format: '#' #数字格式进行原样显示,不加格式化字符例如 100,00
datasource:
# yml填写url连接串 无需将&符号进行转义
url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
username: root
password:
druid:
# 连接池配置项
initial-size: 5 #初始化时建立物理连接的个数
min-idle: 5 #最小连接池数量
max-active: 30 #最大连接池数量
max-wait: 60000 #获取连接时最大等待时间,单位毫秒
# 检测相关
test-while-idle: true # 建议配置为true不影响性能并且保证安全性。申请连接的时候检测如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效。
test-on-borrow: false # 申请连接时执行validationQuery检测连接是否有效做了这个配置会降低性能。
test-on-return: false # 归还连接时执行validationQuery检测连接是否有效做了这个配置会降低性能。
time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis: 300000 #连接保持空闲而不被驱逐的最小时间
validation-query: SELECT 1 FROM DUAL
# 是否缓存preparedStatement
pool-prepared-statements: false # 是否缓存preparedStatement也就是PSCache。PSCache对支持游标的数据库性能提升巨大比如说oracle。在mysql下建议关闭。
max-pool-prepared-statement-per-connection-size: 20 # 要启用PSCache必须配置大于0当大于0时poolPreparedStatements自动触发修改为true。
# 配置监控统计拦截的filters去掉后监控界面sql无法统计 通过connectProperties属性来打开mergeSql功能慢SQL记录
filters: stat,wall
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
cache:
type: redis
redis:
host: 127.0.0.1
port: 6379
database: 1 #1库运营平台 #2库商户系统 #3库支付网关
timeout: 1000
password:
# 注意以下MQ配置需注意【如需使用activeMQ则需将rabbitMQ配置注释即可】
profiles:
include:
- activeMQ
# - rabbitMQ # 需要安装延迟队列插件https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/
#- rabbitMQ # 需要安装延迟队列插件https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/
#- rocketMQ
#activeMQ配置
activemq:
broker-url: tcp://localhost:61616 #连接地址
#rabbitmq配置
rabbitmq:
addresses: 127.0.0.1:5672
username: guest
password: guest
dynamic: true
virtual-host: /
#rabbitmq配置
# rabbitmq:
# addresses: 127.0.0.1:5672
# username: guest
# password: guest
# dynamic: true
# virtual-host: /
#rocketmq配置
# rocketmq:
# name-server: 127.0.0.1:9876
# producer:
# group: rocket-group
#日志配置参数。
# 当存在logback-spring.xml文件时 该配置将引进到logback配置 springboot配置不生效。
@ -52,9 +97,26 @@ logging:
#系统业务参数
isys:
allow-cors: false #是否允许跨域请求 [生产环境建议关闭, 若api与前端项目没有在同一个域名下时应开启此配置或在nginx统一配置允许跨域]
jwt-secret: t7w3P8X6472qWc3u #生成jwt的秘钥。 要求每个系统有单独的秘钥管理机制。
# 文件系统配置项系统内oss 并非云oss
oss-file:
root-path: /home/jeepay/upload #存储根路径 ( 无需以‘/’结尾 )
#是否允许跨域请求 [生产环境建议关闭, 若api与前端项目没有在同一个域名下时应开启此配置或在nginx统一配置允许跨域]
allow-cors: true
oss:
file-root-path: /home/jeepay/upload #存储根路径 ( 无需以‘/’结尾 )
file-public-path: ${isys.oss.file-root-path}/public #公共读取块 ( 一般配合root-path参数进行设置需以/ 开头, 无需以‘/’结尾 )
file-private-path: ${isys.oss.file-root-path}/private #私有化本地访问不允许url方式公共读取 ( 一般配合root-path参数进行设置需以/ 开头, 无需以‘/’结尾 )
# [local]: 本地存储所有的文件将存在放本地可通过nfs, rsync工具实现多机共享
# [aliyun-oss]: 将文件统一上传到阿里云oss服务器; 注意需调整jeepay-oss/pom.xml中的aliyun-sdk-oss组件依赖方式
service-type: local
# 阿里云OSS服务配置信息
aliyun-oss:
endpoint: oss-cn-beijing.aliyuncs.com #endpoint 如: oss-cn-beijing.aliyuncs.com
public-bucket-name: bucket1 #公共读 桶名称
private-bucket-name: bucket2 #私有 桶名称
access-key-id: KEY_KEY_KEY #AccessKeyId
access-key-secret: SECRET_SECRET_SECRET #AccessKeySecret

View File

@ -9,37 +9,82 @@
# 该yml文件只配置与环境相关的参数 其他配置读取项目下的配置项
#
#################################
server:
port: 9218 # 设置端口为 9218
port: 9218 #设置端口
servlet:
context-path: / #设置应用的目录. 前缀需要带/, 无需设置后缀, 示例 【 /xxx 】 or 【 / 】
spring:
servlet:
multipart:
enabled: true #是否启用http上传处理
max-request-size: 10MB #最大请求文件的大小
max-file-size: 10MB #设置单个文件最大长度
resources:
static-locations: classpath:/static #项目静态资源路径 可直接通过http访问
freemarker:
template-loader-path: classpath:/templates #freemarker模板目录
template-encoding: UTF-8
suffix: .ftl
settings:
classic_compatible: true # 如果变量为null,转化为空字符串,比如做比较的时候按照空字符做比较
number_format: '#' #数字格式进行原样显示,不加格式化字符例如 100,00
datasource:
# yml填写url连接串 无需将&符号进行转义
url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
username: root
password:
druid:
# 连接池配置项
initial-size: 5 #初始化时建立物理连接的个数
min-idle: 5 #最小连接池数量
max-active: 30 #最大连接池数量
max-wait: 60000 #获取连接时最大等待时间,单位毫秒
# 检测相关
test-while-idle: true # 建议配置为true不影响性能并且保证安全性。申请连接的时候检测如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效。
test-on-borrow: false # 申请连接时执行validationQuery检测连接是否有效做了这个配置会降低性能。
test-on-return: false # 归还连接时执行validationQuery检测连接是否有效做了这个配置会降低性能。
time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis: 300000 #连接保持空闲而不被驱逐的最小时间
validation-query: SELECT 1 FROM DUAL
# 是否缓存preparedStatement
pool-prepared-statements: false # 是否缓存preparedStatement也就是PSCache。PSCache对支持游标的数据库性能提升巨大比如说oracle。在mysql下建议关闭。
max-pool-prepared-statement-per-connection-size: 20 # 要启用PSCache必须配置大于0当大于0时poolPreparedStatements自动触发修改为true。
# 配置监控统计拦截的filters去掉后监控界面sql无法统计 通过connectProperties属性来打开mergeSql功能慢SQL记录
filters: stat,wall
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
cache:
type: redis
redis:
host: 127.0.0.1
port: 6379
database: 2 #1库运营平台 #2库商户系统 #3库支付网关
timeout: 1000
password:
# 注意以下MQ配置需注意【如需使用activeMQ则需将rabbitMQ配置注释即可】
profiles:
include:
- activeMQ
# - rabbitMQ # 需要安装延迟队列插件https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/
#- rabbitMQ # 需要安装延迟队列插件https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/
#- rocketMQ
#activeMQ配置
activemq:
broker-url: tcp://localhost:61616 #连接地址
#rabbitmq配置
rabbitmq:
addresses: 127.0.0.1:5672
username: guest
password: guest
dynamic: true
virtual-host: /
#rabbitmq配置
# rabbitmq:
# addresses: 127.0.0.1:5672
# username: guest
# password: guest
# dynamic: true
# virtual-host: /
#rocketmq配置
# rocketmq:
# name-server: 127.0.0.1:9876
# producer:
# group: rocket-group
#日志配置参数。
# 当存在logback-spring.xml文件时 该配置将引进到logback配置 springboot配置不生效。
@ -52,9 +97,26 @@ logging:
#系统业务参数
isys:
allow-cors: false #是否允许跨域请求 [生产环境建议关闭, 若api与前端项目没有在同一个域名下时应开启此配置或在nginx统一配置允许跨域]
jwt-secret: ARNXp4MzjOOQqxtv #生成jwt的秘钥。 要求每个系统有单独的秘钥管理机制。
# 文件系统配置项系统内oss 并非云oss
oss-file:
root-path: /home/jeepay/upload #存储根路径 ( 无需以‘/’结尾 )
#是否允许跨域请求 [生产环境建议关闭, 若api与前端项目没有在同一个域名下时应开启此配置或在nginx统一配置允许跨域]
allow-cors: true
oss:
file-root-path: /home/jeepay/upload #存储根路径 ( 无需以‘/’结尾 )
file-public-path: ${isys.oss.file-root-path}/public #公共读取块 ( 一般配合root-path参数进行设置需以/ 开头, 无需以‘/’结尾 )
file-private-path: ${isys.oss.file-root-path}/private #私有化本地访问不允许url方式公共读取 ( 一般配合root-path参数进行设置需以/ 开头, 无需以‘/’结尾 )
# [local]: 本地存储所有的文件将存在放本地可通过nfs, rsync工具实现多机共享
# [aliyun-oss]: 将文件统一上传到阿里云oss服务器; 注意需调整jeepay-oss/pom.xml中的aliyun-sdk-oss组件依赖方式
service-type: local
# 阿里云OSS服务配置信息
aliyun-oss:
endpoint: oss-cn-beijing.aliyuncs.com #endpoint 如: oss-cn-beijing.aliyuncs.com
public-bucket-name: bucket1 #公共读 桶名称
private-bucket-name: bucket2 #私有 桶名称
access-key-id: KEY_KEY_KEY #AccessKeyId
access-key-secret: SECRET_SECRET_SECRET #AccessKeySecret

View File

@ -9,37 +9,82 @@
# 该yml文件只配置与环境相关的参数 其他配置读取项目下的配置项
#
#################################
server:
port: 9216 #设置端口为 9216
port: 9216 #设置端口
servlet:
context-path: / #设置应用的目录. 前缀需要带/, 无需设置后缀, 示例 【 /xxx 】 or 【 / 】
spring:
servlet:
multipart:
enabled: true #是否启用http上传处理
max-request-size: 10MB #最大请求文件的大小
max-file-size: 10MB #设置单个文件最大长度
resources:
static-locations: classpath:/static #项目静态资源路径 可直接通过http访问
freemarker:
template-loader-path: classpath:/templates #freemarker模板目录
template-encoding: UTF-8
suffix: .ftl
settings:
classic_compatible: true # 如果变量为null,转化为空字符串,比如做比较的时候按照空字符做比较
number_format: '#' #数字格式进行原样显示,不加格式化字符例如 100,00
datasource:
# yml填写url连接串 无需将&符号进行转义
url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
username: root
password:
druid:
# 连接池配置项
initial-size: 5 #初始化时建立物理连接的个数
min-idle: 5 #最小连接池数量
max-active: 30 #最大连接池数量
max-wait: 60000 #获取连接时最大等待时间,单位毫秒
# 检测相关
test-while-idle: true # 建议配置为true不影响性能并且保证安全性。申请连接的时候检测如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效。
test-on-borrow: false # 申请连接时执行validationQuery检测连接是否有效做了这个配置会降低性能。
test-on-return: false # 归还连接时执行validationQuery检测连接是否有效做了这个配置会降低性能。
time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis: 300000 #连接保持空闲而不被驱逐的最小时间
validation-query: SELECT 1 FROM DUAL
# 是否缓存preparedStatement
pool-prepared-statements: false # 是否缓存preparedStatement也就是PSCache。PSCache对支持游标的数据库性能提升巨大比如说oracle。在mysql下建议关闭。
max-pool-prepared-statement-per-connection-size: 20 # 要启用PSCache必须配置大于0当大于0时poolPreparedStatements自动触发修改为true。
# 配置监控统计拦截的filters去掉后监控界面sql无法统计 通过connectProperties属性来打开mergeSql功能慢SQL记录
filters: stat,wall
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
cache:
type: redis
redis:
host: 127.0.0.1
port: 6379
database: 3 #1库运营平台 #2库商户系统 #3库支付网关
timeout: 1000
password:
# 注意以下MQ配置需注意【如需使用activeMQ则需将rabbitMQ配置注释即可】
profiles:
include:
- activeMQ
# - rabbitMQ # 需要安装延迟队列插件https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/
#- rabbitMQ # 需要安装延迟队列插件https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/
#- rocketMQ
#activeMQ配置
activemq:
broker-url: tcp://localhost:61616 #连接地址
#rabbitmq配置
rabbitmq:
addresses: 127.0.0.1:5672
username: guest
password: guest
dynamic: true
virtual-host: /
#rabbitmq配置
# rabbitmq:
# addresses: 127.0.0.1:5672
# username: guest
# password: guest
# dynamic: true
# virtual-host: /
#rocketmq配置
# rocketmq:
# name-server: 127.0.0.1:9876
# producer:
# group: rocket-group
#日志配置参数。
# 当存在logback-spring.xml文件时 该配置将引进到logback配置 springboot配置不生效。
@ -52,8 +97,24 @@ logging:
#系统业务参数
isys:
allow-cors: false #是否允许跨域请求 [生产环境建议关闭, 若api与前端项目没有在同一个域名下时应开启此配置或在nginx统一配置允许跨域]
# 文件系统配置项系统内oss 并非云oss
oss-file:
root-path: /home/jeepay/upload #存储根路径 ( 无需以‘/’结尾 )
#是否允许跨域请求 [生产环境建议关闭, 若api与前端项目没有在同一个域名下时应开启此配置或在nginx统一配置允许跨域]
allow-cors: true
oss:
file-root-path: /home/jeepay/upload #存储根路径 ( 无需以‘/’结尾 )
file-public-path: ${isys.oss.file-root-path}/public #公共读取块 ( 一般配合root-path参数进行设置需以/ 开头, 无需以‘/’结尾 )
file-private-path: ${isys.oss.file-root-path}/private #私有化本地访问不允许url方式公共读取 ( 一般配合root-path参数进行设置需以/ 开头, 无需以‘/’结尾 )
# [local]: 本地存储所有的文件将存在放本地可通过nfs, rsync工具实现多机共享
# [aliyun-oss]: 将文件统一上传到阿里云oss服务器; 注意需调整jeepay-oss/pom.xml中的aliyun-sdk-oss组件依赖方式
service-type: local
# 阿里云OSS服务配置信息
aliyun-oss:
endpoint: oss-cn-beijing.aliyuncs.com #endpoint 如: oss-cn-beijing.aliyuncs.com
public-bucket-name: bucket1 #公共读 桶名称
private-bucket-name: bucket2 #私有 桶名称
access-key-id: KEY_KEY_KEY #AccessKeyId
access-key-secret: SECRET_SECRET_SECRET #AccessKeySecret

View File

@ -188,6 +188,7 @@ CREATE TABLE `t_pay_interface_define` (
`if_name` VARCHAR(20) NOT NULL COMMENT '接口名称',
`is_mch_mode` TINYINT(6) NOT NULL DEFAULT 1 COMMENT '是否支持普通商户模式: 0-不支持, 1-支持',
`is_isv_mode` TINYINT(6) NOT NULL DEFAULT 1 COMMENT '是否支持服务商子商户模式: 0-不支持, 1-支持',
`config_page_type` TINYINT(6) NOT NULL DEFAULT 1 COMMENT '支付参数配置页面类型:1-JSON渲染,2-自定义',
`isv_params` VARCHAR(4096) DEFAULT NULL COMMENT 'ISV接口配置定义描述,json字符串',
`isvsub_mch_params` VARCHAR(4096) DEFAULT NULL COMMENT '特约商户接口配置定义描述,json字符串',
`normal_mch_params` VARCHAR(4096) DEFAULT NULL COMMENT '普通商户接口配置定义描述,json字符串',
@ -574,25 +575,25 @@ INSERT INTO t_pay_way (way_code, way_name) VALUES ('YSF_BAR', '云闪付条码')
INSERT INTO t_pay_way (way_code, way_name) VALUES ('YSF_JSAPI', '云闪付jsapi');
-- 初始化支付接口定义
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('alipay', '支付宝官方', 1, 1,
'[{"name":"sandbox","desc":"环境配置","type":"radio","verify":"","values":"1,0","titles":"沙箱环境,生产环境","verify":"required"},{"name":"pid","desc":"合作伙伴身份PID","type":"text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"privateKey", "desc":"应用私钥", "type": "textarea","verify":"required"},{"name":"alipayPublicKey", "desc":"支付宝公钥(不使用证书时必填)", "type": "textarea"},{"name":"signType","desc":"接口签名方式(推荐使用RSA2)","type":"radio","verify":"","values":"RSA,RSA2","titles":"RSA,RSA2","verify":"required"},{"name":"useCert","desc":"公钥证书","type":"radio","verify":"","values":"1,0","titles":"使用证书请使用RSA2私钥,不使用证书"},{"name":"appPublicCert","desc":"应用公钥证书(.crt格式","type":"file","verify":""},{"name":"alipayPublicCert","desc":"支付宝公钥证书(.crt格式","type":"file","verify":""},{"name":"alipayRootCert","desc":"支付宝根证书(.crt格式","type":"file","verify":""}]',
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('alipay', '支付宝官方', 1, 1, 1,
'[{"name":"sandbox","desc":"环境配置","type":"radio","verify":"","values":"1,0","titles":"沙箱环境,生产环境","verify":"required"},{"name":"pid","desc":"合作伙伴身份PID","type":"text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"privateKey", "desc":"应用私钥", "type": "textarea","verify":"required","star":"1"},{"name":"alipayPublicKey", "desc":"支付宝公钥(不使用证书时必填)", "type": "textarea","star":"1"},{"name":"signType","desc":"接口签名方式(推荐使用RSA2)","type":"radio","verify":"","values":"RSA,RSA2","titles":"RSA,RSA2","verify":"required"},{"name":"useCert","desc":"公钥证书","type":"radio","verify":"","values":"1,0","titles":"使用证书请使用RSA2私钥,不使用证书"},{"name":"appPublicCert","desc":"应用公钥证书(.crt格式","type":"file","verify":""},{"name":"alipayPublicCert","desc":"支付宝公钥证书(.crt格式","type":"file","verify":""},{"name":"alipayRootCert","desc":"支付宝根证书(.crt格式","type":"file","verify":""}]',
'[{"name":"appAuthToken", "desc":"子商户app_auth_token", "type": "text","readonly":"readonly"},{"name":"refreshToken", "desc":"子商户刷新token", "type": "hidden","readonly":"readonly"},{"name":"expireTimestamp", "desc":"authToken有效期13位时间戳", "type": "hidden","readonly":"readonly"}]',
'[{"name":"sandbox","desc":"环境配置","type":"radio","verify":"","values":"1,0","titles":"沙箱环境,生产环境","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"privateKey", "desc":"应用私钥", "type": "textarea","verify":"required"},{"name":"alipayPublicKey", "desc":"支付宝公钥(不使用证书时必填)", "type": "textarea"},{"name":"signType","desc":"接口签名方式(推荐使用RSA2)","type":"radio","verify":"","values":"RSA,RSA2","titles":"RSA,RSA2","verify":"required"},{"name":"useCert","desc":"公钥证书","type":"radio","verify":"","values":"1,0","titles":"使用证书请使用RSA2私钥,不使用证书"},{"name":"appPublicCert","desc":"应用公钥证书(.crt格式","type":"file","verify":""},{"name":"alipayPublicCert","desc":"支付宝公钥证书(.crt格式","type":"file","verify":""},{"name":"alipayRootCert","desc":"支付宝根证书(.crt格式","type":"file","verify":""}]',
'[{"name":"sandbox","desc":"环境配置","type":"radio","verify":"","values":"1,0","titles":"沙箱环境,生产环境","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"privateKey", "desc":"应用私钥", "type": "textarea","verify":"required","star":"1"},{"name":"alipayPublicKey", "desc":"支付宝公钥(不使用证书时必填)", "type": "textarea","star":"1"},{"name":"signType","desc":"接口签名方式(推荐使用RSA2)","type":"radio","verify":"","values":"RSA,RSA2","titles":"RSA,RSA2","verify":"required"},{"name":"useCert","desc":"公钥证书","type":"radio","verify":"","values":"1,0","titles":"使用证书请使用RSA2私钥,不使用证书"},{"name":"appPublicCert","desc":"应用公钥证书(.crt格式","type":"file","verify":""},{"name":"alipayPublicCert","desc":"支付宝公钥证书(.crt格式","type":"file","verify":""},{"name":"alipayRootCert","desc":"支付宝根证书(.crt格式","type":"file","verify":""}]',
'[{"wayCode": "ALI_JSAPI"}, {"wayCode": "ALI_WAP"}, {"wayCode": "ALI_BAR"}, {"wayCode": "ALI_APP"}, {"wayCode": "ALI_PC"}, {"wayCode": "ALI_QR"}]',
'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/alipay.png', '#1779FF', 1, '支付宝官方通道');
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('wxpay', '微信支付官方', 1, 1,
'[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"appSecret","desc":"应用AppSecret","type":"text","verify":"required"},{"name":"oauth2Url", "desc":"oauth2地址置空将使用官方", "type": "text"},{"name":"key", "desc":"API密钥", "type": "textarea","verify":"required"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"apiV3Key", "desc":"API V3秘钥V3接口必填", "type": "textarea","verify":""},{"name":"serialNo", "desc":"序列号V3接口必填", "type": "textarea","verify":""},{"name":"cert", "desc":"API证书(.p12格式)", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(.pem格式)", "type": "file","verify":""}]',
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('wxpay', '微信支付官方', 1, 1, 1,
'[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"appSecret","desc":"应用AppSecret","type":"text","verify":"required","star":"1"},{"name":"oauth2Url", "desc":"oauth2地址置空将使用官方", "type": "text"},{"name":"key", "desc":"API密钥", "type": "textarea","verify":"required","star":"1"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"apiV3Key", "desc":"API V3秘钥V3接口必填", "type": "textarea","verify":"","star":"1"},{"name":"serialNo", "desc":"序列号V3接口必填", "type": "textarea","verify":"","star":"1"},{"name":"cert", "desc":"API证书(.p12格式)", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(.pem格式)", "type": "file","verify":""}]',
'[{"name":"subMchId","desc":"子商户ID","type":"text","verify":"required"},{"name":"subMchAppId","desc":"子账户appID(线上支付必填)","type":"text","verify":""}]',
'[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"appSecret","desc":"应用AppSecret","type":"text","verify":"required"},{"name":"oauth2Url", "desc":"oauth2地址置空将使用官方", "type": "text"},{"name":"key", "desc":"API密钥", "type": "textarea","verify":"required"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"apiV3Key", "desc":"API V3秘钥V3接口必填", "type": "textarea","verify":""},{"name":"serialNo", "desc":"序列号V3接口必填", "type": "textarea","verify":""},{"name":"cert", "desc":"API证书(.p12格式)", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(.pem格式)", "type": "file","verify":""}]',
'[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"appSecret","desc":"应用AppSecret","type":"text","verify":"required","star":"1"},{"name":"oauth2Url", "desc":"oauth2地址置空将使用官方", "type": "text"},{"name":"key", "desc":"API密钥", "type": "textarea","verify":"required","star":"1"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"apiV3Key", "desc":"API V3秘钥V3接口必填", "type": "textarea","verify":"","star":"1"},{"name":"serialNo", "desc":"序列号V3接口必填", "type": "textarea","verify":"","star":"1" },{"name":"cert", "desc":"API证书(.p12格式)", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(.pem格式)", "type": "file","verify":""}]',
'[{"wayCode": "WX_APP"}, {"wayCode": "WX_H5"}, {"wayCode": "WX_NATIVE"}, {"wayCode": "WX_JSAPI"}, {"wayCode": "WX_BAR"}, {"wayCode": "WX_LITE"}]',
'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/wxpay.png', '#04BE02', 1, '微信官方通道');
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('ysfpay', '云闪付官方', 0, 1,
'[{"name":"sandbox","desc":"环境配置","type":"radio","verify":"","values":"1,0","titles":"沙箱环境,生产环境","verify":"required"},{"name":"serProvId","desc":"服务商开发ID[serProvId]","type":"text","verify":"required"},{"name":"isvPrivateCertFile","desc":"服务商私钥文件(.pfx格式","type":"file","verify":"required"},{"name":"isvPrivateCertPwd","desc":"服务商私钥文件密码","type":"text","verify":"required"},{"name":"ysfpayPublicKey","desc":"云闪付开发公钥(证书管理页面可查询)","type":"textarea","verify":"required"},{"name":"acqOrgCode","desc":"可用支付机构编号","type":"text","verify":"required"}]',
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('ysfpay', '云闪付官方', 0, 1, 1,
'[{"name":"sandbox","desc":"环境配置","type":"radio","verify":"","values":"1,0","titles":"沙箱环境,生产环境","verify":"required"},{"name":"serProvId","desc":"服务商开发ID[serProvId]","type":"text","verify":"required"},{"name":"isvPrivateCertFile","desc":"服务商私钥文件(.pfx格式","type":"file","verify":"required"},{"name":"isvPrivateCertPwd","desc":"服务商私钥文件密码","type":"text","verify":"required","star":"1"},{"name":"ysfpayPublicKey","desc":"云闪付开发公钥(证书管理页面可查询)","type":"textarea","verify":"required","star":"1"},{"name":"acqOrgCode","desc":"可用支付机构编号","type":"text","verify":"required"}]',
'[{"name":"merId","desc":"商户编号","type":"text","verify":"required"}]',
NULL,
'[{"wayCode": "YSF_BAR"}, {"wayCode": "ALI_JSAPI"}, {"wayCode": "WX_JSAPI"}, {"wayCode": "ALI_BAR"}, {"wayCode": "WX_BAR"}]',

View File

@ -10,5 +10,35 @@ ALTER TABLE `t_mch_notify_record` ADD COLUMN `notify_count_limit` INT(11) NOT NU
## -- ++++ ++++
-- 支付接口定义表 新增支付参数配置页面是否为自定义
ALTER TABLE `t_pay_interface_define` ADD COLUMN `config_page_type` TINYINT(6) NOT NULL DEFAULT 1 COMMENT '支付参数配置页面类型:1-JSON渲染,2-自定义' after `is_isv_mode`;
-- 优化支付接口定义初始化,新增是否为脱敏数据
DELETE FROM t_pay_interface_define WHERE if_code = 'alipay';
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('alipay', '支付宝官方', 1, 1, 1,
'[{"name":"sandbox","desc":"环境配置","type":"radio","verify":"","values":"1,0","titles":"沙箱环境,生产环境","verify":"required"},{"name":"pid","desc":"合作伙伴身份PID","type":"text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"privateKey", "desc":"应用私钥", "type": "textarea","verify":"required","star":"1"},{"name":"alipayPublicKey", "desc":"支付宝公钥(不使用证书时必填)", "type": "textarea","star":"1"},{"name":"signType","desc":"接口签名方式(推荐使用RSA2)","type":"radio","verify":"","values":"RSA,RSA2","titles":"RSA,RSA2","verify":"required"},{"name":"useCert","desc":"公钥证书","type":"radio","verify":"","values":"1,0","titles":"使用证书请使用RSA2私钥,不使用证书"},{"name":"appPublicCert","desc":"应用公钥证书(.crt格式","type":"file","verify":""},{"name":"alipayPublicCert","desc":"支付宝公钥证书(.crt格式","type":"file","verify":""},{"name":"alipayRootCert","desc":"支付宝根证书(.crt格式","type":"file","verify":""}]',
'[{"name":"appAuthToken", "desc":"子商户app_auth_token", "type": "text","readonly":"readonly"},{"name":"refreshToken", "desc":"子商户刷新token", "type": "hidden","readonly":"readonly"},{"name":"expireTimestamp", "desc":"authToken有效期13位时间戳", "type": "hidden","readonly":"readonly"}]',
'[{"name":"sandbox","desc":"环境配置","type":"radio","verify":"","values":"1,0","titles":"沙箱环境,生产环境","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"privateKey", "desc":"应用私钥", "type": "textarea","verify":"required","star":"1"},{"name":"alipayPublicKey", "desc":"支付宝公钥(不使用证书时必填)", "type": "textarea","star":"1"},{"name":"signType","desc":"接口签名方式(推荐使用RSA2)","type":"radio","verify":"","values":"RSA,RSA2","titles":"RSA,RSA2","verify":"required"},{"name":"useCert","desc":"公钥证书","type":"radio","verify":"","values":"1,0","titles":"使用证书请使用RSA2私钥,不使用证书"},{"name":"appPublicCert","desc":"应用公钥证书(.crt格式","type":"file","verify":""},{"name":"alipayPublicCert","desc":"支付宝公钥证书(.crt格式","type":"file","verify":""},{"name":"alipayRootCert","desc":"支付宝根证书(.crt格式","type":"file","verify":""}]',
'[{"wayCode": "ALI_JSAPI"}, {"wayCode": "ALI_WAP"}, {"wayCode": "ALI_BAR"}, {"wayCode": "ALI_APP"}, {"wayCode": "ALI_PC"}, {"wayCode": "ALI_QR"}]',
'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/alipay.png', '#1779FF', 1, '支付宝官方通道');
DELETE FROM t_pay_interface_define WHERE if_code = 'wxpay';
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('wxpay', '微信支付官方', 1, 1, 1,
'[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"appSecret","desc":"应用AppSecret","type":"text","verify":"required","star":"1"},{"name":"oauth2Url", "desc":"oauth2地址置空将使用官方", "type": "text"},{"name":"key", "desc":"API密钥", "type": "textarea","verify":"required","star":"1"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"apiV3Key", "desc":"API V3秘钥V3接口必填", "type": "textarea","verify":"","star":"1"},{"name":"serialNo", "desc":"序列号V3接口必填", "type": "textarea","verify":"","star":"1"},{"name":"cert", "desc":"API证书(.p12格式)", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(.pem格式)", "type": "file","verify":""}]',
'[{"name":"subMchId","desc":"子商户ID","type":"text","verify":"required"},{"name":"subMchAppId","desc":"子账户appID(线上支付必填)","type":"text","verify":""}]',
'[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"appSecret","desc":"应用AppSecret","type":"text","verify":"required","star":"1"},{"name":"oauth2Url", "desc":"oauth2地址置空将使用官方", "type": "text"},{"name":"key", "desc":"API密钥", "type": "textarea","verify":"required","star":"1"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"apiV3Key", "desc":"API V3秘钥V3接口必填", "type": "textarea","verify":"","star":"1"},{"name":"serialNo", "desc":"序列号V3接口必填", "type": "textarea","verify":"","star":"1" },{"name":"cert", "desc":"API证书(.p12格式)", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(.pem格式)", "type": "file","verify":""}]',
'[{"wayCode": "WX_APP"}, {"wayCode": "WX_H5"}, {"wayCode": "WX_NATIVE"}, {"wayCode": "WX_JSAPI"}, {"wayCode": "WX_BAR"}, {"wayCode": "WX_LITE"}]',
'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/wxpay.png', '#04BE02', 1, '微信官方通道');
DELETE FROM t_pay_interface_define WHERE if_code = 'ysfpay';
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('ysfpay', '云闪付官方', 0, 1, 1,
'[{"name":"sandbox","desc":"环境配置","type":"radio","verify":"","values":"1,0","titles":"沙箱环境,生产环境","verify":"required"},{"name":"serProvId","desc":"服务商开发ID[serProvId]","type":"text","verify":"required"},{"name":"isvPrivateCertFile","desc":"服务商私钥文件(.pfx格式","type":"file","verify":"required"},{"name":"isvPrivateCertPwd","desc":"服务商私钥文件密码","type":"text","verify":"required","star":"1"},{"name":"ysfpayPublicKey","desc":"云闪付开发公钥(证书管理页面可查询)","type":"textarea","verify":"required","star":"1"},{"name":"acqOrgCode","desc":"可用支付机构编号","type":"text","verify":"required"}]',
'[{"name":"merId","desc":"商户编号","type":"text","verify":"required"}]',
NULL,
'[{"wayCode": "YSF_BAR"}, {"wayCode": "ALI_JSAPI"}, {"wayCode": "WX_JSAPI"}, {"wayCode": "ALI_BAR"}, {"wayCode": "WX_BAR"}]',
'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/ysfpay.png', 'red', 1, '云闪付官方通道');

View File

@ -70,6 +70,11 @@ public class PayInterfaceDefine extends BaseModel implements Serializable {
*/
private Byte isIsvMode;
/**
* 支付参数配置页面类型:1-JSON渲染,2-自定义
*/
private Byte configPageType;
/**
* ISV接口配置定义描述,json字符串
*/

View File

@ -64,4 +64,9 @@ public class DBApplicationConfig implements Serializable {
return getPaySiteUrl() + "/api/scan/imgs/" + JeepayKit.aesEncode(url) + ".png";
}
/** 生成 【支付宝 isv子商户的授权链接地址】 **/
public String genAlipayIsvsubMchAuthUrl(String isvNo, String mchAppId){
return getPaySiteUrl() + "/api/channelbiz/alipay/redirectAppToAppAuth/" + isvNo + "_" + mchAppId;
}
}

View File

@ -21,12 +21,13 @@ import com.jeequan.jeepay.core.model.params.alipay.AlipayIsvParams;
import com.jeequan.jeepay.core.model.params.wxpay.WxpayIsvParams;
import com.jeequan.jeepay.core.model.params.ysf.YsfpayIsvParams;
/*
/**
* 抽象类 isv参数定义
*
* @author terrfly
* @site https://www.jeepay.vip
* @date 2021/6/8 16:33
* @modify ZhuXiao
*/
public abstract class IsvParams {
@ -42,4 +43,9 @@ public abstract class IsvParams {
return null;
}
/**
* 敏感数据脱敏
*/
public abstract String deSenData();
}

View File

@ -39,4 +39,9 @@ public abstract class NormalMchParams {
return null;
}
/**
* 敏感数据脱敏
*/
public abstract String deSenData();
}

View File

@ -38,6 +38,11 @@ public class AlipayConfig{
public static String PROD_OAUTH_URL = "https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=%s&scope=auth_base&state=&redirect_uri=%s";
public static String SANDBOX_OAUTH_URL = "https://openauth.alipaydev.com/oauth2/publicAppAuthorize.htm?app_id=%s&scope=auth_base&state=&redirect_uri=%s";
/** isv获取授权商户URL地址 **/
public static String PROD_APP_TO_APP_AUTH_URL = "https://openauth.alipay.com/oauth2/appToAppAuth.htm?app_id=%s&redirect_uri=%s&state=%s";
public static String SANDBOX_APP_TO_APP_AUTH_URL = "https://openauth.alipaydev.com/oauth2/appToAppAuth.htm?app_id=%s&redirect_uri=%s&state=%s";
public static String FORMAT = "json";
public static String CHARSET = "UTF-8";

View File

@ -15,8 +15,12 @@
*/
package com.jeequan.jeepay.core.model.params.alipay;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.model.params.IsvParams;
import com.jeequan.jeepay.core.utils.StringKit;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
/*
* 支付宝 isv参数定义
@ -58,4 +62,17 @@ public class AlipayIsvParams extends IsvParams {
/** 支付宝根证书 **/
private String alipayRootCert;
@Override
public String deSenData() {
AlipayIsvParams isvParams = this;
if (StringUtils.isNotBlank(this.privateKey)) {
isvParams.setPrivateKey(StringKit.str2Star(this.privateKey, 4, 4, 6));
}
if (StringUtils.isNotBlank(this.alipayPublicKey)) {
isvParams.setAlipayPublicKey(StringKit.str2Star(this.alipayPublicKey, 6, 6, 6));
}
return ((JSONObject) JSON.toJSON(isvParams)).toJSONString();
}
}

View File

@ -15,8 +15,12 @@
*/
package com.jeequan.jeepay.core.model.params.alipay;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.model.params.NormalMchParams;
import com.jeequan.jeepay.core.utils.StringKit;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
/*
* 支付宝 普通商户参数定义
@ -55,5 +59,17 @@ public class AlipayNormalMchParams extends NormalMchParams {
/** 支付宝根证书 **/
private String alipayRootCert;
@Override
public String deSenData() {
AlipayNormalMchParams mchParams = this;
if (StringUtils.isNotBlank(this.privateKey)) {
mchParams.setPrivateKey(StringKit.str2Star(this.privateKey, 4, 4, 6));
}
if (StringUtils.isNotBlank(this.alipayPublicKey)) {
mchParams.setAlipayPublicKey(StringKit.str2Star(this.alipayPublicKey, 6, 6, 6));
}
return ((JSONObject) JSON.toJSON(mchParams)).toJSONString();
}
}

View File

@ -15,8 +15,12 @@
*/
package com.jeequan.jeepay.core.model.params.wxpay;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.model.params.IsvParams;
import com.jeequan.jeepay.core.utils.StringKit;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
/*
* 微信官方支付 配置参数
@ -61,4 +65,23 @@ public class WxpayIsvParams extends IsvParams {
/** 私钥文件(.pem格式) **/
private String apiClientKey;
@Override
public String deSenData() {
WxpayIsvParams isvParams = this;
if (StringUtils.isNotBlank(this.appSecret)) {
isvParams.setAppSecret(StringKit.str2Star(this.appSecret, 4, 4, 6));
}
if (StringUtils.isNotBlank(this.key)) {
isvParams.setKey(StringKit.str2Star(this.key, 4, 4, 6));
}
if (StringUtils.isNotBlank(this.apiV3Key)) {
isvParams.setApiV3Key(StringKit.str2Star(this.apiV3Key, 4, 4, 6));
}
if (StringUtils.isNotBlank(this.serialNo)) {
isvParams.setSerialNo(StringKit.str2Star(this.serialNo, 4, 4, 6));
}
return ((JSONObject)JSON.toJSON(isvParams)).toJSONString();
}
}

View File

@ -15,8 +15,12 @@
*/
package com.jeequan.jeepay.core.model.params.wxpay;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.model.params.NormalMchParams;
import com.jeequan.jeepay.core.utils.StringKit;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
/*
* 微信官方支付 配置参数
@ -28,34 +32,72 @@ import lombok.Data;
@Data
public class WxpayNormalMchParams extends NormalMchParams {
/** 应用App ID */
/**
* 应用App ID
*/
private String appId;
/** 应用AppSecret */
/**
* 应用AppSecret
*/
private String appSecret;
/** 微信支付商户号 */
/**
* 微信支付商户号
*/
private String mchId;
/** oauth2地址 */
/**
* oauth2地址
*/
private String oauth2Url;
/** API密钥 */
/**
* API密钥
*/
private String key;
/** 微信支付API版本 **/
/**
* 微信支付API版本
**/
private String apiVersion;
/** API V3秘钥 **/
/**
* API V3秘钥
**/
private String apiV3Key;
/** 序列号 **/
/**
* 序列号
**/
private String serialNo;
/** API证书(.p12格式)**/
/**
* API证书(.p12格式)
**/
private String cert;
/** 私钥文件(.pem格式) **/
/**
* 私钥文件(.pem格式)
**/
private String apiClientKey;
@Override
public String deSenData() {
WxpayNormalMchParams mchParams = this;
if (StringUtils.isNotBlank(this.appSecret)) {
mchParams.setAppSecret(StringKit.str2Star(this.appSecret, 4, 4, 6));
}
if (StringUtils.isNotBlank(this.key)) {
mchParams.setKey(StringKit.str2Star(this.key, 4, 4, 6));
}
if (StringUtils.isNotBlank(this.apiV3Key)) {
mchParams.setApiV3Key(StringKit.str2Star(this.apiV3Key, 4, 4, 6));
}
if (StringUtils.isNotBlank(this.serialNo)) {
mchParams.setSerialNo(StringKit.str2Star(this.serialNo, 4, 4, 6));
}
return ((JSONObject) JSON.toJSON(mchParams)).toJSONString();
}
}

View File

@ -15,8 +15,12 @@
*/
package com.jeequan.jeepay.core.model.params.ysf;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.model.params.IsvParams;
import com.jeequan.jeepay.core.utils.StringKit;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
/*
* 云闪付 配置信息
@ -46,4 +50,17 @@ public class YsfpayIsvParams extends IsvParams {
/** acqOrgCodeList 支付机构号 **/
private String acqOrgCode;
@Override
public String deSenData() {
YsfpayIsvParams isvParams = this;
if (StringUtils.isNotBlank(this.isvPrivateCertPwd)) {
isvParams.setIsvPrivateCertPwd(StringKit.str2Star(this.isvPrivateCertPwd, 0, 3, 6));
}
if (StringUtils.isNotBlank(this.ysfpayPublicKey)) {
isvParams.setYsfpayPublicKey(StringKit.str2Star(this.ysfpayPublicKey, 6, 6, 6));
}
return ((JSONObject) JSON.toJSON(isvParams)).toJSONString();
}
}

View File

@ -20,9 +20,7 @@ import com.jeequan.jeepay.core.constants.CS;
import com.jeequan.jeepay.core.exception.BizException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import sun.misc.BASE64Decoder;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@ -34,7 +32,7 @@ import java.util.regex.Pattern;
/*
* jeepay工具类
*
*
* @author terrfly
* @site https://www.jeepay.vip
* @date 2021/6/8 16:50
@ -42,13 +40,7 @@ import java.util.regex.Pattern;
@Slf4j
public class JeepayKit {
public static byte[] AES_KEY = null;
static{
try {
AES_KEY = new BASE64Decoder().decodeBuffer("4ChT08phkz59hquD795X7w==");
} catch (IOException e) {
}
}
public static byte[] AES_KEY = "4ChT08phkz59hquD795X7w==".getBytes();
/** 加密 **/
public static String aesEncode(String str){

View File

@ -16,6 +16,7 @@
package com.jeequan.jeepay.core.utils;
import cn.hutool.core.net.url.UrlBuilder;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import java.util.Map;
@ -65,4 +66,83 @@ public class StringKit {
return url.startsWith("http://") ||url.startsWith("https://");
}
/**
* 对字符加星号处理除前面几位和后面几位外其他的字符以星号代替
*
* @param content 传入的字符串
* @param frontNum 保留前面字符的位数
* @param endNum 保留后面字符的位数
* @return 带星号的字符串
*/
public static String str2Star2(String content, int frontNum, int endNum) {
if (frontNum >= content.length() || frontNum < 0) {
return content;
}
if (endNum >= content.length() || endNum < 0) {
return content;
}
if (frontNum + endNum >= content.length()) {
return content;
}
String starStr = "";
for (int i = 0; i < (content.length() - frontNum - endNum); i++) {
starStr = starStr + "*";
}
return content.substring(0, frontNum) + starStr
+ content.substring(content.length() - endNum, content.length());
}
/**
* 对字符加星号处理除前面几位和后面几位外其他的字符以星号代替
*
* @param content 传入的字符串
* @param frontNum 保留前面字符的位数
* @param endNum 保留后面字符的位数
* @param starNum 指定star的数量
* @return 带星号的字符串
*/
public static String str2Star(String content, int frontNum, int endNum, int starNum) {
if (frontNum >= content.length() || frontNum < 0) {
return content;
}
if (endNum >= content.length() || endNum < 0) {
return content;
}
if (frontNum + endNum >= content.length()) {
return content;
}
String starStr = "";
for (int i = 0; i < starNum; i++) {
starStr = starStr + "*";
}
return content.substring(0, frontNum) + starStr
+ content.substring(content.length() - endNum, content.length());
}
/**
* 合并两个json字符串
* key相同则后者覆盖前者的值
* key不同则合并至前者
* @param originStr
* @param mergeStr
* @return 合并后的json字符串
*/
public static String marge(String originStr, String mergeStr) {
if (StringUtils.isAnyBlank(originStr, mergeStr)) {
return null;
}
JSONObject originJSON = JSONObject.parseObject(originStr);
JSONObject mergeJSON = JSONObject.parseObject(mergeStr);
if (originJSON == null || mergeJSON == null) {
return null;
}
originJSON.putAll(mergeJSON);
return originJSON.toJSONString();
}
}

View File

@ -15,21 +15,26 @@
*/
package com.jeequan.jeepay.mgr.ctrl.isv;
import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.aop.MethodLog;
import com.jeequan.jeepay.core.constants.ApiCodeEnum;
import com.jeequan.jeepay.core.constants.CS;
import com.jeequan.jeepay.core.entity.PayInterfaceConfig;
import com.jeequan.jeepay.core.entity.PayInterfaceDefine;
import com.jeequan.jeepay.core.model.ApiRes;
import com.jeequan.jeepay.core.model.params.IsvParams;
import com.jeequan.jeepay.core.mq.MqCommonService;
import com.jeequan.jeepay.core.utils.StringKit;
import com.jeequan.jeepay.mgr.ctrl.CommonCtrl;
import com.jeequan.jeepay.service.impl.PayInterfaceConfigService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* 服务商支付接口管理类
@ -67,8 +72,16 @@ public class IsvPayInterfaceConfigController extends CommonCtrl {
@GetMapping("/{isvNo}/{ifCode}")
public ApiRes getByMchNo(@PathVariable(value = "isvNo") String isvNo, @PathVariable(value = "ifCode") String ifCode) {
PayInterfaceConfig payInterfaceConfig = payInterfaceConfigService.getByInfoIdAndIfCode(CS.INFO_TYPE_ISV, isvNo, ifCode);
if (payInterfaceConfig != null && payInterfaceConfig.getIfRate() != null) {
payInterfaceConfig.setIfRate(payInterfaceConfig.getIfRate().multiply(new BigDecimal("100")));
if (payInterfaceConfig != null) {
if (payInterfaceConfig.getIfRate() != null) {
payInterfaceConfig.setIfRate(payInterfaceConfig.getIfRate().multiply(new BigDecimal("100")));
}
if (StringUtils.isNotBlank(payInterfaceConfig.getIfParams())) {
IsvParams isvParams = IsvParams.factory(payInterfaceConfig.getIfCode(), payInterfaceConfig.getIfParams());
if (isvParams != null) {
payInterfaceConfig.setIfParams(isvParams.deSenData());
}
}
}
return ApiRes.ok(payInterfaceConfig);
}
@ -105,6 +118,9 @@ public class IsvPayInterfaceConfigController extends CommonCtrl {
//若配置存在为saveOrUpdate添加ID第一次配置添加创建者
if (dbRecoed != null) {
payInterfaceConfig.setId(dbRecoed.getId());
// 合并支付参数
payInterfaceConfig.setIfParams(StringKit.marge(dbRecoed.getIfParams(), payInterfaceConfig.getIfParams()));
}else {
payInterfaceConfig.setCreatedUid(userId);
payInterfaceConfig.setCreatedBy(realName);

View File

@ -26,6 +26,7 @@ import com.jeequan.jeepay.core.entity.MchApp;
import com.jeequan.jeepay.core.model.ApiRes;
import com.jeequan.jeepay.core.mq.MqCommonService;
import com.jeequan.jeepay.core.utils.JsonKit;
import com.jeequan.jeepay.core.utils.StringKit;
import com.jeequan.jeepay.mgr.ctrl.CommonCtrl;
import com.jeequan.jeepay.service.impl.MchAppService;
import com.jeequan.jeepay.service.impl.MchInfoService;
@ -59,14 +60,7 @@ public class MchAppController extends CommonCtrl {
public ApiRes list() {
MchApp mchApp = getObject(MchApp.class);
LambdaQueryWrapper<MchApp> wrapper = MchApp.gw();
if (StringUtils.isNotEmpty(mchApp.getMchNo())) wrapper.eq(MchApp::getMchNo, mchApp.getMchNo());
if (StringUtils.isNotEmpty(mchApp.getAppId())) wrapper.eq(MchApp::getAppId, mchApp.getAppId());
if (StringUtils.isNotEmpty(mchApp.getAppName())) wrapper.eq(MchApp::getAppName, mchApp.getAppName());
if (mchApp.getState() != null) wrapper.eq(MchApp::getState, mchApp.getState());
wrapper.orderByDesc(MchApp::getCreatedAt);
IPage<MchApp> pages = mchAppService.page(getIPage(), wrapper);
IPage<MchApp> pages = mchAppService.selectPage(getIPage(), mchApp);
return ApiRes.ok(pages);
}
@ -101,7 +95,7 @@ public class MchAppController extends CommonCtrl {
@PreAuthorize("hasAnyAuthority('ENT_MCH_APP_VIEW', 'ENT_MCH_APP_EDIT')")
@GetMapping("/{appId}")
public ApiRes detail(@PathVariable("appId") String appId) {
MchApp mchApp = mchAppService.getById(appId);
MchApp mchApp = mchAppService.selectById(appId);
if (mchApp == null) {
return ApiRes.fail(ApiCodeEnum.SYS_OPERATION_FAIL_SELETE);
}

View File

@ -20,14 +20,20 @@ import com.jeequan.jeepay.core.aop.MethodLog;
import com.jeequan.jeepay.core.constants.ApiCodeEnum;
import com.jeequan.jeepay.core.constants.CS;
import com.jeequan.jeepay.core.entity.MchApp;
import com.jeequan.jeepay.core.entity.MchInfo;
import com.jeequan.jeepay.core.entity.PayInterfaceConfig;
import com.jeequan.jeepay.core.entity.PayInterfaceDefine;
import com.jeequan.jeepay.core.model.ApiRes;
import com.jeequan.jeepay.core.model.params.NormalMchParams;
import com.jeequan.jeepay.core.mq.MqCommonService;
import com.jeequan.jeepay.core.utils.JsonKit;
import com.jeequan.jeepay.core.utils.StringKit;
import com.jeequan.jeepay.mgr.ctrl.CommonCtrl;
import com.jeequan.jeepay.service.impl.MchAppService;
import com.jeequan.jeepay.service.impl.MchInfoService;
import com.jeequan.jeepay.service.impl.PayInterfaceConfigService;
import com.jeequan.jeepay.service.impl.SysConfigService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -49,6 +55,8 @@ public class MchPayInterfaceConfigController extends CommonCtrl {
@Autowired private PayInterfaceConfigService payInterfaceConfigService;
@Autowired private MchAppService mchAppService;
@Autowired private MqCommonService mqCommonService;
@Autowired private MchInfoService mchInfoService;
@Autowired private SysConfigService sysConfigService;
/**
* @Author: ZhuXiao
@ -72,8 +80,25 @@ public class MchPayInterfaceConfigController extends CommonCtrl {
@GetMapping("/{appId}/{ifCode}")
public ApiRes getByAppId(@PathVariable(value = "appId") String appId, @PathVariable(value = "ifCode") String ifCode) {
PayInterfaceConfig payInterfaceConfig = payInterfaceConfigService.getByInfoIdAndIfCode(CS.INFO_TYPE_MCH_APP, appId, ifCode);
if (payInterfaceConfig != null && payInterfaceConfig.getIfRate() != null) {
payInterfaceConfig.setIfRate(payInterfaceConfig.getIfRate().multiply(new BigDecimal("100")));
if (payInterfaceConfig != null) {
// 费率转换为百分比数值
if (payInterfaceConfig.getIfRate() != null) {
payInterfaceConfig.setIfRate(payInterfaceConfig.getIfRate().multiply(new BigDecimal("100")));
}
// 敏感数据脱敏
if (StringUtils.isNotBlank(payInterfaceConfig.getIfParams())) {
MchApp mchApp = mchAppService.getById(appId);
MchInfo mchInfo = mchInfoService.getById(mchApp.getMchNo());
// 普通商户的支付参数执行数据脱敏
if (mchInfo.getType() == CS.MCH_TYPE_NORMAL) {
NormalMchParams mchParams = NormalMchParams.factory(payInterfaceConfig.getIfCode(), payInterfaceConfig.getIfParams());
if (mchParams != null) {
payInterfaceConfig.setIfParams(mchParams.deSenData());
}
}
}
}
return ApiRes.ok(payInterfaceConfig);
}
@ -116,6 +141,9 @@ public class MchPayInterfaceConfigController extends CommonCtrl {
//若配置存在为saveOrUpdate添加ID第一次配置添加创建者
if (dbRecoed != null) {
payInterfaceConfig.setId(dbRecoed.getId());
// 合并支付参数
payInterfaceConfig.setIfParams(StringKit.marge(dbRecoed.getIfParams(), payInterfaceConfig.getIfParams()));
}else {
payInterfaceConfig.setCreatedUid(userId);
payInterfaceConfig.setCreatedBy(realName);
@ -132,4 +160,21 @@ public class MchPayInterfaceConfigController extends CommonCtrl {
return ApiRes.ok();
}
/** 查询支付宝商户授权URL **/
@GetMapping("/alipayIsvsubMchAuthUrls/{mchAppId}")
public ApiRes queryAlipayIsvsubMchAuthUrl(@PathVariable String mchAppId) {
MchApp mchApp = mchAppService.getById(mchAppId);
MchInfo mchInfo = mchInfoService.getById(mchApp.getMchNo());
String authUrl = sysConfigService.getDBApplicationConfig().genAlipayIsvsubMchAuthUrl(mchInfo.getIsvNo(), mchAppId);
String authQrImgUrl = sysConfigService.getDBApplicationConfig().genScanImgUrl(authUrl);
JSONObject result = new JSONObject();
result.put("authUrl", authUrl);
result.put("authQrImgUrl", authQrImgUrl);
return ApiRes.ok(result);
}
}

View File

@ -57,15 +57,9 @@ public class MchAppController extends CommonCtrl {
@GetMapping
public ApiRes list() {
MchApp mchApp = getObject(MchApp.class);
mchApp.setMchNo(getCurrentMchNo());
LambdaQueryWrapper<MchApp> wrapper = MchApp.gw();
wrapper.eq(MchApp::getMchNo, getCurrentMchNo());
if (StringUtils.isNotEmpty(mchApp.getAppId())) wrapper.eq(MchApp::getAppId, mchApp.getAppId());
if (StringUtils.isNotEmpty(mchApp.getAppName())) wrapper.eq(MchApp::getAppName, mchApp.getAppName());
if (mchApp.getState() != null) wrapper.eq(MchApp::getState, mchApp.getState());
wrapper.orderByDesc(MchApp::getCreatedAt);
IPage<MchApp> pages = mchAppService.page(getIPage(true), wrapper);
IPage<MchApp> pages = mchAppService.selectPage(getIPage(true), mchApp);
return ApiRes.ok(pages);
}
@ -97,7 +91,7 @@ public class MchAppController extends CommonCtrl {
@PreAuthorize("hasAnyAuthority('ENT_MCH_APP_VIEW', 'ENT_MCH_APP_EDIT')")
@GetMapping("/{appId}")
public ApiRes detail(@PathVariable("appId") String appId) {
MchApp mchApp = mchAppService.getById(appId);
MchApp mchApp = mchAppService.selectById(appId);
if (mchApp == null || !mchApp.getMchNo().equals(getCurrentMchNo())) {
return ApiRes.fail(ApiCodeEnum.SYS_OPERATION_FAIL_SELETE);

View File

@ -17,17 +17,24 @@ package com.jeequan.jeepay.mch.ctrl.merchant;
import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.aop.MethodLog;
import com.jeequan.jeepay.core.constants.ApiCodeEnum;
import com.jeequan.jeepay.core.constants.CS;
import com.jeequan.jeepay.core.entity.MchApp;
import com.jeequan.jeepay.core.entity.MchInfo;
import com.jeequan.jeepay.core.entity.PayInterfaceConfig;
import com.jeequan.jeepay.core.entity.PayInterfaceDefine;
import com.jeequan.jeepay.core.exception.BizException;
import com.jeequan.jeepay.core.model.ApiRes;
import com.jeequan.jeepay.core.model.params.NormalMchParams;
import com.jeequan.jeepay.core.mq.MqCommonService;
import com.jeequan.jeepay.core.utils.JsonKit;
import com.jeequan.jeepay.core.utils.StringKit;
import com.jeequan.jeepay.mch.ctrl.CommonCtrl;
import com.jeequan.jeepay.service.impl.MchAppService;
import com.jeequan.jeepay.service.impl.MchInfoService;
import com.jeequan.jeepay.service.impl.PayInterfaceConfigService;
import com.jeequan.jeepay.service.impl.SysConfigService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -49,6 +56,8 @@ public class MchPayInterfaceConfigController extends CommonCtrl {
@Autowired private PayInterfaceConfigService payInterfaceConfigService;
@Autowired private MchInfoService mchInfoService;
@Autowired private MqCommonService mqCommonService;
@Autowired private MchAppService mchAppService;
@Autowired private SysConfigService sysConfigService;
/**
* @Author: ZhuXiao
@ -78,8 +87,24 @@ public class MchPayInterfaceConfigController extends CommonCtrl {
@GetMapping("/{appId}/{ifCode}")
public ApiRes getByMchNo(@PathVariable(value = "appId") String appId, @PathVariable(value = "ifCode") String ifCode) {
PayInterfaceConfig payInterfaceConfig = payInterfaceConfigService.getByInfoIdAndIfCode(CS.INFO_TYPE_MCH_APP, appId, ifCode);
if (payInterfaceConfig != null && payInterfaceConfig.getIfRate() != null) {
payInterfaceConfig.setIfRate(payInterfaceConfig.getIfRate().multiply(new BigDecimal("100")));
if (payInterfaceConfig != null) {
// 费率转换为百分比数值
if (payInterfaceConfig.getIfRate() != null) {
payInterfaceConfig.setIfRate(payInterfaceConfig.getIfRate().multiply(new BigDecimal("100")));
}
// 敏感数据脱敏
if (StringUtils.isNotBlank(payInterfaceConfig.getIfParams())) {
MchInfo mchInfo = mchInfoService.getById(getCurrentMchNo());
// 普通商户的支付参数执行数据脱敏
if (mchInfo.getType() == CS.MCH_TYPE_NORMAL) {
NormalMchParams mchParams = NormalMchParams.factory(payInterfaceConfig.getIfCode(), payInterfaceConfig.getIfParams());
if (mchParams != null) {
payInterfaceConfig.setIfParams(mchParams.deSenData());
}
}
}
}
return ApiRes.ok(payInterfaceConfig);
}
@ -117,6 +142,9 @@ public class MchPayInterfaceConfigController extends CommonCtrl {
//若配置存在为saveOrUpdate添加ID第一次配置添加创建者
if (dbRecoed != null) {
payInterfaceConfig.setId(dbRecoed.getId());
// 合并支付参数
payInterfaceConfig.setIfParams(StringKit.marge(dbRecoed.getIfParams(), payInterfaceConfig.getIfParams()));
}else {
payInterfaceConfig.setCreatedUid(userId);
payInterfaceConfig.setCreatedBy(realName);
@ -133,4 +161,25 @@ public class MchPayInterfaceConfigController extends CommonCtrl {
return ApiRes.ok();
}
/** 查询支付宝商户授权URL **/
@GetMapping("/alipayIsvsubMchAuthUrls/{mchAppId}")
public ApiRes queryAlipayIsvsubMchAuthUrl(@PathVariable String mchAppId) {
MchApp mchApp = mchAppService.getById(mchAppId);
if (mchApp == null || !mchApp.getMchNo().equals(getCurrentMchNo())) {
return ApiRes.fail(ApiCodeEnum.SYS_OPERATION_FAIL_SELETE);
}
MchInfo mchInfo = mchInfoService.getById(mchApp.getMchNo());
String authUrl = sysConfigService.getDBApplicationConfig().genAlipayIsvsubMchAuthUrl(mchInfo.getIsvNo(), mchAppId);
String authQrImgUrl = sysConfigService.getDBApplicationConfig().genScanImgUrl(authUrl);
JSONObject result = new JSONObject();
result.put("authUrl", authUrl);
result.put("authQrImgUrl", authQrImgUrl);
return ApiRes.ok(result);
}
}

View File

@ -0,0 +1,161 @@
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jeequan.jeepay.pay.channel.alipay.ctrl;
import cn.hutool.core.util.URLUtil;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.domain.AlipayOpenAuthTokenAppModel;
import com.alipay.api.request.AlipayOpenAuthTokenAppRequest;
import com.alipay.api.response.AlipayOpenAuthTokenAppResponse;
import com.jeequan.jeepay.core.constants.CS;
import com.jeequan.jeepay.core.ctrls.AbstractCtrl;
import com.jeequan.jeepay.core.entity.MchApp;
import com.jeequan.jeepay.core.entity.PayInterfaceConfig;
import com.jeequan.jeepay.core.exception.BizException;
import com.jeequan.jeepay.core.model.params.alipay.AlipayConfig;
import com.jeequan.jeepay.core.model.params.alipay.AlipayIsvParams;
import com.jeequan.jeepay.core.mq.MqCommonService;
import com.jeequan.jeepay.core.utils.JsonKit;
import com.jeequan.jeepay.pay.channel.alipay.AlipayKit;
import com.jeequan.jeepay.pay.model.AlipayClientWrapper;
import com.jeequan.jeepay.pay.model.IsvConfigContext;
import com.jeequan.jeepay.pay.service.ConfigContextService;
import com.jeequan.jeepay.service.impl.MchAppService;
import com.jeequan.jeepay.service.impl.PayInterfaceConfigService;
import com.jeequan.jeepay.service.impl.SysConfigService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import java.io.IOException;
import java.math.BigDecimal;
/**
* 渠道侧自定义业务ctrl
*
* @author terrfly
* @site https://www.jeepay.vip
* @date 2021/7/15 11:49
*/
@Slf4j
@Controller
@RequestMapping("/api/channelbiz/alipay")
public class AlipayBizController extends AbstractCtrl {
@Autowired private ConfigContextService configContextService;
@Autowired private SysConfigService sysConfigService;
@Autowired private PayInterfaceConfigService payInterfaceConfigService;
@Autowired private MqCommonService mqCommonService;
@Autowired private MchAppService mchAppService;
/** 跳转到支付宝的授权页面 统一从pay项目获取到isv配置信息
* isvAndMchNo 格式: ISVNO_MCHAPPID
* example: https://pay.jeepay.cn/api/channelbiz/alipay/redirectAppToAppAuth/V1623998765_60cc41694ee0e6685f57eb1f
* **/
@RequestMapping("/redirectAppToAppAuth/{isvAndMchAppId}")
public void redirectAppToAppAuth(@PathVariable("isvAndMchAppId") String isvAndMchAppId) throws IOException {
String isvNo = isvAndMchAppId.split("_")[0];
IsvConfigContext isvConfigContext = configContextService.getIsvConfigContext(isvNo);
AlipayIsvParams alipayIsvParams = isvConfigContext.getIsvParamsByIfCode(CS.IF_CODE.ALIPAY, AlipayIsvParams.class);
alipayIsvParams.getSandbox();
String oauthUrl = AlipayConfig.PROD_APP_TO_APP_AUTH_URL;
if(alipayIsvParams.getSandbox() != null && alipayIsvParams.getSandbox() == CS.YES){
oauthUrl = AlipayConfig.SANDBOX_APP_TO_APP_AUTH_URL;
}
String redirectUrl = sysConfigService.getDBApplicationConfig().getPaySiteUrl() + "/api/channelbiz/alipay/appToAppAuthCallback";
response.sendRedirect(String.format(oauthUrl, alipayIsvParams.getAppId(), URLUtil.encode(redirectUrl), isvAndMchAppId));
}
/** 支付宝授权回调地址 **/
@RequestMapping("/appToAppAuthCallback")
public String appToAppAuthCallback() {
String errMsg = null;
boolean isAlipaySysAuth = true; //是否 服务商登录支付宝后台系统发起的商户授权 此时无法获取authCode和商户的信息
try {
// isvAndMchAppId 格式: ISVNO_MCHAPPID, 如果isvAndMchNo为空说明是 支付宝后台的二维码授权之后的跳转链接
String isvAndMchAppId = getValString("state");
String appAuthCode = getValString("app_auth_code"); // 支付宝授权code
if(StringUtils.isNotEmpty(isvAndMchAppId) && StringUtils.isNotEmpty(appAuthCode)){
isAlipaySysAuth = false;
String isvNo = isvAndMchAppId.split("_")[0];
String mchAppId = isvAndMchAppId.split("_")[1];
AlipayClientWrapper alipayClientWrapper = configContextService.getIsvConfigContext(isvNo).getAlipayClientWrapper();
AlipayOpenAuthTokenAppRequest request = new AlipayOpenAuthTokenAppRequest();
AlipayOpenAuthTokenAppModel model = new AlipayOpenAuthTokenAppModel();
model.setGrantType("authorization_code");
model.setCode(appAuthCode);
request.setBizModel(model);
// expiresIn: 该字段已作废应用令牌长期有效接入方不需要消费该字段
// reExpiresIn: 刷新令牌的有效时间从接口调用时间作为起始时间单位到秒
// DateUtil.offsetSecond(new Date(), Integer.parseInt(resp.getExpiresIn()));
AlipayOpenAuthTokenAppResponse resp = alipayClientWrapper.execute(request);
if(!resp.isSuccess()){
throw new BizException(AlipayKit.appendErrMsg(resp.getMsg(), resp.getSubMsg()));
}
String appAuthToken = resp.getAppAuthToken();
JSONObject ifParams = new JSONObject();
ifParams.put("appAuthToken", appAuthToken); ifParams.put("refreshToken", resp.getAppRefreshToken()); ifParams.put("expireTimestamp", resp.getExpiresIn());
PayInterfaceConfig dbRecord = payInterfaceConfigService.getByInfoIdAndIfCode(CS.INFO_TYPE_MCH_APP, mchAppId, CS.IF_CODE.ALIPAY);
if(dbRecord != null){
PayInterfaceConfig updateRecord = new PayInterfaceConfig();
updateRecord.setId(dbRecord.getId()); updateRecord.setIfParams(ifParams.toJSONString());
payInterfaceConfigService.updateById(updateRecord);
}else{
dbRecord = new PayInterfaceConfig();
dbRecord.setInfoType(CS.INFO_TYPE_MCH_APP);
dbRecord.setInfoId(mchAppId);
dbRecord.setIfCode(CS.IF_CODE.ALIPAY);
dbRecord.setIfParams(ifParams.toJSONString());
dbRecord.setIfRate(new BigDecimal("0.006")); //默认费率
dbRecord.setState(CS.YES);
dbRecord.setCreatedBy("SYS");
dbRecord.setCreatedUid(0L);
payInterfaceConfigService.save(dbRecord);
}
MchApp mchApp = mchAppService.getById(mchAppId);
JSONObject jsonObject = JsonKit.newJson("mchNo", mchApp.getMchNo());
jsonObject.put("appId", mchApp.getAppId());
mqCommonService.send(jsonObject.toJSONString(), CS.MQ.MQ_TYPE_MODIFY_MCH_APP); // 推送mq到目前节点进行更新数据
}
} catch (Exception e) {
log.error("error", e);
errMsg = StringUtils.defaultIfBlank(e.getMessage(), "系统异常!");
}
request.setAttribute("errMsg", errMsg);
request.setAttribute("isAlipaySysAuth", isAlipaySysAuth);
return "channel/alipay/isvsubMchAuth";
}
}

View File

@ -27,6 +27,7 @@ import com.jeequan.jeepay.pay.rqrs.AbstractRS;
import com.jeequan.jeepay.pay.rqrs.payorder.UnifiedOrderRQ;
import com.jeequan.jeepay.pay.util.PaywayUtil;
import com.jeequan.jeepay.pay.model.MchAppConfigContext;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
/*
@ -93,7 +94,9 @@ public class WxpayPaymentService extends AbstractPaymentService {
if(mchAppConfigContext.isIsvsubMch()){
WxpayIsvsubMchParams isvsubMchParams = mchAppConfigContext.getIsvsubMchParamsByIfCode(getIfCode(), WxpayIsvsubMchParams.class);
request.setSubMchId(isvsubMchParams.getSubMchId());
request.setSubAppId(isvsubMchParams.getSubMchAppId());
if (StringUtils.isNotBlank(isvsubMchParams.getSubMchAppId())) {
request.setSubAppId(isvsubMchParams.getSubMchAppId());
}
}
return request;
@ -128,7 +131,9 @@ public class WxpayPaymentService extends AbstractPaymentService {
reqJSON.put("sp_appid", wxPayService.getConfig().getAppId());
reqJSON.put("sp_mchid", wxPayService.getConfig().getMchId());
reqJSON.put("sub_mchid", isvsubMchParams.getSubMchId());
reqJSON.put("sub_appid", isvsubMchParams.getSubMchAppId());
if (StringUtils.isNotBlank(isvsubMchParams.getSubMchAppId())) {
reqJSON.put("sub_appid", isvsubMchParams.getSubMchAppId());
}
}else { // 普通商户
reqJSON.put("appid", wxPayService.getConfig().getAppId());
reqJSON.put("mchid", wxPayService.getConfig().getMchId());

View File

@ -27,6 +27,7 @@ import com.github.binarywang.wxpay.v3.auth.PrivateKeySigner;
import com.github.binarywang.wxpay.v3.auth.WxPayCredentials;
import com.github.binarywang.wxpay.v3.auth.WxPayValidator;
import com.github.binarywang.wxpay.v3.util.PemUtils;
import com.github.binarywang.wxpay.v3.util.SignUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpStatus;
import org.apache.http.client.config.RequestConfig;
@ -71,9 +72,9 @@ public class WxpayV3Util {
ISV_URL_MAP.put(WxPayConstants.TradeType.MWEB, "/v3/pay/partner/transactions/h5");
}
public static JSONObject unifiedOrderV3(String url, JSONObject reqJSON, WxPayConfig wxPayConfig) throws WxPayException {
String response = postV3(PAY_BASE_URL + url, reqJSON.toJSONString(), wxPayConfig);
return JSON.parseObject(response);
public static JSONObject unifiedOrderV3(String reqUrl, JSONObject reqJSON, WxPayConfig wxPayConfig) throws WxPayException {
String response = postV3(PAY_BASE_URL + reqUrl, reqJSON.toJSONString(), wxPayConfig);
return JSONObject.parseObject(getPayInfo(response, wxPayConfig));
}
public static JSONObject queryOrderV3(String url, WxPayConfig wxPayConfig) throws WxPayException {
@ -215,4 +216,59 @@ public class WxpayV3Util {
return httpPost;
}
public static String getPayInfo(String response, WxPayConfig wxPayConfig) throws WxPayException {
try {
JSONObject resJSON = JSON.parseObject(response);
String timestamp = String.valueOf(System.currentTimeMillis() / 1000L);
String nonceStr = SignUtils.genRandomStr();
String prepayId = resJSON.getString("prepay_id");
switch(wxPayConfig.getTradeType()) {
case WxPayConstants.TradeType.JSAPI: {
Map<String, String> payInfo = new HashMap<>(); // 如果用JsonObject会出现签名错误
payInfo.put("appId", wxPayConfig.getAppId());
payInfo.put("timeStamp", timestamp);
payInfo.put("nonceStr", nonceStr);
payInfo.put("package", "prepay_id=" + prepayId);
payInfo.put("signType", "RSA");
String beforeSign = String.format("%s\n%s\n%s\n%s\n", wxPayConfig.getAppId(), timestamp, nonceStr, "prepay_id=" + prepayId);
payInfo.put("paySign", SignUtils.sign(beforeSign, PemUtils.loadPrivateKey(new FileInputStream(wxPayConfig.getPrivateKeyPath()))));
// 签名以后在增加prepayId参数
payInfo.put("prepayId", prepayId);
return JSON.toJSONString(payInfo);
}
case WxPayConstants.TradeType.MWEB: {
return response;
}
case WxPayConstants.TradeType.APP: {
Map<String, String> payInfo = new HashMap<>();
// APP支付绑定的是微信开放平台上的账号APPID为开放平台上绑定APP后发放的参数
String wxAppId = wxPayConfig.getSubAppId();
// 此map用于参与调起sdk支付的二次签名,格式全小写timestamp只能是10位,格式固定切勿修改
String partnerId = wxPayConfig.getSubMchId();
String packageValue = "Sign=WXPay";
// 此map用于客户端与微信服务器交互
String beforeSign = String.format("%s\n%s\n%s\n%s\n", wxAppId, timestamp, nonceStr, "prepay_id=" + prepayId);
payInfo.put("sign", SignUtils.sign(beforeSign, PemUtils.loadPrivateKey(new FileInputStream(wxPayConfig.getPrivateKeyPath()))));
payInfo.put("prepayId", prepayId);
payInfo.put("partnerId", partnerId);
payInfo.put("appId", wxAppId);
payInfo.put("package", packageValue);
payInfo.put("timeStamp", timestamp);
payInfo.put("nonceStr", nonceStr);
return JSON.toJSONString(payInfo);
}
case WxPayConstants.TradeType.NATIVE:
return response;
default:
return null;
}
} catch (Exception e) {
throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e);
}
}
}

View File

@ -23,12 +23,12 @@ import com.jeequan.jeepay.core.entity.PayOrder;
import com.jeequan.jeepay.pay.channel.wxpay.WxpayPaymentService;
import com.jeequan.jeepay.pay.channel.wxpay.kits.WxpayKit;
import com.jeequan.jeepay.pay.channel.wxpay.kits.WxpayV3Util;
import com.jeequan.jeepay.pay.model.MchAppConfigContext;
import com.jeequan.jeepay.pay.rqrs.AbstractRS;
import com.jeequan.jeepay.pay.rqrs.msg.ChannelRetMsg;
import com.jeequan.jeepay.pay.rqrs.payorder.UnifiedOrderRQ;
import com.jeequan.jeepay.pay.rqrs.payorder.payway.WxAppOrderRS;
import com.jeequan.jeepay.pay.rqrs.msg.ChannelRetMsg;
import com.jeequan.jeepay.pay.util.ApiResBuilder;
import com.jeequan.jeepay.pay.model.MchAppConfigContext;
import org.springframework.stereotype.Service;
/*
@ -50,6 +50,7 @@ public class WxApp extends WxpayPaymentService {
public AbstractRS pay(UnifiedOrderRQ rq, PayOrder payOrder, MchAppConfigContext mchAppConfigContext) {
WxPayService wxPayService = mchAppConfigContext.getWxServiceWrapper().getWxPayService();
wxPayService.getConfig().setTradeType(WxPayConstants.TradeType.APP);
// 构造请求数据
JSONObject reqJSON = buildV3OrderRequest(payOrder, mchAppConfigContext);

View File

@ -24,13 +24,13 @@ import com.jeequan.jeepay.core.entity.PayOrder;
import com.jeequan.jeepay.pay.channel.wxpay.WxpayPaymentService;
import com.jeequan.jeepay.pay.channel.wxpay.kits.WxpayKit;
import com.jeequan.jeepay.pay.channel.wxpay.kits.WxpayV3Util;
import com.jeequan.jeepay.pay.model.MchAppConfigContext;
import com.jeequan.jeepay.pay.rqrs.AbstractRS;
import com.jeequan.jeepay.pay.rqrs.msg.ChannelRetMsg;
import com.jeequan.jeepay.pay.rqrs.payorder.UnifiedOrderRQ;
import com.jeequan.jeepay.pay.rqrs.payorder.payway.WxH5OrderRQ;
import com.jeequan.jeepay.pay.rqrs.payorder.payway.WxH5OrderRS;
import com.jeequan.jeepay.pay.rqrs.msg.ChannelRetMsg;
import com.jeequan.jeepay.pay.util.ApiResBuilder;
import com.jeequan.jeepay.pay.model.MchAppConfigContext;
import org.springframework.stereotype.Service;
/*
@ -54,6 +54,7 @@ public class WxH5 extends WxpayPaymentService {
WxH5OrderRQ bizRQ = (WxH5OrderRQ) rq;
WxPayService wxPayService = mchAppConfigContext.getWxServiceWrapper().getWxPayService();
wxPayService.getConfig().setTradeType(WxPayConstants.TradeType.MWEB);
// 构造请求数据
JSONObject reqJSON = buildV3OrderRequest(payOrder, mchAppConfigContext);

View File

@ -23,13 +23,13 @@ import com.jeequan.jeepay.core.entity.PayOrder;
import com.jeequan.jeepay.pay.channel.wxpay.WxpayPaymentService;
import com.jeequan.jeepay.pay.channel.wxpay.kits.WxpayKit;
import com.jeequan.jeepay.pay.channel.wxpay.kits.WxpayV3Util;
import com.jeequan.jeepay.pay.model.MchAppConfigContext;
import com.jeequan.jeepay.pay.rqrs.AbstractRS;
import com.jeequan.jeepay.pay.rqrs.msg.ChannelRetMsg;
import com.jeequan.jeepay.pay.rqrs.payorder.UnifiedOrderRQ;
import com.jeequan.jeepay.pay.rqrs.payorder.payway.WxJsapiOrderRQ;
import com.jeequan.jeepay.pay.rqrs.payorder.payway.WxJsapiOrderRS;
import com.jeequan.jeepay.pay.rqrs.msg.ChannelRetMsg;
import com.jeequan.jeepay.pay.util.ApiResBuilder;
import com.jeequan.jeepay.pay.model.MchAppConfigContext;
import org.springframework.stereotype.Service;
/*
@ -57,16 +57,15 @@ public class WxJsapi extends WxpayPaymentService {
// 构造请求数据
JSONObject reqJSON = buildV3OrderRequest(payOrder, mchAppConfigContext);
String reqUrl; // 请求地址
wxPayService.getConfig().setTradeType(WxPayConstants.TradeType.JSAPI);
String reqUrl;
if(mchAppConfigContext.isIsvsubMch()){ // 特约商户
reqUrl = WxpayV3Util.ISV_URL_MAP.get(WxPayConstants.TradeType.JSAPI);
JSONObject payer = new JSONObject();
payer.put("sp_openid", bizRQ.getOpenid());
reqJSON.put("payer", payer);
}else {
reqUrl = WxpayV3Util.NORMALMCH_URL_MAP.get(WxPayConstants.TradeType.JSAPI);
JSONObject payer = new JSONObject();
payer.put("openid", bizRQ.getOpenid());
reqJSON.put("payer", payer);

View File

@ -23,13 +23,13 @@ import com.jeequan.jeepay.core.entity.PayOrder;
import com.jeequan.jeepay.pay.channel.wxpay.WxpayPaymentService;
import com.jeequan.jeepay.pay.channel.wxpay.kits.WxpayKit;
import com.jeequan.jeepay.pay.channel.wxpay.kits.WxpayV3Util;
import com.jeequan.jeepay.pay.model.MchAppConfigContext;
import com.jeequan.jeepay.pay.rqrs.AbstractRS;
import com.jeequan.jeepay.pay.rqrs.msg.ChannelRetMsg;
import com.jeequan.jeepay.pay.rqrs.payorder.UnifiedOrderRQ;
import com.jeequan.jeepay.pay.rqrs.payorder.payway.WxJsapiOrderRQ;
import com.jeequan.jeepay.pay.rqrs.payorder.payway.WxJsapiOrderRS;
import com.jeequan.jeepay.pay.rqrs.msg.ChannelRetMsg;
import com.jeequan.jeepay.pay.util.ApiResBuilder;
import com.jeequan.jeepay.pay.model.MchAppConfigContext;
import org.springframework.stereotype.Service;
/*
@ -57,6 +57,8 @@ public class WxLite extends WxpayPaymentService {
// 构造请求数据
JSONObject reqJSON = buildV3OrderRequest(payOrder, mchAppConfigContext);
wxPayService.getConfig().setTradeType(WxPayConstants.TradeType.JSAPI);
String reqUrl; // 请求地址
if(mchAppConfigContext.isIsvsubMch()){ // 特约商户
reqUrl = WxpayV3Util.ISV_URL_MAP.get(WxPayConstants.TradeType.JSAPI);

View File

@ -58,7 +58,8 @@ public class WxNative extends WxpayPaymentService {
// 构造请求数据
JSONObject reqJSON = buildV3OrderRequest(payOrder, mchAppConfigContext);
String reqUrl; // 请求地址
wxPayService.getConfig().setTradeType(WxPayConstants.TradeType.NATIVE);
String reqUrl;
if(mchAppConfigContext.isIsvsubMch()){ // 特约商户
reqUrl = WxpayV3Util.ISV_URL_MAP.get(WxPayConstants.TradeType.NATIVE);
}else {

View File

@ -22,6 +22,7 @@ import com.jeequan.jeepay.pay.mq.receive.MqReceiveCommon;
import lombok.extern.slf4j.Slf4j;
import org.apache.activemq.ScheduledMessage;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
@ -75,6 +76,16 @@ public class ActiveMqMessage extends MqCommonService {
@Qualifier("activePayOrderMchNotifyInner")
private Queue mqQueue4PayOrderMchNotifyInner;
@Bean("activeMqSendModifyMchApp")
public ActiveMQTopic mqTopic4ModifyMchApp(){
return new ActiveMQTopic(CS.MQ.TOPIC_MODIFY_MCH_APP);
}
@Lazy
@Autowired
@Qualifier("activeMqSendModifyMchApp")
private ActiveMQTopic mqTopic4ModifyMchApp;
/**
* 发送消息
* @param msg
@ -86,6 +97,8 @@ public class ActiveMqMessage extends MqCommonService {
channelOrderQuery(msg);
}else if (sendType.equals(CS.MQ.MQ_TYPE_PAY_ORDER_MCH_NOTIFY)) {
payOrderMchNotify(msg);
}else if (sendType.equals(CS.MQ.MQ_TYPE_MODIFY_MCH_APP)) { // 商户应用修改
this.jmsTemplate.convertAndSend(mqTopic4ModifyMchApp, msg);
}
}

View File

@ -53,6 +53,8 @@ public class RabbitMqMessage extends MqCommonService {
channelOrderQuery(msg);
}else if (sendType.equals(CS.MQ.MQ_TYPE_PAY_ORDER_MCH_NOTIFY)) {
payOrderMchNotify(msg);
}else if (sendType.equals(CS.MQ.MQ_TYPE_MODIFY_MCH_APP)) { // 商户应用修改
directModifyMchApp(msg);
}
}
@ -91,6 +93,12 @@ public class RabbitMqMessage extends MqCommonService {
});
}
/** 发送商户应用修改消息 **/
public void directModifyMchApp(String msg) {
rabbitTemplate.convertAndSend(CS.DIRECT_EXCHANGE, CS.MQ.TOPIC_MODIFY_MCH_APP, msg);
}
/** 接收 查单消息 **/
@RabbitListener(queues = CS.MQ.QUEUE_CHANNEL_ORDER_QUERY)
public void receiveChannelOrderQuery(String msg) {

View File

@ -57,6 +57,8 @@ public class RocketMqMessage extends MqCommonService {
channelOrderQuery(msg);
}else if (sendType.equals(CS.MQ.MQ_TYPE_PAY_ORDER_MCH_NOTIFY)) {
payOrderMchNotify(msg);
}else if (sendType.equals(CS.MQ.MQ_TYPE_MODIFY_MCH_INFO)) { // 商户信息修改
modifyMchInfo(msg);
}
}
@ -127,4 +129,17 @@ public class RocketMqMessage extends MqCommonService {
mqReceiveCommon.payOrderMchNotify(msg);
}
}
/** 发送商户信息修改消息 **/
public void modifyMchInfo(String msg) {
sendMsg(msg, CS.MQ.TOPIC_MODIFY_MCH_INFO);
}
public void sendMsg(String msg, String group) {
// 这里的分组和消息名称未做区分
rocketMQTemplate.getProducer().setProducerGroup(group);
this.rocketMQTemplate.convertAndSend(group, msg);
}
}

View File

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>授权提示</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/layui/2.4.3/css/layui.css">
<style>
.mainDiv1 {color:lightseagreen; text-align:center; margin-top: 50px;}
.mainDiv2 {text-align:center; margin-top: 10px;}
.mainDiv3 {text-align:center; margin-top: 200px;}
.mainDivTitle {text-align:center; margin-top: 20px; color:orangered }
</style>
</head>
<body>
<#if errMsg != null >
<div class="mainDiv1 layui-fluid">
<i class="layui-icon" style="font-size:100px; color:orangered">&#x1007;</i>
</div>
<div class="mainDiv2 layui-fluid">
<span style="font-size:16px; ">授权失败</span>
<div class="mainDivTitle layui-fluid">
<span style="font-size:14px">错误提示:${errMsg!''}
</span>
</div>
</div>
<#else>
<div class="mainDiv1 layui-fluid">
<i class="layui-icon" style="font-size:100px;">&#x1005;</i>
</div>
<div class="mainDiv2 layui-fluid">
<span style="font-size:16px">授权成功</span>
</div>
<#if isAlipaySysAuth>
<div class="mainDivTitle layui-fluid">
<span style="font-size:14px">提示: 请联系您的 [服务商]
登录支付宝管理平台获取 [<span style="font-style: oblique">授权Token</span>] 进行下一步配置!</span>
</div>
</#if>
</#if>
<div class="mainDiv3 layui-fluid">
<a class="layui-btn layui-btn-primary closeBtn">关闭页面</a>
</div>
<script src="https://cdn.staticfile.org/layui/2.4.3/layui.min.js"></script>
<script>
layui.use(['jquery'], function(){
layui.$(".closeBtn").click(function(){
var ua = navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i)=="micromessenger") {
WeixinJSBridge.call('closeWindow');
} else if(ua.indexOf("alipay")!=-1){
AlipayJSBridge.call('closeWebview');
}
else{
window.close();
}
});
});
</script>
</body>
</html>

View File

@ -1,5 +1,7 @@
package com.jeequan.jeepay.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jeequan.jeepay.core.constants.ApiCodeEnum;
import com.jeequan.jeepay.core.constants.CS;
@ -8,7 +10,9 @@ import com.jeequan.jeepay.core.entity.MchPayPassage;
import com.jeequan.jeepay.core.entity.PayInterfaceConfig;
import com.jeequan.jeepay.core.entity.PayOrder;
import com.jeequan.jeepay.core.exception.BizException;
import com.jeequan.jeepay.core.utils.StringKit;
import com.jeequan.jeepay.service.mapper.MchAppMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -49,4 +53,30 @@ public class MchAppService extends ServiceImpl<MchAppMapper, MchApp> {
throw new BizException(ApiCodeEnum.SYS_OPERATION_FAIL_DELETE);
}
}
public MchApp selectById(String appId) {
MchApp mchApp = this.getById(appId);
if (mchApp == null) {
return null;
}
mchApp.setAppSecret(StringKit.str2Star(mchApp.getAppSecret(), 6, 6, 6));
return mchApp;
}
public IPage<MchApp> selectPage(IPage iPage, MchApp mchApp) {
LambdaQueryWrapper<MchApp> wrapper = MchApp.gw();
if (StringUtils.isNotBlank(mchApp.getMchNo())) wrapper.eq(MchApp::getMchNo, mchApp.getMchNo());
if (StringUtils.isNotEmpty(mchApp.getAppId())) wrapper.eq(MchApp::getAppId, mchApp.getAppId());
if (StringUtils.isNotEmpty(mchApp.getAppName())) wrapper.eq(MchApp::getAppName, mchApp.getAppName());
if (mchApp.getState() != null) wrapper.eq(MchApp::getState, mchApp.getState());
wrapper.orderByDesc(MchApp::getCreatedAt);
IPage<MchApp> pages = this.page(iPage, wrapper);
pages.getRecords().stream().forEach(item -> item.setAppSecret(StringKit.str2Star(item.getAppSecret(), 6, 6, 6)));
return pages;
}
}

View File

@ -127,6 +127,7 @@ public class PayInterfaceConfigService extends ServiceImpl<PayInterfaceConfigMap
.isNotNull(PayInterfaceConfig::getIfParams));
for (PayInterfaceConfig config : isvConfigList) {
config.addExt("mchType", mchInfo.getType());
isvPayConfigMap.put(config.getIfCode(), config);
}
}

View File

@ -18,7 +18,7 @@
<!-- 根据支付方式查询可用的支付接口列表 -->
<select id="selectAvailablePayInterfaceList" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.util.Map">
select pid.if_code ifCode, pid.if_name ifName, pid.bg_color bgColor, pid.icon icon, pic.if_params ifParams, pic.if_rate ifRate from t_pay_interface_define pid
select pid.if_code ifCode, pid.if_name ifName, pid.config_page_type configPageType, pid.bg_color bgColor, pid.icon icon, pic.if_params ifParams, pic.if_rate ifRate from t_pay_interface_define pid
inner join t_pay_interface_config pic on pid.if_code = pic.if_code
where JSON_CONTAINS(pid.way_codes, JSON_OBJECT('wayCode', #{wayCode}))
and pid.state = 1

View File

@ -8,6 +8,7 @@
<result column="if_name" property="ifName" />
<result column="is_mch_mode" property="isMchMode" />
<result column="is_isv_mode" property="isIsvMode" />
<result column="config_page_type" property="configPageType" />
<result column="isv_params" property="isvParams" />
<result column="isvsub_mch_params" property="isvsubMchParams" />
<result column="normal_mch_params" property="normalMchParams" />

View File

@ -16,7 +16,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.5</version>
<version>2.4.8</version>
</parent>
<!-- 声明子项目 -->
@ -37,14 +37,14 @@
<properties>
<java.version>1.8</java.version> <!-- 指定java版本号 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!-- 项目构建输出编码 -->
<isys.version>1.3.0</isys.version> <!-- 指定当前[项目]版本号 -->
<isys.version>1.4.0</isys.version> <!-- 指定当前[项目]版本号 -->
<!-- 其他工具包 -->
<jeepay.sdk.java.version>1.1.0</jeepay.sdk.java.version>
<fastjson.version>1.2.76</fastjson.version> <!-- fastjson -->
<mybatis.plus.starter.version>3.4.2</mybatis.plus.starter.version> <!-- mybatis plus -->
<hutool.util.version>5.6.6</hutool.util.version> <!-- hutool -->
<spring.security.version>5.4.6</spring.security.version> <!-- 用于core的scope依赖 -->
<spring.security.version>5.4.7</spring.security.version> <!-- 用于core的scope依赖 -->
<jjwt.version>0.9.1</jjwt.version>
<binarywang.weixin.java.version>4.1.0</binarywang.weixin.java.version>
<rocketmq.spring.boot.starter.version>2.0.3</rocketmq.spring.boot.starter.version>