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

Commit 939f1c68 authored by jiangxiulong's avatar jiangxiulong

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

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