diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/DelayMerchantOrderLogic.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/DelayMerchantOrderLogic.java index c8c712b2d..27b2e9e9d 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/DelayMerchantOrderLogic.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/DelayMerchantOrderLogic.java @@ -521,22 +521,14 @@ public class DelayMerchantOrderLogic extends AbstractOrderLogic { BigDecimal deductionAmount = vo.getDeductionAmount(); // 调汇付的交易撤销接口 - // PaymentReverseResponse paymentReverseRequest = adapayService.createPaymentReverseRequest(paymentId, deductionAmount, dto.getWechatAppId(), - // dto.getMemberId(), ScenarioEnum.BALANCE.getValue(), null); + PaymentReverseResponse request = adapayService.createPaymentReverseRequest(paymentId, deductionAmount, + dto.getWechatAppId(), dto.getMemberId(), ScenarioEnum.BALANCE.getValue(), null); - PaymentReverseOperation operation = new PaymentReverseOperation(); - operation.setPaymentId(paymentId); - operation.setReverseAmt(deductionAmount); - operation.setMerchantKey(dto.getWechatAppId()); - operation.setMemberId(dto.getMemberId()); - operation.setScenarioType(ScenarioEnum.BALANCE.getValue()); - PaymentReverseResponse paymentReverseRequest = adapayService.createPaymentReverseRequest(operation); - - if (paymentReverseRequest != null && paymentReverseRequest.isNotFailed()) { + if (request != null && request.isNotFailed()) { memberAdapayRecordService.updateRefundAmount(paymentId, deductionAmount); // 放缓存 - redisCache.setCacheObject(redisKey, paymentReverseRequest, CacheConstants.cache_expire_time_30m); + redisCache.setCacheObject(redisKey, request, CacheConstants.cache_expire_time_30m); } } } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/NotDelayMerchantOrderLogic.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/NotDelayMerchantOrderLogic.java index 9006aa077..a8d222a90 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/NotDelayMerchantOrderLogic.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/NotDelayMerchantOrderLogic.java @@ -493,14 +493,14 @@ public class NotDelayMerchantOrderLogic extends AbstractOrderLogic{ BigDecimal deductionAmount = vo.getDeductionAmount(); // 调汇付的交易退款接口 - RefundResponse refundRequest = adapayService.createRefundRequest(paymentId, refundAmount, + RefundResponse response = adapayService.createRefundRequest(paymentId, refundAmount, dto.getWechatAppId(), dto.getMemberId(), ScenarioEnum.ORDER.getValue(), dto.getOrderCode()); - if (refundRequest != null && refundRequest.isNotFailed()) { + if (response != null && response.isNotFailed()) { memberAdapayRecordService.updateRefundAmount(paymentId, deductionAmount); // 放缓存 - redisCache.setCacheObject(redisKey, refundRequest, CacheConstants.cache_expire_time_30m); + redisCache.setCacheObject(redisKey, response, CacheConstants.cache_expire_time_30m); } } }