记得上下班打卡 | git大法好,push需谨慎

Commit 939f1c68 authored by jiangxiulong's avatar jiangxiulong

银联超时支付也记录退款订单

parent a224e458
......@@ -636,11 +636,8 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_NFT_ORDER.getKey(),
SqlMapping.gets(sqls, sqlDataOrder));
if (orderVo.getPayType().equals("applepay")) {// 苹果支付不做处理
return "success";
} else {// 退款
nftOrderUtils.refundOrderSku(orderId, syncOrderParam.getPaymentId(), syncOrderParam.getPaymentType());
}
// 退款
nftOrderUtils.refundOrderSku(orderId, syncOrderParam.getPaymentId(), syncOrderParam.getPaymentType(), orderVo.getPayType());
} else {// 正常流程
orderVo.setPaymentType(syncOrderParam.getPaymentType());
orderVo.setPaymentId(syncOrderParam.getPaymentId());
......
......@@ -257,7 +257,7 @@ public class GoblinNftOrderUtils {
}
//超时支付自动退款
public Boolean refundOrderSku(String orderId, String paymentId, String paymentType) {
public Boolean refundOrderSku(String orderId, String paymentId, String paymentType, String payType) {
LocalDateTime now = LocalDateTime.now();
GoblinNftOrderVo nftOrder = getNftOrder(orderId);
BigDecimal refundPrice = nftOrder.getPriceActual();
......@@ -275,17 +275,19 @@ public class GoblinNftOrderUtils {
backOrderVo.setCreatedAt(now);
backOrderVo.setErrorReason("");
// 调用退款 超时支付回调可能还未完成 所以redisVo没有此俩个参数
nftOrder.setPaymentId(paymentId);
nftOrder.setPaymentType(paymentType);
String returnString = initRefund(nftOrder, refundPrice, refundCode);
HashMap hashMapResult = JsonUtils.fromJson(returnString, HashMap.class);
Boolean success = (Boolean) hashMapResult.get("success");
String message = (String) hashMapResult.get("message");
if (!success) {
if (!Objects.equals(backOrderVo.getStatus(), GoblinStatusConst.NftStatus.ORDER_REFUND_STATUS_2.getValue())) {
backOrderVo.setStatus(GoblinStatusConst.NftStatus.ORDER_REFUND_STATUS_3.getValue());
backOrderVo.setErrorReason(message);
if (!payType.equals("applepay")) {// 苹果支付不做处理
// 调用退款 超时支付回调可能还未完成 所以redisVo没有此俩个参数
nftOrder.setPaymentId(paymentId);
nftOrder.setPaymentType(paymentType);
String returnString = initRefund(nftOrder, refundPrice, refundCode);
HashMap hashMapResult = JsonUtils.fromJson(returnString, HashMap.class);
Boolean success = (Boolean) hashMapResult.get("success");
String message = (String) hashMapResult.get("message");
if (!success) {
if (!Objects.equals(backOrderVo.getStatus(), GoblinStatusConst.NftStatus.ORDER_REFUND_STATUS_2.getValue())) {
backOrderVo.setStatus(GoblinStatusConst.NftStatus.ORDER_REFUND_STATUS_3.getValue());
backOrderVo.setErrorReason(message);
}
}
}
......@@ -303,11 +305,8 @@ public class GoblinNftOrderUtils {
backOrderVo.getErrorReason(), now
)
);
if (success) {
return true;
} else {
return false;
}
return true;
}
private String initRefund(GoblinNftOrderVo orderVo, BigDecimal price, String refundCode) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment