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

Commit 341be41b authored by jiangxiulong's avatar jiangxiulong

退款回调完善

parent 8c581be1
......@@ -186,11 +186,11 @@ public class GoblinStatusConst {
/* -----------------------------NFT订单状态------------------------------------ */
public enum NftStatus {
ORDER_STATUS_1(1, "待付款(用户刚下单)"),
ORDER_STATUS_2(2, "已付款(用户付完款 等待商城发货)"),
ORDER_STATUS_1(1, "待付款"),
ORDER_STATUS_2(2, "已付款"),
ORDER_STATUS_3(3, "已取消(未付款取消订单"),
ORDER_STATUS_4(4, "退款中(超时支付)"),
ORDER_STATUS_5(5, "已退款(超时支付)"),
ORDER_STATUS_4(4, "退款中(目前只有超时支付)"),
ORDER_STATUS_5(5, "已退款(目前只有超时支付)"),
ORDER_REFUND_STATUS_1(1, "申请"),
ORDER_REFUND_STATUS_2(2, "退款成功"),
......
......@@ -400,7 +400,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
@Override
public String syncOrder(GoblinNftOrderPayCallbackParam syncOrderParam) {
log.info("SYNC PARAM = " + syncOrderParam.toString());
log.info("NFT支付回调 参数: " + syncOrderParam.toString());
String orderCode = syncOrderParam.getOrderCode();
String orderId = syncOrderParam.getOrderId();
......@@ -410,21 +410,21 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
log.error("Nft订单不存在 param:[orderCode:{}]", orderCode);
return "fail";
}
if (orderVo.getPayCode().equals(syncOrderParam.getCode())) {
log.error("Nft订单payCode不匹配 param:[orderCode:{}, payCode:{}]", orderCode, syncOrderParam.getCode());
if (!orderVo.getPayCode().equals(syncOrderParam.getCode())) {
log.error("Nft订单payCode不匹配 param:[orderCode:{}, payCode:{}, code:{}]", orderCode, orderVo.getPayCode(), syncOrderParam.getCode());
return "fail";
}
if (!Objects.equals(orderVo.getStatus(), GoblinStatusConst.NftStatus.ORDER_STATUS_2.getValue())) {
if (!Objects.equals(orderVo.getStatus(), GoblinStatusConst.NftStatus.ORDER_STATUS_1.getValue())) {
log.error("Nft订单当前状态不能支付回调 param:[orderCode:{}, status:{}]", orderCode, orderVo.getStatus());
return "fail";
}
if (Objects.equals(1, syncOrderParam.getStatus())) {// 超时支付
if (Objects.equals(orderVo.getStatus(), GoblinStatusConst.NftStatus.ORDER_STATUS_3.getValue())) {
if (Objects.equals(1, syncOrderParam.getStatus())) {
if (Objects.equals(orderVo.getStatus(), GoblinStatusConst.NftStatus.ORDER_STATUS_3.getValue())) {// 超时支付
log.error("Nft订单超时支付 param:[orderCode:{}]", orderCode);
// 退款
nftOrderUtils.refundOrderSku(orderId, syncOrderParam.getPaymentId(), syncOrderParam.getPaymentType());
} else if (syncOrderParam.getStatus().equals(1)) {// 正常流程
} else {// 正常流程
LocalDateTime now = LocalDateTime.now();
String uid = orderVo.getUserId();
......
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