mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-03 19:16:21 +00:00
feat 调式转账接口
This commit is contained in:
@@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@@ -63,16 +64,17 @@ public class TransferParam extends PaymentCommonParam {
|
||||
@Schema(description = "转账类型, 微信使用")
|
||||
private String transferType;
|
||||
|
||||
|
||||
/**
|
||||
* 收款人账号类型
|
||||
* @see TransferPayeeTypeEnum
|
||||
*/
|
||||
@NotBlank(message = "收款人账号类型必填")
|
||||
@Size(max = 20, message = "收款人账号类型不可超过20位")
|
||||
@Schema(description = "收款人账号类型")
|
||||
private String payeeType;
|
||||
|
||||
/** 收款人账号 */
|
||||
@NotBlank(message = "收款人账号必填")
|
||||
@Size(max = 100, message = "收款人账号不可超过100位")
|
||||
@Schema(description = "收款人账号")
|
||||
private String payeeAccount;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package cn.daxpay.single.service.core.payment.pay.service;
|
||||
|
||||
import cn.daxpay.single.core.exception.PayFailureException;
|
||||
import cn.daxpay.single.core.exception.TradeProcessingException;
|
||||
import cn.daxpay.single.core.param.payment.pay.PayParam;
|
||||
import cn.daxpay.single.core.result.pay.PayResult;
|
||||
@@ -97,7 +98,12 @@ public class PayService {
|
||||
// 支付操作
|
||||
payStrategy.doPayHandler();
|
||||
} catch (Exception e) {
|
||||
payOrder.setErrorMsg(e.getMessage());
|
||||
// 记录错误原因, 此处没有事务, 所以可以正常更新
|
||||
if (e instanceof PayFailureException){
|
||||
payOrder.setErrorCode(e.getMessage());
|
||||
} else {
|
||||
payOrder.setErrorCode("支付出现异常");
|
||||
}
|
||||
// 这个方法没有事务, 所以可以正常更新
|
||||
payOrderService.updateById(payOrder);
|
||||
throw e;
|
||||
@@ -149,7 +155,11 @@ public class PayService {
|
||||
payStrategy.doPayHandler();
|
||||
} catch (Exception e) {
|
||||
// 记录错误原因, 此处没有事务, 所以可以正常更新
|
||||
payOrder.setErrorMsg(e.getMessage());
|
||||
if (e instanceof PayFailureException){
|
||||
payOrder.setErrorCode(e.getMessage());
|
||||
} else {
|
||||
payOrder.setErrorCode("支付出现异常");
|
||||
}
|
||||
payOrderService.updateById(payOrder);
|
||||
throw e;
|
||||
}
|
||||
|
Reference in New Issue
Block a user