mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-02 02:34:34 +00:00
feat SDK调整和文档更新
This commit is contained in:
@@ -7,6 +7,8 @@ import lombok.experimental.Accessors;
|
||||
import org.dromara.daxpay.core.enums.ChannelEnum;
|
||||
import org.dromara.daxpay.core.result.MchAppResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分账接收方
|
||||
* @author xxm
|
||||
@@ -18,37 +20,44 @@ import org.dromara.daxpay.core.result.MchAppResult;
|
||||
@Schema(title = "分账接收方")
|
||||
public class AllocReceiverResult extends MchAppResult {
|
||||
|
||||
@Schema(description = "接收方编号")
|
||||
private String receiverNo;
|
||||
@Schema(description = "接收方列表")
|
||||
private List<Receiver> receivers;
|
||||
|
||||
/**
|
||||
* @see ChannelEnum
|
||||
*/
|
||||
@Schema(description = "所属通道")
|
||||
private String channel;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class Receiver{
|
||||
@Schema(description = "接收方编号")
|
||||
private String receiverNo;
|
||||
|
||||
/**
|
||||
* 分账接收方类型 个人/商户
|
||||
* @see org.dromara.daxpay.core.enums.AllocReceiverTypeEnum
|
||||
*/
|
||||
@Schema(description = "分账接收方类型")
|
||||
private String receiverType;
|
||||
/**
|
||||
* @see ChannelEnum
|
||||
*/
|
||||
@Schema(description = "所属通道")
|
||||
private String channel;
|
||||
|
||||
/**
|
||||
* 分账接收方类型 个人/商户
|
||||
* @see org.dromara.daxpay.core.enums.AllocReceiverTypeEnum
|
||||
*/
|
||||
@Schema(description = "分账接收方类型")
|
||||
private String receiverType;
|
||||
|
||||
|
||||
@Schema(description = "接收方账号")
|
||||
private String receiverAccount;
|
||||
@Schema(description = "接收方账号")
|
||||
private String receiverAccount;
|
||||
|
||||
/** 接收方姓名 */
|
||||
@Schema(description = "接收方姓名")
|
||||
private String receiverName;
|
||||
/** 接收方姓名 */
|
||||
@Schema(description = "接收方姓名")
|
||||
private String receiverName;
|
||||
|
||||
/**
|
||||
* 分账关系类型
|
||||
* @see org.dromara.daxpay.core.enums.AllocRelationTypeEnum
|
||||
*/
|
||||
@Schema(description = "分账关系类型")
|
||||
private String relationType;
|
||||
/**
|
||||
* 分账关系类型
|
||||
* @see org.dromara.daxpay.core.enums.AllocRelationTypeEnum
|
||||
*/
|
||||
@Schema(description = "分账关系类型")
|
||||
private String relationType;
|
||||
|
||||
@Schema(description = "关系名称")
|
||||
private String relationName;
|
||||
@Schema(description = "关系名称")
|
||||
private String relationName;
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package org.dromara.daxpay.service.aop;
|
||||
|
||||
import cn.bootx.platform.core.exception.BizException;
|
||||
import cn.bootx.platform.core.exception.ValidationFailedException;
|
||||
import cn.bootx.platform.core.util.ValidationUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -7,7 +8,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.dromara.daxpay.core.exception.PayFailureException;
|
||||
import org.dromara.daxpay.core.param.PaymentCommonParam;
|
||||
import org.dromara.daxpay.core.result.DaxResult;
|
||||
import org.dromara.daxpay.service.service.assist.PaymentAssistService;
|
||||
@@ -38,25 +38,24 @@ public class PaymentVerifyAspect {
|
||||
throw new ValidationFailedException("支付方法至少有一个参数,并且需要签名的支付参数放在第一位");
|
||||
}
|
||||
Object param = args[0];
|
||||
if (param instanceof PaymentCommonParam paymentParam){
|
||||
// 参数校验
|
||||
ValidationUtil.validateParam(paymentParam);
|
||||
// 应用信息初始化
|
||||
paymentAssistService.initMchApp(paymentParam.getAppId());
|
||||
// 终端信息初始化
|
||||
paymentAssistService.initClient(paymentParam);
|
||||
// 参数签名校验
|
||||
paymentAssistService.signVerify(paymentParam);
|
||||
// 参数请求时间校验
|
||||
paymentAssistService.reqTimeoutVerify(paymentParam);
|
||||
|
||||
} else {
|
||||
if (!(param instanceof PaymentCommonParam paymentParam)) {
|
||||
throw new ValidationFailedException("参数需要继承PayCommonParam");
|
||||
}
|
||||
Object proceed;
|
||||
// 应用信息初始化
|
||||
paymentAssistService.initMchApp(paymentParam.getAppId());
|
||||
try {
|
||||
// 参数签名校验
|
||||
paymentAssistService.signVerify(paymentParam);
|
||||
// 参数校验
|
||||
ValidationUtil.validateParam(paymentParam);
|
||||
// 终端信息初始化
|
||||
paymentAssistService.initClient(paymentParam);
|
||||
// 参数请求时间校验
|
||||
paymentAssistService.reqTimeoutVerify(paymentParam);
|
||||
|
||||
proceed = pjp.proceed();
|
||||
} catch (PayFailureException ex) {
|
||||
} catch (BizException ex) {
|
||||
DaxResult<Void> result = new DaxResult<>(ex.getCode(), ex.getMessage());
|
||||
paymentAssistService.sign(result);
|
||||
return result;
|
||||
|
@@ -17,8 +17,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分账控制器
|
||||
* @author xxm
|
||||
@@ -47,7 +45,7 @@ public class UniAllocationController {
|
||||
|
||||
@Operation(summary = "分账接收方查询接口")
|
||||
@PostMapping("/receiver/list")
|
||||
public DaxResult<List<AllocReceiverResult>> receiverList(@RequestBody AllocReceiverQueryParam param){
|
||||
public DaxResult<AllocReceiverResult> receiverList(@RequestBody AllocReceiverQueryParam param){
|
||||
return DaxRes.ok(allocReceiverService.list(param));
|
||||
}
|
||||
|
||||
|
@@ -24,5 +24,5 @@ public interface AllocReceiverConvert {
|
||||
|
||||
AllocReceiverResult toResult(AllocReceiver in);
|
||||
|
||||
List<AllocReceiverResult> toList(List<AllocReceiver> in);
|
||||
List<AllocReceiverResult.Receiver> toList(List<AllocReceiver> in);
|
||||
}
|
||||
|
@@ -80,9 +80,10 @@ public class AllocReceiverService {
|
||||
/**
|
||||
* 分账接收方列表
|
||||
*/
|
||||
public List<AllocReceiverResult> list(AllocReceiverQueryParam param){
|
||||
public AllocReceiverResult list(AllocReceiverQueryParam param){
|
||||
List<AllocReceiver> allocReceivers = allocReceiverManager.findAllByChannel(param.getChannel(), param.getAppId());
|
||||
return AllocReceiverConvert.CONVERT.toList(allocReceivers);
|
||||
List<AllocReceiverResult.Receiver> list = AllocReceiverConvert.CONVERT.toList(allocReceivers);
|
||||
return new AllocReceiverResult().setReceivers(list);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user