feat 结算台增加云闪付演示, 增加生产环境配置文件

This commit is contained in:
xxm1995
2024-03-18 23:30:31 +08:00
committed by 喵呀
parent 04b607368b
commit bb93ba7c2c
8 changed files with 187 additions and 9 deletions

View File

@@ -1,12 +1,13 @@
2.0.4: 2.0.4:
- [ ] 支付流程也改为先落库后支付情况, 避免极端情况导致掉单 - [ ] 支付流程也改为先落库后支付情况, 避免极端情况导致掉单
- [ ] 首页驾驶舱功能: 各通道收入和支付情况 - [x] 首页驾驶舱功能: 各通道收入和支付情况
- [x] 第一排: (数字格式)显示今日收入、支出金额,支付总订单数量、退款总订单数, 时间分支分为: 今日金额/昨日金额/七天内金额 - [x] 第一排: (数字格式)显示今日收入、支出金额,支付总订单数量、退款总订单数, 时间分支分为: 今日金额/昨日金额/七天内金额
- [x] 第二排: (折线图)显示各通道支付分为支付金额和退款,时间分为: 今日金额/昨日金额/七天内金额 - [x] 第二排: (图)显示各通道支付方式数量和占比, 时间分为: 今日金额/昨日金额/七天内金额
- [x] 第三排: (图)显示各通道支付方式数量和占比, 时间分为: 今日金额/昨日金额/七天内金额 - [x] 第三排: (折线图)显示各通道支付分为支付金额和退款,时间分为: 今日金额/昨日金额/七天内金额
- [ ] 报表功能 - [ ] 报表功能
- [ ] 各通道收入和支付情况 - [ ] 各通道收入和支付情况
- [ ] 微信新增V3版本接口 - [ ] 微信新增V3版本接口
- [ ] 付款码回退到V2接口
- [ ] 增加转账功能 - [ ] 增加转账功能
- [ ] 云闪付支持对账功能 - [ ] 云闪付支持对账功能
- [ ] 结算台DEMO增加云闪付示例 - [ ] 结算台DEMO增加云闪付示例

View File

