mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-02 02:34:34 +00:00
ref 一些接口参数的修改
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
# CHANGELOG
|
||||
## [v3.0.0.beta1] 2024-10-24
|
||||
|
||||
## [v2.0.8] 2024-06-27
|
||||
- 新增: 撤销接口
|
||||
- 新增: 转账功能
|
||||
|
@@ -26,3 +26,5 @@
|
||||
- [ ] 商户应用应该要有一个类似删除的功能, 实现停用冻结, 但不影响数据的关联
|
||||
- [ ] 商户应用增加启停用状态
|
||||
- [ ] 定时同步任务频次不要太高, 预防产生过多的数据
|
||||
- [ ] 微信通道添加单独的认证跳转地址, 处理它的特殊情况
|
||||
- [ ] 退款支持以撤销的方式进行退款
|
||||
|
@@ -13,7 +13,7 @@ spring:
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://mysql/dax-pay-single?serverTimezone=GMT%2B8&characterEncoding=utf8&allowMultiQueries=true&useSSL=false&nullCatalogMeansCurrent=true
|
||||
# username: root
|
||||
# password: bootx123
|
||||
# password: root
|
||||
hikari:
|
||||
keepalive-time: 300000
|
||||
data:
|
||||
|
@@ -16,12 +16,8 @@ public enum ChannelEnum {
|
||||
|
||||
/** 支付宝 - 直连商户 */
|
||||
ALI("ali_pay"),
|
||||
/** 支付宝 - 服务商商户 */
|
||||
ALI_SERVICE("ali_service"),
|
||||
/** 微信支付 */
|
||||
WECHAT("wechat_pay"),
|
||||
/** 微信支付服务商 */
|
||||
WECHAT_SERVICE("wechat_service"),
|
||||
/** 云闪付 */
|
||||
UNION_PAY("union_pay"),
|
||||
|
||||
|
@@ -1,24 +1,27 @@
|
||||
package org.dromara.daxpay.service.param.allocation.receiver;
|
||||
package org.dromara.daxpay.core.param.allocation;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.daxpay.core.enums.AllocReceiverTypeEnum;
|
||||
import org.dromara.daxpay.core.enums.AllocRelationTypeEnum;
|
||||
import org.dromara.daxpay.core.enums.ChannelEnum;
|
||||
import org.dromara.daxpay.core.param.PaymentCommonParam;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 分账接收者添加参数
|
||||
* @author xxm
|
||||
* @since 2024/5/20
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "分账接收者添加参数")
|
||||
public class AllocReceiverAddParam{
|
||||
public class AllocReceiverAddParam extends PaymentCommonParam {
|
||||
|
||||
@Schema(description = "接收者编号, 需要保证唯一")
|
||||
@NotBlank(message = "接收者编号必填")
|
||||
@@ -68,8 +71,4 @@ public class AllocReceiverAddParam{
|
||||
@Size(max = 50, message = "关系名称不可超过50位")
|
||||
private String relationName;
|
||||
|
||||
@Schema(description = "商户应用ID")
|
||||
@NotBlank(message = "商户应用ID必填")
|
||||
@Size(max = 32, message = "商户应用ID不可超过32位")
|
||||
private String appId;
|
||||
}
|
@@ -1,29 +1,28 @@
|
||||
package org.dromara.daxpay.service.param.allocation.receiver;
|
||||
package org.dromara.daxpay.core.param.allocation;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import org.dromara.daxpay.core.param.PaymentCommonParam;
|
||||
|
||||
/**
|
||||
* 分账接收者删除参数
|
||||
* @author xxm
|
||||
* @since 2024/5/20
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "分账接收者删除参数")
|
||||
public class AllocReceiverRemoveParam {
|
||||
public class AllocReceiverRemoveParam extends PaymentCommonParam {
|
||||
|
||||
@Schema(description = "接收者编号")
|
||||
@NotBlank(message = "接收者编号必填")
|
||||
@Size(max = 32, message = "接收者编号不可超过32位")
|
||||
private String receiverNo;
|
||||
|
||||
@Schema(description = "商户应用ID")
|
||||
@NotBlank(message = "商户应用ID必填")
|
||||
@Size(max = 32, message = "商户应用ID不可超过32位")
|
||||
private String appId;
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
package org.dromara.daxpay.core.param.assist;
|
||||
|
||||
import jakarta.validation.constraints.Size;
|
||||
import org.dromara.daxpay.core.param.PaymentCommonParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
@@ -18,16 +19,19 @@ import lombok.experimental.Accessors;
|
||||
@Schema(title = "通道认证参数")
|
||||
public class AuthCodeParam extends PaymentCommonParam {
|
||||
|
||||
@Schema(description = "通道")
|
||||
@NotBlank(message = "通道不可为空")
|
||||
@Size(max = 32, message = "支付通道不可超过32位")
|
||||
@Schema(description = "支付通道")
|
||||
@NotBlank(message = "支付通道不可为空")
|
||||
private String channel;
|
||||
|
||||
@Schema(description = "标识码")
|
||||
@NotBlank(message = "标识码不可为空")
|
||||
@Size(max = 200, message = "认证标识码不可超过200位")
|
||||
@Schema(description = "认证标识码")
|
||||
@NotBlank(message = "认证标识码不可为空")
|
||||
private String authCode;
|
||||
|
||||
/** 用于查询Code值, 可以为空 */
|
||||
@Schema(description = "查询Code")
|
||||
@Size(max = 64, message = "查询码不可超过64位")
|
||||
@Schema(description = "查询码")
|
||||
private String queryCode;
|
||||
|
||||
}
|
||||
|
@@ -1,10 +1,12 @@
|
||||
package org.dromara.daxpay.core.param.assist;
|
||||
|
||||
import org.dromara.daxpay.core.param.PaymentCommonParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.daxpay.core.param.PaymentCommonParam;
|
||||
|
||||
/**
|
||||
* 生成授权链接参数
|
||||
@@ -18,15 +20,17 @@ import lombok.experimental.Accessors;
|
||||
public class GenerateAuthUrlParam extends PaymentCommonParam {
|
||||
|
||||
/**
|
||||
* 通道
|
||||
* 支付通道
|
||||
*/
|
||||
@Schema(description = "通道")
|
||||
@NotBlank(message = "支付通道必填")
|
||||
@Schema(description = "支付通道")
|
||||
private String channel;
|
||||
|
||||
/**
|
||||
* 自定义授权重定向地址, 如果不传, 使用系统提供的默认地址
|
||||
*/
|
||||
@Schema(description = "自定义授权重定向地址")
|
||||
@Schema(description = "授权重定向地址")
|
||||
@Size(max = 100, message = "授权重定向地址不可超过100位")
|
||||
private String authRedirectUrl;
|
||||
|
||||
}
|
||||
|
@@ -48,7 +48,6 @@ public class PayParam extends PaymentCommonParam {
|
||||
@Schema(description = "自动分账")
|
||||
private Boolean autoAllocation;
|
||||
|
||||
|
||||
/** 过期时间 */
|
||||
@Schema(description = "过期时间")
|
||||
@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
|
||||
|
@@ -11,9 +11,9 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.daxpay.service.param.allocation.receiver.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.service.param.allocation.receiver.AllocReceiverQuery;
|
||||
import org.dromara.daxpay.service.param.allocation.receiver.AllocReceiverRemoveParam;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverRemoveParam;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocReceiverResult;
|
||||
import org.dromara.daxpay.service.service.allocation.AllocReceiverService;
|
||||
import org.dromara.daxpay.service.service.assist.PaymentAssistService;
|
||||
|
@@ -37,8 +37,8 @@ public class ChannelCashierController {
|
||||
private final ChannelCashierConfigService cashierConfigService;
|
||||
|
||||
@Operation(summary = "获取收银台信息")
|
||||
@GetMapping("/getCashierType")
|
||||
public Result<ChannelCashierConfigResult> getCashierType(String cashierType,String appId){
|
||||
@GetMapping("/getCashierInfo")
|
||||
public Result<ChannelCashierConfigResult> getCashierInfo(String cashierType,String appId){
|
||||
paymentAssistService.initMchApp(appId);
|
||||
return Res.ok(cashierConfigService.findByCashierType(cashierType));
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class ChannelCashierController {
|
||||
return Res.ok(channelCashierService.generateAuthUrl(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取授权结果")
|
||||
@Operation(summary = "授权获取结果")
|
||||
@PostMapping("/auth")
|
||||
public Result<AuthResult> auth(@RequestBody CashierAuthCodeParam param){
|
||||
ValidationUtil.validateParam(param);
|
||||
|
@@ -1,13 +1,18 @@
|
||||
package org.dromara.daxpay.service.controller.unipay;
|
||||
|
||||
import cn.bootx.platform.core.annotation.IgnoreAuth;
|
||||
import org.dromara.daxpay.core.param.PaymentCommonParam;
|
||||
import org.dromara.daxpay.core.result.DaxResult;
|
||||
import org.dromara.daxpay.core.util.DaxRes;
|
||||
import org.dromara.daxpay.service.common.anno.PaymentVerify;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverRemoveParam;
|
||||
import org.dromara.daxpay.service.service.allocation.AllocReceiverService;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -23,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/unipay/alloc")
|
||||
@RequiredArgsConstructor
|
||||
public class UniAllocationController {
|
||||
private final AllocReceiverService allocReceiverService;
|
||||
|
||||
@Operation(summary = "发起分账接口")
|
||||
@PostMapping("/start")
|
||||
@@ -36,15 +42,23 @@ public class UniAllocationController {
|
||||
return DaxRes.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "分账接收方查询接口")
|
||||
@PostMapping("/receiver/list")
|
||||
public DaxResult<Void> receiverList(@RequestBody PaymentCommonParam param){
|
||||
return DaxRes.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "分账接收方添加接口")
|
||||
@PostMapping("/receiver/add")
|
||||
public DaxResult<Void> receiverAdd(){
|
||||
public DaxResult<Void> receiverAdd(@RequestBody AllocReceiverAddParam param){
|
||||
allocReceiverService.addAndSync(param);
|
||||
return DaxRes.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "分账接收方删除接口")
|
||||
@PostMapping("/receiver/remove")
|
||||
public DaxResult<Void> receiverRemove(){
|
||||
public DaxResult<Void> receiverRemove(@RequestBody AllocReceiverRemoveParam param){
|
||||
allocReceiverService.removeAndSync(param);
|
||||
return DaxRes.ok();
|
||||
}
|
||||
|
||||
|
@@ -53,8 +53,8 @@ public class UniSyncController {
|
||||
return DaxRes.ok(refundSyncService.sync(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "分账订单同步接口")
|
||||
@PostMapping("/allocation")
|
||||
@Operation(summary = "转账订单同步接口")
|
||||
@PostMapping("/transfer")
|
||||
public DaxResult<TransferSyncResult> allocation(@RequestBody TransferSyncParam param){
|
||||
return DaxRes.ok(transferSyncService.sync(param));
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package org.dromara.daxpay.service.convert.allocation;
|
||||
|
||||
import org.dromara.daxpay.service.entity.allocation.receiver.AllocReceiver;
|
||||
import org.dromara.daxpay.service.param.allocation.receiver.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocReceiverResult;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
@@ -5,8 +5,8 @@ import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@@ -7,8 +7,8 @@ import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.DecimalMax;
|
||||
import javax.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.DecimalMax;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
|
@@ -5,7 +5,7 @@ import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@@ -19,9 +19,6 @@ import org.dromara.daxpay.core.result.MchAppResult;
|
||||
@Schema(title = "分账接收方")
|
||||
public class AllocReceiverResult extends MchAppResult {
|
||||
|
||||
@Schema(description = "账号别名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "接收方编号")
|
||||
private String receiverNo;
|
||||
|
||||
|
@@ -18,18 +18,10 @@ public class PlatformConfigResult {
|
||||
@Schema(description = "支付网关地址")
|
||||
private String gatewayServiceUrl;
|
||||
|
||||
/** 网关移动端是否为嵌入式 */
|
||||
@Schema(description = "网关移动端是否为嵌入式")
|
||||
private boolean mobileEmbedded;
|
||||
|
||||
/** 网关移动端地址 */
|
||||
@Schema(description = "网关移动端地址")
|
||||
private String gatewayMobileUrl;
|
||||
|
||||
/** 网关PC端是否为嵌入式 */
|
||||
@Schema(description = "网关PC端是否为嵌入式")
|
||||
private boolean pcEmbedded;
|
||||
|
||||
/** 网关PC端地址 */
|
||||
@Schema(description = "网关PC端地址")
|
||||
private String gatewayPcUrl;
|
||||
|
@@ -15,7 +15,7 @@ import lombok.experimental.Accessors;
|
||||
public class ApiConstResult {
|
||||
/** 接口编码 */
|
||||
@Schema(description = "编码")
|
||||
private String channel;
|
||||
private String code;
|
||||
|
||||
/** 接口名称 */
|
||||
@Schema(description = "接口名称")
|
||||
|
@@ -50,12 +50,14 @@ public class TradeCallbackRecordResult extends MchAppResult {
|
||||
@Schema(description = "回调处理状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "调整号")
|
||||
private String adjustNo;
|
||||
/** 错误码 */
|
||||
@Schema(description = "错误码")
|
||||
private String errorCode;
|
||||
|
||||
/** 提示信息 */
|
||||
@Schema(description = "提示信息")
|
||||
private String errorMsg;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
package org.dromara.daxpay.service.result.record.sync;
|
||||
|
||||
import org.dromara.daxpay.core.enums.ChannelEnum;
|
||||
import org.dromara.daxpay.core.result.MchAppResult;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.daxpay.core.enums.ChannelEnum;
|
||||
import org.dromara.daxpay.core.result.MchAppResult;
|
||||
|
||||
/**
|
||||
* 支付同步记录
|
||||
@@ -62,10 +62,6 @@ public class TradeSyncRecordResult extends MchAppResult {
|
||||
@Schema(description = "是否进行调整")
|
||||
private boolean adjust;
|
||||
|
||||
/** 调整单号 */
|
||||
@Schema(description = "调整单号")
|
||||
private String adjustNo;
|
||||
|
||||
/** 错误码 */
|
||||
@Schema(description = "错误码")
|
||||
private String errorCode;
|
||||
|
@@ -20,9 +20,9 @@ import org.dromara.daxpay.service.convert.allocation.AllocReceiverConvert;
|
||||
import org.dromara.daxpay.service.dao.allocation.receiver.AllocGroupReceiverManager;
|
||||
import org.dromara.daxpay.service.dao.allocation.receiver.AllocReceiverManager;
|
||||
import org.dromara.daxpay.service.entity.allocation.receiver.AllocReceiver;
|
||||
import org.dromara.daxpay.service.param.allocation.receiver.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.service.param.allocation.receiver.AllocReceiverQuery;
|
||||
import org.dromara.daxpay.service.param.allocation.receiver.AllocReceiverRemoveParam;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverRemoveParam;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocReceiverResult;
|
||||
import org.dromara.daxpay.service.strategy.AbsAllocReceiverStrategy;
|
||||
import org.dromara.daxpay.service.strategy.PaymentStrategy;
|
||||
|
Reference in New Issue
Block a user