feat 调式转账接口

This commit is contained in:
bootx
2024-06-30 23:09:49 +08:00
parent da60b73edd
commit f095d8f40e
8 changed files with 71 additions and 18 deletions

View File

@@ -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;
}