@@ -90,11 +90,15 @@ public class AggregateService {
// 跳转支付宝中间页 // 跳转支付宝中间页
return StrUtil.format("{}/aggregate/alipay?code={}", daxPayDemoProperties.getFrontH5Url(),code); return StrUtil.format("{}/aggregate/alipay?code={}", daxPayDemoProperties.getFrontH5Url(),code);
} }
// 微信支付
else if (ua.contains(AggregatePayEnum.UA_WECHAT_PAY.getCode())) { else if (ua.contains(AggregatePayEnum.UA_WECHAT_PAY.getCode())) {
// 微信重定向到中间页, 因为微信需要授权后才能发起支付 // 微信重定向到中间页, 因为微信需要授权后才能发起支付
return this.wxJsapiAuthPage(code); return this.wxJsapiAuthPage(code);
} }
else { // 云闪付
else if (ua.contains(AggregatePayEnum.UA_UNION_PAY.getCode())) {
return StrUtil.format("{}/aggregate/wechatPay?code={}", daxPayDemoProperties.getFrontH5Url(),code);
} else {
// 跳转到异常页 // 跳转到异常页
return StrUtil.format("{}/result/error?msg={}", daxPayDemoProperties.getFrontH5Url(), URLEncodeUtil.encode("请使用微信或支付宝扫码支付")); return StrUtil.format("{}/result/error?msg={}", daxPayDemoProperties.getFrontH5Url(), URLEncodeUtil.encode("请使用微信或支付宝扫码支付"));
} }
@@ -247,6 +251,7 @@ public class AggregateService {
} }
String[] wx = { "10", "11", "12", "13", "14", "15" }; String[] wx = { "10", "11", "12", "13", "14", "15" };
String[] ali = { "25", "26", "27", "28", "29", "30" }; String[] ali = { "25", "26", "27", "28", "29", "30" };
String[] union = { "62" };
// 微信 // 微信
if (StrUtil.startWithAny(authCode.substring(0, 2), wx)) { if (StrUtil.startWithAny(authCode.substring(0, 2), wx)) {
@@ -256,6 +261,10 @@ public class AggregateService {
else if (StrUtil.startWithAny(authCode.substring(0, 2), ali)) { else if (StrUtil.startWithAny(authCode.substring(0, 2), ali)) {
return PayChannelEnum.ALI; return PayChannelEnum.ALI;
} }
// 云闪付
else if (StrUtil.startWithAny(authCode.substring(0, 2), union)) {
return PayChannelEnum.UNION_PAY;
}
else { else {
throw new BizException("不支持的支付方式"); throw new BizException("不支持的支付方式");
} }

View File

@@ -13,7 +13,8 @@ import lombok.Getter;
public enum AggregatePayEnum { public enum AggregatePayEnum {
UA_ALI_PAY("Alipay", "支付宝"), UA_ALI_PAY("Alipay", "支付宝"),
UA_WECHAT_PAY("MicroMessenger", "微信支付"); UA_WECHAT_PAY("MicroMessenger", "微信支付"),
UA_UNION_PAY("CloudPay", "云闪付");
/** 支付渠道字符编码 */ /** 支付渠道字符编码 */
private final String code; private final String code;

View File

@@ -5,6 +5,7 @@ import cn.bootx.platform.common.core.annotation.EncryptionField;
import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.common.core.function.EntityBaseFunction;
import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity; import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
import cn.bootx.platform.common.mybatisplus.handler.StringListTypeHandler; import cn.bootx.platform.common.mybatisplus.handler.StringListTypeHandler;
import cn.bootx.platform.daxpay.service.code.WeChatPayCode;
import cn.bootx.platform.daxpay.service.core.channel.wechat.convert.WeChatConvert; import cn.bootx.platform.daxpay.service.core.channel.wechat.convert.WeChatConvert;
import cn.bootx.platform.daxpay.service.dto.channel.wechat.WeChatPayConfigDto; import cn.bootx.platform.daxpay.service.dto.channel.wechat.WeChatPayConfigDto;
import cn.bootx.table.modify.annotation.DbColumn; import cn.bootx.table.modify.annotation.DbColumn;
@@ -63,11 +64,13 @@ public class WeChatPayConfig extends MpBaseEntity implements EntityBaseFunction<
@DbColumn(comment = "同步通知路径") @DbColumn(comment = "同步通知路径")
private String returnUrl; private String returnUrl;
/** 接口版本, 使用v2还是v3接口 */ /**
* 接口版本, 使用v2还是v3接口
* @see WeChatPayCode#API_V2
*/
@DbColumn(comment = "接口版本") @DbColumn(comment = "接口版本")
private String apiVersion; private String apiVersion;
/** 商户平台「API安全」中的 APIv2 密钥 */ /** 商户平台「API安全」中的 APIv2 密钥 */
@TableField(updateStrategy = FieldStrategy.ALWAYS) @TableField(updateStrategy = FieldStrategy.ALWAYS)
@BigField @BigField

View File

@@ -38,7 +38,6 @@ public class WeChatPayCallbackService extends AbsCallbackStrategy {
@Resource @Resource
private WeChatPayConfigService weChatPayConfigService; private WeChatPayConfigService weChatPayConfigService;
/** /**
* 策略标识 * 策略标识
*/ */

View File

@@ -35,6 +35,10 @@ public class WeChatPayConfigParam {
@Schema(description ="同步通知地址") @Schema(description ="同步通知地址")
private String returnUrl; private String returnUrl;
/** 接口版本, 使用v2还是v3接口 */
@Schema(description = "接口版本")
private String apiVersion;
@Schema(description = "商户平台「API安全」中的 APIv2 密钥") @Schema(description = "商户平台「API安全」中的 APIv2 密钥")
private String apiKeyV2; private String apiKeyV2;

View File

@@ -133,7 +133,7 @@ bootx:
# 文件上传 # 文件上传
file-upload: file-upload:
server-url: http://127.0.0.1:9000 server-url: http://127.0.0.1:9000
# 自动建表 # 自动建表 生产环境关闭
table-modify: table-modify:
update-type: update update-type: update
database-type: mysql database-type: mysql

View File

@@ -0,0 +1,161 @@
server:
port: 9000
spring:
datasource:
dynamic:
primary: master
datasource:
# 默认数据源
master:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/dax-pay?serverTimezone=GMT%2B8&characterEncoding=utf8&allowMultiQueries=true&useSSL=false&nullCatalogMeansCurrent=true
username: root
password: root
hikari:
# 30 秒, 心跳检测
keepalive-time: 30000
# 300 分钟, 连接最大存活时间
max-lifetime: 18000000
redis:
host: 127.0.0.1
port: 6379
database: 1
lettuce:
cluster:
refresh:
# 自适应拓扑刷新
adaptive: true
# 群集拓扑刷新周期
period: 60s
#静态资源加载配置
mvc:
static-path-pattern: /**
web:
resources:
static-locations: classpath:/static/,classpath:/public/
thymeleaf:
cache: false
# 定时任务
quartz:
# 持久化方式
job-store-type: jdbc
#定时任务启动开关true-开 false-关
auto-startup: true
#启动时更新己存在的Job
overwrite-existing-jobs: true
properties:
org:
quartz:
scheduler:
instanceName: quartzScheduler
instanceId: AUTO
threadPool:
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
knife4j:
# 开启增强配置
enable: true
# 开启生产环境屏蔽
production: true
# 项目配置
bootx:
common:
# 接口文档
swagger:
enabled: false
author: bootx
version: 2.0.3
title: 开源支付平台-单商户
description: 开源支付平台-单商户版
# 缓存
cache:
# 默认超时时间 30分钟
default-ttl: 1800
# 序列生成器
sequence:
# 生成方式
type: jdbc
# 序列生成器起始值
range-start: 1
# 序列生成器区间, 设置1每次都会操作数据库
range-step: 1
# 步长
step: 1
# 异常
exception:
# 显示详细异常
show-full-message: true
starter:
# 认证
auth:
default-password: 123456
# 关闭超级管理员登录
enable-admin: false
ignore-urls:
- '/actuator/**'
- '/v3/api-docs/**'
- '/doc.html'
- '/swagger-resources/**'
- '/token/**'
- '/ws/**'
- '/demo/**'
- '/test/**'
- '/webjars/**'
- '/front/**'
- '/h5/**'
- '/css/**'
- '/error'
- '/favicon.ico'
# 审计日志
audit-log:
# 审计日志存储
store: jdbc
# ip归属地
ip2region:
# 数据文件路径
file-path: /data/ip2region/ip2region.xdb
# 查询方式
search-type: cache
# 数据权限
data-perm:
# 需要符合AES密钥的要求
field-decrypt-key: "UCrtxSCwYZNCIlav"
# 文件上传
file-upload:
server-url: http://127.0.0.1:9000
# 自动建表 生产环境关闭
table-modify:
update-type: none
dromara:
#文件存储配置,
x-file-storage:
#默认使用的存储平台
default-platform: local
#缩略图后缀,例如【.min.jpg】【.png】
thumbnail-suffix: ".min.jpg"
local-plus:
# 不启用自带的访问映射, 使用自定义的访问实现
# 存储平台标识
- platform: local
enableStorage: true
# 文件存储路径
storage-path: D:/data/files/
# 支付系统配置
dax-pay:
# 服务地址
server-url: http://pay1.bootx.cn
# 前端h5地址
front-h5-url: http://pay1.bootx.cn/h5/#
# 前端web地址
front-web-url: http://pay1.bootx.cn/#
# 演示模块
demo:
# 网关地址
server-url: http://pay1.bootx.cn/server
# 前端h5地址
front-h5-url: http://pay1.bootx.cn/h5/#
# 签名秘钥
sign-secret: 123456
# 签名方式
sign-type: hmac_sha256