|
|
@@ -1,5 +1,6 @@
|
|
|
package com.zhongshu.card.server.core.service.payment;
|
|
|
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
import com.github.microservice.pay.client.model.ledger.TransactionLogModel;
|
|
|
import com.github.microservice.pay.client.ret.ResultState;
|
|
|
@@ -20,6 +21,7 @@ import com.zhongshu.card.server.core.domain.org.Organization;
|
|
|
import com.zhongshu.card.server.core.domain.payment.ExpenseFlow;
|
|
|
import com.zhongshu.card.server.core.domain.payment.PaymentProcess;
|
|
|
import com.zhongshu.card.server.core.domain.schedule.ScheduleTaskConfig;
|
|
|
+import com.zhongshu.card.server.core.model.pay.UnionFrictionlessPayFinishModel;
|
|
|
import com.zhongshu.card.server.core.service.base.CommonService;
|
|
|
import com.zhongshu.card.server.core.service.base.SuperService;
|
|
|
import com.zhongshu.card.server.core.service.orgManager.ProjectBindOrgServiceImpl;
|
|
|
@@ -328,10 +330,15 @@ public class PayCallService extends SuperService {
|
|
|
/**
|
|
|
* 银联云闪付支付完成
|
|
|
*
|
|
|
- * @param paymentNo
|
|
|
+ * @param param
|
|
|
* @return
|
|
|
*/
|
|
|
- public ResultContent unionFrictionlessPayFinish(String paymentNo, com.github.microservice.pay.client.ret.ResultContent<List<TransactionLogModel>> resultContent, String state) {
|
|
|
+ public ResultContent unionFrictionlessPayFinish(UnionFrictionlessPayFinishModel param) {
|
|
|
+ String paymentNo = param.getMerOrderId();
|
|
|
+ com.github.microservice.pay.client.ret.ResultContent<List<TransactionLogModel>> resultContent = param.getTransactionLogModelList();
|
|
|
+ String state = param.getStatus();
|
|
|
+ String targetOrderId = param.getTargetOrderId();
|
|
|
+
|
|
|
if (StringUtils.isEmpty(paymentNo)) {
|
|
|
return ResultContent.buildFail("paymentNo为空");
|
|
|
}
|
|
|
@@ -345,6 +352,8 @@ public class PayCallService extends SuperService {
|
|
|
entity.setIsPaySuccess(Boolean.TRUE);
|
|
|
entity.setPayRemark("支付成功");
|
|
|
entity.setPaymentStatus("支付成功");
|
|
|
+ JSONObject payResult = new JSONObject();
|
|
|
+ payResult.set("targetOrderId", targetOrderId);
|
|
|
|
|
|
paymentProcess.setIsPaySuccess(Boolean.TRUE);
|
|
|
paymentProcess.setPayRemark("支付成功");
|
|
|
@@ -478,11 +487,12 @@ public class PayCallService extends SuperService {
|
|
|
String paymentNo = entity.getPaymentNo();
|
|
|
log.info("支付清单号:{} 退款:{}", paymentNo, refundNo);
|
|
|
orderNoInfoService.saveInfo(refundNo, OrderNoType.Refund, entity.getPaymentType());
|
|
|
-
|
|
|
+ JSONObject payResult = entity.getPayResult();
|
|
|
+ String targetOrderId = payResult.getStr("targetOrderId");
|
|
|
BigDecimal payAmount = entity.getPayAmount();
|
|
|
payAmount = payAmount.stripTrailingZeros();
|
|
|
- ResultContent resultContent = chinaumsSenselessPayService.refund(entity.getProjectOid(), entity.getShopOid(), entity.getUserId(),
|
|
|
- payAmount, paymentNo, refundNo, param.getRemark());
|
|
|
+ ResultContent resultContent = chinaumsSenselessPayService.refund(entity.getProjectOid(), entity.getShopOid(),
|
|
|
+ entity.getUserId(), payAmount, paymentNo, refundNo, param.getRemark(), targetOrderId);
|
|
|
if (resultContent.isSuccess()) {
|
|
|
entity.setIsRefund(Boolean.FALSE);
|
|
|
entity.setRefundRemark(param.getRemark());
|