ref 支付通道名称统一更改为支付渠道

This commit is contained in:
xxm1995
2023-08-04 09:39:08 +08:00
parent c847c27687
commit 1d328a7467
37 changed files with 93 additions and 92 deletions

View File

@@ -18,8 +18,8 @@ Dax-Pay是Bootx-Platform的子项目之一主要是对支付收单和账务
同时扩展了更多支付方式,如储值卡、现金卡等,可以作为一个简单的四方支付进行使用。
## 🛠️功能亮点
- 支持单道支付、聚合支付、组合支付、退款、对账等支付功能
-道支付:支持支付宝、微信、现金、钱包、储值卡等多种支付方式
- 支持单道支付、聚合支付、组合支付、退款、对账等支付功能
-道支付:支持支付宝、微信、现金、钱包、储值卡等多种支付方式
- 聚合支付:支持微信或支付宝使用同一个码
- 组合支付:支持多种同步支付和一个异步支付(微信、支付宝)进行组合支付
- 支持退款:部分对款、全部退款等方式
@@ -46,19 +46,19 @@ Dax-Pay是Bootx-Platform的子项目之一主要是对支付收单和账务
- 后端: [后端启动流程](https://https://daxpay.doc.bootx.cn/)
- 前端: [Vue3前端启动流程](https://https://daxpay.doc.bootx.cn/)
- 支付道配置: [支付道配置](https://https://daxpay.doc.bootx.cn/)
- 支付道配置: [支付道配置](https://https://daxpay.doc.bootx.cn/)
## 名词解释
| 名词 | 英文或简写 | 备注 |
|------|----------------|------------------------------------------------|
| 支付道 | Channel | 主要包括第三方支付平台,如支付宝、微信、云闪付等 |
| 支付方式 | PayWay | 主要是进行支付时的方式如扫码支付、H5支付、APP支付等一种支付道通常会有多种支付方式 |
| 支付策略 | Strategy | 对支付道和支付方式进行封装,可以完成一种支付操作 |
| 聚合支付 | AggregationPay | 通常是扫码或收款时,根据客户使用应用的不同,自动识别是哪种支付道,并进行支付 |
| 组合支付 | CombinationPay | 同时使用多种支付道进行支付,如同时使用余额+现金+储值卡+微信支付进行支付 |
| 支付道 | Channel | 主要包括第三方支付平台,如支付宝、微信、云闪付等 |
| 支付方式 | PayWay | 主要是进行支付时的方式如扫码支付、H5支付、APP支付等一种支付道通常会有多种支付方式 |
| 支付策略 | Strategy | 对支付道和支付方式进行封装,可以完成一种支付操作 |
| 聚合支付 | AggregationPay | 通常是扫码或收款时,根据客户使用应用的不同,自动识别是哪种支付道,并进行支付 |
| 组合支付 | CombinationPay | 同时使用多种支付道进行支付,如同时使用余额+现金+储值卡+微信支付进行支付 |
| 商户 | Merchant | 系统中的一种单元 |
| 商户应用 | mchApp | 一个商户可以有多个应用,一个应用可以分别进行各种支付道配置 |
| 商户应用 | mchApp | 一个商户可以有多个应用,一个应用可以分别进行各种支付道配置 |
## 🥞项目结构(dax-pay)
```lua
@@ -70,7 +70,7 @@ dax-pay
├── core -- 核心包
├── aggregate -- Quartz定时任务模块
├── cashier -- 结算台
├── channel -- 支付
├── channel -- 支付
├── merchant -- 商户和应用
├── pay -- 支付
├── payment -- 支付单

View File

@@ -254,7 +254,7 @@ INSERT INTO `iam_perm_menu` VALUES (1584380679478779904, 'dax-pay', 158437960218
INSERT INTO `iam_perm_menu` VALUES (1584380824308097024, 'dax-pay', 1584379602188574720, '素材管理', 'WechatMediaList', NULL, b'0', '', b'0', b'0', '/modules/third/wechat/media/WechatMediaList.vue', NULL, '/third/wechat/media', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-24 11:06:40', 1414143554414059520, '2022-10-27 16:38:47', 1, 0);
INSERT INTO `iam_perm_menu` VALUES (1584381134950834176, 'dax-pay', 1584379704122744832, '企微机器人', 'WeComRobotConfigList', NULL, b'0', '', b'0', b'0', '/modules/third/wecom/robot/WecomRobotConfigList.vue', NULL, '/third/wecom/robot', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-24 11:07:54', 1414143554414059520, '2022-11-12 20:58:25', 3, 0);
INSERT INTO `iam_perm_menu` VALUES (1584381322184564736, 'dax-pay', 1584380087805091840, '钉钉机器人', 'DingRobotConfigList', NULL, b'0', '', b'0', b'0', '/modules/third/dingtalk/robot/DingRobotConfigList.vue', NULL, '/third/dingTalk/robot', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-24 11:08:38', 1414143554414059520, '2022-11-12 20:58:37', 6, 0);
INSERT INTO `iam_perm_menu` VALUES (1584382569381830656, 'dax-pay', 1582276184120709120, '支付道菜单', 'PayChannel', NULL, b'0', '', b'1', b'1', 'Layout', NULL, '/payment/channel', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-24 11:13:36', 1414143554414059520, '2023-06-15 20:09:59', 1, 0);
INSERT INTO `iam_perm_menu` VALUES (1584382569381830656, 'dax-pay', 1582276184120709120, '支付道菜单', 'PayChannel', NULL, b'0', '', b'1', b'1', 'Layout', NULL, '/payment/channel', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-24 11:13:36', 1414143554414059520, '2023-06-15 20:09:59', 1, 0);
INSERT INTO `iam_perm_menu` VALUES (1584382723186958336, 'dax-pay', NULL, '支付订单', 'PayOrder', NULL, b'0', 'ant-design:copy-filled', b'0', b'0', 'Layout', NULL, '/payment/order', '', 0, 0, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-24 11:14:12', 1414143554414059520, '2023-07-11 09:07:48', 1, 0);
INSERT INTO `iam_perm_menu` VALUES (1584382815407120384, 'dax-pay', NULL, '通知记录', 'PayNotify', NULL, b'0', 'ant-design:delete-row-outlined', b'0', b'0', 'Layout', NULL, '/payment/notify', '', 0, 0, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-24 11:14:34', 1414143554414059520, '2023-07-17 09:35:16', 4, 0);
INSERT INTO `iam_perm_menu` VALUES (1584383492338425856, 'dax-pay', 1582276184120709120, '钱包管理', 'Wallet', NULL, b'0', '', b'0', b'0', 'Layout', NULL, '/payment/wallet', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2022-10-24 11:17:16', 1414143554414059520, '2022-10-24 11:17:16', 0, 0);
@@ -275,7 +275,7 @@ INSERT INTO `iam_perm_menu` VALUES (1623494586215579648, 'dax-pay', 155220798251
INSERT INTO `iam_perm_menu` VALUES (1635274568758435840, 'dax-pay', 1582276341792985088, 'SQL查询语句', 'QuerySqlList', NULL, b'0', '', b'0', b'0', '/modules/develop/query/QuerySqlList', NULL, '/develop/querySql', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-03-13 21:40:14', 1414143554414059520, '2023-03-13 21:43:05', 2, 0);
INSERT INTO `iam_perm_menu` VALUES (1660185276763594752, 'dax-pay', 1582276184120709120, '商户管理', 'Merchant', NULL, b'0', '', b'0', b'0', '/modules/payment/merchant/MerchantInfoList', NULL, '/payment/merchant', '', -99, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-05-21 15:26:29', 1414143554414059520, '2023-05-21 15:27:58', 3, 0);
INSERT INTO `iam_perm_menu` VALUES (1660247003681181696, 'dax-pay', 1582276184120709120, '商户应用', 'MchApplicationList', NULL, b'0', '', b'0', b'0', '/modules/payment/app/MchApplicationList', NULL, '/payment/mch/app', '', -99, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-05-21 19:31:46', 1414143554414059520, '2023-05-23 10:28:42', 2, 0);
INSERT INTO `iam_perm_menu` VALUES (1661556612357128192, 'dax-pay', 1582276184120709120, '支付', 'ChannelConfig', NULL, b'0', '', b'0', b'0', '/modules/payment/channel/config/PayChannelConfigList', NULL, '/payment/channel/config', '', -99, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-05-25 10:15:41', 1414143554414059520, '2023-06-15 20:10:14', 3, 0);
INSERT INTO `iam_perm_menu` VALUES (1661556612357128192, 'dax-pay', 1582276184120709120, '支付', 'ChannelConfig', NULL, b'0', '', b'0', b'0', '/modules/payment/channel/config/PayChannelConfigList', NULL, '/payment/channel/config', '', -99, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-05-25 10:15:41', 1414143554414059520, '2023-06-15 20:10:14', 3, 0);
INSERT INTO `iam_perm_menu` VALUES (1670605512011345920, 'dax-pay', NULL, '演示实例', 'PayDemo', NULL, b'0', 'ant-design:gateway-outlined', b'0', b'0', 'Layout', NULL, '/payment/demo', '', 0, 0, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-06-19 09:32:47', 1414143554414059520, '2023-07-11 09:10:21', 2, 0);
INSERT INTO `iam_perm_menu` VALUES (1670605893923696640, 'dax-pay', 1670605512011345920, '结算台支付演示', 'cashierDemo', NULL, b'0', '', b'0', b'0', '', NULL, 'outside:///cashier', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-06-19 09:34:18', 1414143554414059520, '2023-06-19 09:34:18', 0, 0);
INSERT INTO `iam_perm_menu` VALUES (1670987342170497024, 'dax-pay', 1670605512011345920, '简单支付', 'SimpleCashier', NULL, b'0', '', b'0', b'0', '/demo/payment/cashier/SimpleCashier', NULL, '/payment/demo/SimpleCashier', '', 0, 1, NULL, b'1', b'0', b'0', b'0', NULL, 1414143554414059520, '2023-06-20 10:50:02', 1414143554414059520, '2023-06-20 10:59:01', 1, 0);
@@ -316,10 +316,10 @@ INSERT INTO `base_dict` VALUES (1439961232651034624, 'MessageTemplateCode', '消
INSERT INTO `base_dict` VALUES (1452836604783845376, 'SocialType', '三方系统类型', b'1', '系统属性', '三方系统类型', 1399985191002447872, '2021-10-26 11:16:54', 1399985191002447872, '2022-05-11 19:48:28', 0, 3);
INSERT INTO `base_dict` VALUES (1452843488735621120, 'ParamType', '参数类型', b'1', '系统属性', '参数类型', 1399985191002447872, '2021-10-26 11:44:15', 1399985191002447872, '2022-05-11 19:48:21', 0, 2);
INSERT INTO `base_dict` VALUES (1496024933900169216, 'Political', '政治面貌', b'1', '基础数据', '政治面貌', 1399985191002447872, '2022-02-22 15:31:54', 1399985191002447872, '2022-05-11 19:48:04', 0, 1);
INSERT INTO `base_dict` VALUES (1496722894707728384, 'PayChannel', '支付', b'1', '支付服务', '支付宝, 微信, 云闪付等', 1399985191002447872, '2022-02-24 13:45:21', 1399985191002447872, '2022-05-11 19:47:51', 0, 1);
INSERT INTO `base_dict` VALUES (1496722894707728384, 'PayChannel', '支付', b'1', '支付服务', '支付宝, 微信, 云闪付等', 1399985191002447872, '2022-02-24 13:45:21', 1399985191002447872, '2022-05-11 19:47:51', 0, 1);
INSERT INTO `base_dict` VALUES (1496723207565058048, 'PayWay', '支付方式', b'1', '支付服务', '扫码支付、Wap、App支付等', 1399985191002447872, '2022-02-24 13:46:35', 1399985191002447872, '2022-05-11 19:47:46', 0, 1);
INSERT INTO `base_dict` VALUES (1497140849954185216, 'PayStatus', '支付状态', b'1', '支付服务', '支付中,成功,失败等', 1399985191002447872, '2022-02-25 17:26:09', 1399985191002447872, '2022-05-11 19:47:40', 0, 2);
INSERT INTO `base_dict` VALUES (1501031423232937984, 'AsyncPayChannel', '异步支付', b'1', '支付服务', '如微信支付宝云闪付等第三方支付', 1399985191002447872, '2022-03-08 11:05:54', 1399985191002447872, '2022-05-11 19:47:37', 0, 1);
INSERT INTO `base_dict` VALUES (1501031423232937984, 'AsyncPayChannel', '异步支付', b'1', '支付服务', '如微信支付宝云闪付等第三方支付', 1399985191002447872, '2022-03-08 11:05:54', 1399985191002447872, '2022-05-11 19:47:37', 0, 1);
INSERT INTO `base_dict` VALUES (1502276739978473472, 'WalletStatus', '钱包状态', b'1', '支付服务', '钱包状态', 1399985191002447872, '2022-03-11 21:34:20', 1399985191002447872, '2022-05-11 19:47:33', 0, 2);
INSERT INTO `base_dict` VALUES (1502624515799085056, 'WalletLogType', '钱包日志类型', b'1', '支付服务', '钱包日志类型', 1399985191002447872, '2022-03-12 20:36:17', 1399985191002447872, '2022-05-11 19:47:29', 0, 1);
INSERT INTO `base_dict` VALUES (1502624632392347648, 'WalletLogOperation', '钱包日志操作类型', b'1', '支付服务', '钱包日志操作类型', 1399985191002447872, '2022-03-12 20:36:44', 1399985191002447872, '2022-05-11 19:47:21', 0, 1);
@@ -407,8 +407,8 @@ INSERT INTO `base_param` VALUES (1670669947774103552, '结算台商户应用号'
DROP TABLE IF EXISTS `pay_channel_config`;
CREATE TABLE `pay_channel_config` (
`id` bigint(20) NOT NULL COMMENT '主键',
`code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '道编码',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '道名称',
`code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '道编码',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '道名称',
`image` bigint(20) NULL DEFAULT NULL COMMENT '图片',
`sort_no` double(10, 0) NULL DEFAULT NULL COMMENT '排序',
`creator` bigint(20) NULL DEFAULT NULL COMMENT '创建者ID',
@@ -418,7 +418,7 @@ CREATE TABLE `pay_channel_config` (
`version` int(11) NOT NULL COMMENT '乐观锁',
`deleted` bit(1) NOT NULL COMMENT '删除标志',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '支付道配置' ROW_FORMAT = DYNAMIC;
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '支付道配置' ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of pay_channel_config
@@ -1479,7 +1479,7 @@ CREATE TABLE `pay_sync_record` (
`payment_id` bigint(20) NULL DEFAULT NULL COMMENT '支付记录id',
`mch_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商户编码',
`mch_app_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商户应用编码',
`pay_channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '支付',
`pay_channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '支付',
`sync_info` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '通知消息',
`status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '同步状态',
`sync_time` datetime NULL DEFAULT NULL COMMENT '同步时间',
@@ -1537,12 +1537,12 @@ CREATE TABLE `pay_payment` (
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题',
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
`async_pay_mode` bit(1) NULL DEFAULT NULL COMMENT '是否是异步支付',
`async_pay_channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '异步支付',
`async_pay_channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '异步支付',
`amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '金额',
`refundable_balance` decimal(10, 2) NULL DEFAULT NULL COMMENT '可退款余额',
`error_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '错误码',
`error_msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '错误信息',
`pay_channel_info` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '支付道信息列表',
`pay_channel_info` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '支付道信息列表',
`refundable_info` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '退款信息列表',
`pay_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '支付状态',
`pay_time` datetime NULL DEFAULT NULL COMMENT '支付时间',
@@ -1594,7 +1594,7 @@ CREATE TABLE `pay_pay_notify_record` (
`id` bigint(20) NOT NULL COMMENT '主键',
`payment_id` bigint(20) NULL DEFAULT NULL COMMENT '支付记录id',
`notify_info` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '通知消息',
`pay_channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '支付',
`pay_channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '支付',
`status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处理状态',
`msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '提示信息',
`notify_time` datetime NULL DEFAULT NULL COMMENT '回调时间',
@@ -1648,7 +1648,7 @@ DROP TABLE IF EXISTS `pay_mch_app_config`;
CREATE TABLE `pay_mch_app_config` (
`id` bigint(20) NOT NULL COMMENT '主键',
`config_id` bigint(20) NULL DEFAULT NULL COMMENT '关联配置ID',
`channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '支付道编码',
`channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '支付道编码',
`state` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态',
`creator` bigint(20) NULL DEFAULT NULL COMMENT '创建者ID',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',

View File

@@ -8,11 +8,11 @@
- 优化: 结算台支持多商户
- 优化: 重构支付消息通知结构, 使后期支持多种消息中间件
- 优化: 拆分网关同步相关代码
- 优化: 保存各道的支付单
- 优化: 保存各道的支付单
## [v1.0.0] 支付之路
- 支持单道支付、聚合支付、组合支付、退款功能
-道支付:支持支付宝、微信、现金、钱包、储值卡等多种支付方式
- 支持单道支付、聚合支付、组合支付、退款功能
-道支付:支持支付宝、微信、现金、钱包、储值卡等多种支付方式
- 聚合支付:支持微信或支付宝使用同一个码
- 组合支付:支持多种同步支付和一个异步支付(微信、支付宝)进行组合支付
- 支持退款:部分对款、全部退款等方式

View File

@@ -4,15 +4,16 @@
- x 拆分网关同步相关代码
- x 记录网关同步记录
- x 重构支付消息通知结构, 支持多种消息中间件
- x 保存各道的支付单
- x 保存各道的支付单
- x 钱包支持设置开通时的默认金额
- x 储值卡多卡支付和退款演示
- x 储值卡批量导入
- x 储值卡多卡退款到单卡, 不传卡号自动设置为默认卡
1.0.2
- 微信V3支付接口
- 钱包设置支持配置是否创建用户时自动开通
- 支付超时逻辑重构
- 支付单增加类型记录, 如是否单道支付/单道支付类型等信息
- 支付单增加类型记录, 如是否单道支付/单道支付类型等信息
- 各种子支付单记录商户号和应用号等信息, 后期进行统计时使用
- 增加手续费配置管理
- 各种支付方式配置可以记录手续费比例, 支持简易模式和关联支付配置模式

View File

@@ -9,7 +9,7 @@ import java.util.List;
import java.util.Objects;
/**
* 支付道枚举
* 支付道枚举
*
* @author xxm
* @since 2021/7/26
@@ -22,7 +22,7 @@ public enum PayChannelEnum {
WALLET("wallet_pay", "钱包支付"), VOUCHER("voucher_pay", "储值卡支付"), CREDIT_CARD("credit_pay", "信用卡支付"),
APPLE_PAY("apple_pay", "苹果支付"), AGGREGATION("aggregation_pay", "聚合支付");
/** 支付道字符编码 */
/** 支付道字符编码 */
private final String code;
/** 名称 */
@@ -35,7 +35,7 @@ public enum PayChannelEnum {
return Arrays.stream(PayChannelEnum.values())
.filter(e -> Objects.equals(code, e.getCode()))
.findFirst()
.orElseThrow(() -> new PayFailureException("不存在的支付"));
.orElseThrow(() -> new PayFailureException("不存在的支付"));
}
public static boolean existsByCode(String code) {
@@ -49,7 +49,7 @@ public enum PayChannelEnum {
/** 微信 UA */
public static final String UA_WECHAT_PAY = "MicroMessenger";
/** 异步支付道 */
/** 异步支付道 */
public static final List<PayChannelEnum> ASYNC_TYPE = Arrays.asList(ALI, WECHAT, UNION_PAY, APPLE_PAY);
public static final List<String> ASYNC_TYPE_CODE = Arrays.asList(ALI.code, WECHAT.code, UNION_PAY.code,

View File

@@ -43,7 +43,7 @@ public class CashierController {
return Res.ok(cashierService.combinationPay(param));
}
@Operation(summary = "扫码聚合支付(单道)")
@Operation(summary = "扫码聚合支付(单道)")
@GetMapping("/aggregatePay/{mchCode}/{mchAppCode}")
public ModelAndView aggregatePay(String key,@PathVariable String mchCode,@PathVariable String mchAppCode, @RequestHeader(USER_AGENT) String ua) {
try {

View File

@@ -13,12 +13,12 @@ import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
/**
* 支付道配置
* 支付道配置
*
* @author xxm
* @since 2023-05-24
*/
@Tag(name = "支付道配置")
@Tag(name = "支付道配置")
@RestController
@RequestMapping("/channel")
@RequiredArgsConstructor

View File

@@ -7,7 +7,7 @@ import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
* 支付道配置
* 支付道配置
*
* @author xxm
* @since 2023-05-24

View File

@@ -15,7 +15,7 @@ import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 支付道配置
* 支付道配置
*
* @author xxm
* @since 2023-05-24

View File

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 支付道配置
* 支付道配置
*
* @author xxm
* @since 2023-05-24

View File

@@ -12,24 +12,24 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 支付道配置
* 支付道配置
*
* @author xxm
* @since 2023-05-24
*/
@EqualsAndHashCode(callSuper = true)
@Data
//@DbTable(comment = "支付道配置")
//@DbTable(comment = "支付道配置")
@Accessors(chain = true)
@TableName("pay_channel_config")
public class PayChannelConfig extends MpBaseEntity implements EntityBaseFunction<PayChannelConfigDto> {
/** 道编码 */
@DbColumn(comment = "道编码")
/** 道编码 */
@DbColumn(comment = "道编码")
private String code;
/** 道名称 */
@DbColumn(comment = "道名称")
/** 道名称 */
@DbColumn(comment = "道名称")
private String name;
/** 图片 */

View File

@@ -16,7 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* 支付道配置
* 支付道配置
*
* @author xxm
* @since 2023-05-24

View File

@@ -34,8 +34,8 @@ public class MchAppPayConfig extends MpBaseEntity {
@TableField(updateStrategy = FieldStrategy.NEVER)
private Long configId;
/** 支付道编码 */
@DbColumn(comment = "支付道编码")
/** 支付道编码 */
@DbColumn(comment = "支付道编码")
@TableField(updateStrategy = FieldStrategy.NEVER)
private String channel;

View File

@@ -37,7 +37,7 @@ public class MchAppPayConfigService {
public void add(MchAppPayConfig config){
// 是否重复
if (mchAppPayConfigManager.existsByAppCodeAndChannel(config.getAppCode(),config.getChannel())){
throw new BizException("该商户应用的支付道已经进行配置, 请勿重新配置");
throw new BizException("该商户应用的支付道已经进行配置, 请勿重新配置");
}
mchAppPayConfigManager.save(config);
}
@@ -50,10 +50,10 @@ public class MchAppPayConfigService {
}
/**
* 支付道配置列表
* 支付道配置列表
*/
public List<MchAppPayConfigResult> ListByAppId(String appCode) {
// 首先查询系统中配置的支付道进行排序
// 首先查询系统中配置的支付道进行排序
List<PayChannelConfig> channels = channelConfigManager.findAllByOrder();
// 查询当前应用所拥有的配置, 进行合并生成相关信息

View File

@@ -42,10 +42,10 @@ public class PayNotifyRecord extends MpCreateEntity implements EntityBaseFunctio
private String mchAppCode;
/**
* 支付
* 支付
* @see PayChannelEnum#getCode()
*/
@DbComment("支付")
@DbComment("支付")
private String payChannel;
/** 通知消息 */

View File

@@ -55,7 +55,7 @@ public class PaymentBuilder {
.filter(Objects::nonNull)
.reduce(BigDecimal::add)
.orElse(BigDecimal.ZERO);
// 支付道信息
// 支付道信息
payment.setPayChannelInfo(payTypeInfos)
.setRefundableInfo(refundableInfos)
.setPayStatus(PayStatusCode.TRADE_PROGRESS)

View File

@@ -25,7 +25,7 @@ import static cn.bootx.platform.daxpay.code.pay.PayChannelEnum.*;
public class PayStrategyFactory {
/**
* 根据传入的支付道创建策略
* 根据传入的支付道创建策略
* @param payWayParam 支付类型
* @return 支付策略
*/

View File

@@ -159,7 +159,7 @@ public class PayService {
return PaymentBuilder.buildResultByPayment(payment);
}
// 1.获取 异步支付 道,通过工厂生成对应的策略组
// 1.获取 异步支付 道,通过工厂生成对应的策略组
PayParam oldPayParam = PaymentBuilder.buildPayParamByPayment(payment);
PayWayParam payWayParam = this.getAsyncPayModeParam(payParam, oldPayParam);
List<AbsPayStrategy> paymentStrategyList = PayStrategyFactory.create(Collections.singletonList(payWayParam));

View File

@@ -68,10 +68,10 @@ public class Payment extends MpBaseEntity implements EntityBaseFunction<PaymentD
private boolean combinationPayMode;
/**
* 异步支付
* 异步支付
* @see cn.bootx.platform.daxpay.code.pay.PayChannelEnum#ALI
*/
@DbColumn(comment = "异步支付")
@DbColumn(comment = "异步支付")
private String asyncPayChannel;
/** 金额 */
@@ -91,13 +91,13 @@ public class Payment extends MpBaseEntity implements EntityBaseFunction<PaymentD
private String errorMsg;
/**
* 支付道信息列表
* 支付道信息列表
* @see PayChannelInfo
*/
@TableField(typeHandler = JacksonRawTypeHandler.class)
@BigField
@DbMySqlFieldType(MySqlFieldTypeEnum.LONGTEXT)
@DbColumn(comment = "支付道信息列表")
@DbColumn(comment = "支付道信息列表")
private List<PayChannelInfo> payChannelInfo;
/**

View File

@@ -25,7 +25,7 @@ import static cn.bootx.platform.daxpay.code.pay.PayChannelEnum.ASYNC_TYPE_CODE;
public class PayRefundStrategyFactory {
/**
* 根据传入的支付道创建策略
* 根据传入的支付道创建策略
* @return 支付策略
*/
public static AbsPayRefundStrategy create(RefundModeParam refundModeParam) {

View File

@@ -47,7 +47,7 @@ public final class AsyncRefundLocal {
/**
* 设置 错误码
* @see PayStatusCode#REFUND_PROCESS_FAIL 或者其他支付道返回的错误码
* @see PayStatusCode#REFUND_PROCESS_FAIL 或者其他支付道返回的错误码
*/
public static void setErrorCode(String errorCode) {
ERROR_CODE.set(errorCode);

View File

@@ -96,7 +96,7 @@ public class PayRefundService {
throw new PayFailureException("状态非法, 无法退款");
}
// 过滤退款金额为0的支付道参数
// 过滤退款金额为0的支付道参数
refundModeParams.removeIf(refundModeParam -> BigDecimalUtil.compareTo(refundModeParam.getAmount(), BigDecimal.ZERO) == 0);
// 退款参数检查
this.payModeCheck(refundModeParams, payment.getRefundableInfo());

View File

@@ -41,10 +41,10 @@ public class PaySyncRecord extends MpCreateEntity implements EntityBaseFunction
private String mchAppCode;
/**
* 支付
* 支付
* @see PayChannelEnum#getCode()
*/
@DbComment("支付")
@DbComment("支付")
private String payChannel;
/** 通知消息 */

View File

@@ -7,21 +7,21 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 支付道配置
* 支付道配置
*
* @author xxm
* @since 2023-05-24
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(title = "支付道配置")
@Schema(title = "支付道配置")
@Accessors(chain = true)
public class PayChannelConfigDto extends BaseDto {
@Schema(description = "道编码")
@Schema(description = "道编码")
private String code;
@Schema(description = "道名称")
@Schema(description = "道名称")
private String name;
@Schema(description = "图片")

View File

@@ -5,20 +5,20 @@ import lombok.Data;
import lombok.experimental.Accessors;
/**
* 支付道配置
* 支付道配置
*
* @author xxm
* @since 2023/5/24
*/
@Data
@Accessors(chain = true)
@Schema(title = "支付道配置")
@Schema(title = "支付道配置")
public class MchAppPayConfigResult {
@Schema(description = "支付道编码")
@Schema(description = "支付道编码")
private String channelCode;
@Schema(description = "支付道名称")
@Schema(description = "支付道名称")
private String channelName;
@Schema(description = "状态")

View File

@@ -33,7 +33,7 @@ public class PayNotifyRecordDto extends BaseDto implements Serializable {
@Schema(description = "通知消息")
private String notifyInfo;
@Schema(description = "支付")
@Schema(description = "支付")
private String payChannel;
@Schema(description = "处理状态")

View File

@@ -25,7 +25,7 @@ public class PayResult implements Serializable {
/**
* @see PayChannelEnum#getCode()
*/
@Schema(description = "异步支付")
@Schema(description = "异步支付")
private String asyncPayChannel;
/**

View File

@@ -8,19 +8,19 @@ import java.io.Serializable;
import java.math.BigDecimal;
/**
* 支付道信息
* 支付道信息
*
* @author xxm
* @since 2020/12/8
*/
@Data
@Accessors(chain = true)
@Schema(title = "支付道信息")
@Schema(title = "支付道信息")
public class PayChannelInfo implements Serializable {
private static final long serialVersionUID = -7757908686367215682L;
@Schema(description = "支付")
@Schema(description = "支付")
private String payChannel;
@Schema(description = "支付方式")

View File

@@ -48,7 +48,7 @@ public class PaymentDto extends BaseDto implements Serializable {
/**
* @see cn.bootx.platform.daxpay.code.pay.PayChannelEnum#ASYNC_TYPE_CODE
*/
@Schema(description = "异步支付")
@Schema(description = "异步支付")
private String asyncPayChannel;
/**
@@ -72,7 +72,7 @@ public class PaymentDto extends BaseDto implements Serializable {
/**
* @see PayChannelInfo
*/
@Schema(description = "支付道信息")
@Schema(description = "支付道信息")
private List<PayChannelInfo> payChannelInfo;
/**

View File

@@ -20,7 +20,7 @@ public class RefundableInfo {
/**
* @see cn.bootx.platform.daxpay.code.pay.PayChannelEnum
*/
@Schema(description = "支付")
@Schema(description = "支付")
private String payChannel;
@Schema(description = "金额")

View File

@@ -36,10 +36,10 @@ public class PaySyncRecordDto extends BaseDto {
private String mchAppCode;
/**
* 支付
* 支付
* @see PayChannelEnum#getCode()
*/
@Schema(description = "支付")
@Schema(description = "支付")
private String payChannel;
/** 通知消息 */

View File

@@ -33,7 +33,7 @@ public class CashierSinglePayParam {
@Schema(description = "openId")
private String openId;
@Schema(description = "支付")
@Schema(description = "支付")
private String payChannel;
@Schema(description = "支付方式")

View File

@@ -8,13 +8,13 @@ import lombok.experimental.Accessors;
import static cn.bootx.platform.common.core.annotation.QueryParam.CompareTypeEnum.LIKE;
/**
* 支付道配置 编码见 @see {@link cn.bootx.platform.daxpay.code.pay.PayChannelCode}
* 支付道配置 编码见 @see {@link cn.bootx.platform.daxpay.code.pay.PayChannelCode}
*
* @author xxm
* @since 2023-05-24
*/
@Data
@Schema(title = "支付道配置")
@Schema(title = "支付道配置")
@Accessors(chain = true)
public class PayChannelConfigParam {
@@ -22,11 +22,11 @@ public class PayChannelConfigParam {
private Long id;
@QueryParam(type = LIKE)
@Schema(description = "道编码")
@Schema(description = "道编码")
private String code;
@QueryParam(type = LIKE)
@Schema(description = "支付道名称")
@Schema(description = "支付道名称")
private String name;
@Schema(description = "图片")

View File

@@ -34,8 +34,8 @@ public class PayWayParam implements Serializable {
/**
* @see PayChannelEnum#getCode()
*/
@Schema(description = "支付道编码")
@NotBlank(message = "支付道编码不可为空")
@Schema(description = "支付道编码")
@NotBlank(message = "支付道编码不可为空")
private String payChannel;
/**
@@ -59,7 +59,7 @@ public class PayWayParam implements Serializable {
private String extraParamsJson;
/**
* 转换为 支付道信息 对象
* 转换为 支付道信息 对象
*/
public PayChannelInfo toPayTypeInfo() {
return PayConvert.CONVERT.convert(this);

View File

@@ -24,7 +24,7 @@ public class RefundModeParam {
/**
* @see PayChannelEnum#getCode()
*/
@Schema(description = "支付")
@Schema(description = "支付")
private String payChannel;
@Schema(description = "支付金额")

View File

@@ -20,7 +20,7 @@ public class RefundParam {
@Schema(description = "业务id")
private String businessId;
@Schema(description = "道退款参数")
@Schema(description = "道退款参数")
private List<RefundModeParam> refundModeParams;
}

View File

@@ -79,7 +79,7 @@ public class PayWayUtil {
/**
* 构建扩展参数构建
* @param payChannel 支付道编码
* @param payChannel 支付道编码
* @param map 支付方式扩展字段信息 key 为 PayModelExtraCode中定义的
*/
public String buildExtraParamsJson(String payChannel, Map<String, Object> map) {