|
|
|
@@ -16,6 +16,8 @@ import com.iformall.douyin.web.api.order.TtWebOrderService; |
|
|
|
import com.iformall.douyin.web.api.order.TtWebPayService; |
|
|
|
import com.iformall.douyin.web.api.web.*; |
|
|
|
import com.iformall.douyin.web.bean.*; |
|
|
|
import com.iformall.enums.EnumPayStatus; |
|
|
|
import com.iformall.service.pay.service.pay.entity.PayQueryAdapterResult; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import me.chanjar.weixin.common.error.WxError; |
|
|
|
import me.chanjar.weixin.common.error.WxErrorException; |
|
|
|
@@ -48,8 +50,17 @@ public class TtWebOrderServiceImpl implements TtWebOrderService { |
|
|
|
public TtPayOrderQueryV2Result queryOrderV2(TtPayOrderQueryV2Request request) throws WxErrorException { |
|
|
|
final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); |
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin().getPrefix() + this.QUERY_ORDER; |
|
|
|
String result = this.service.execute(executor, apiUrl, GSON.toJson(request)); |
|
|
|
return GSON.fromJson(result, TtPayOrderQueryV2Result.class); |
|
|
|
|
|
|
|
try{ |
|
|
|
String result = this.service.execute(executor, apiUrl, GSON.toJson(request)); |
|
|
|
return GSON.fromJson(result, TtPayOrderQueryV2Result.class); |
|
|
|
}catch(WxErrorException e){ |
|
|
|
//处理无订单 |
|
|
|
if(e.getError() != null && e.getError().getErrorCode() == 2191002) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
throw e; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@@ -60,8 +71,17 @@ public class TtWebOrderServiceImpl implements TtWebOrderService { |
|
|
|
request.setOrderId(StringUtils.trimToNull(orderId)); |
|
|
|
|
|
|
|
String apiUrl = this.service.getTtWebConfig().getApiBegin().getPrefix() + this.QUERY_CPS; |
|
|
|
String result = this.service.execute(executor, apiUrl, GSON.toJson(request)); |
|
|
|
return GSON.fromJson(result, TtPayCpsOrderQueryV2Result.class); |
|
|
|
try{ |
|
|
|
String result = this.service.execute(executor, apiUrl, GSON.toJson(request)); |
|
|
|
return GSON.fromJson(result, TtPayCpsOrderQueryV2Result.class); |
|
|
|
}catch(WxErrorException e){ |
|
|
|
//处理无订单 |
|
|
|
if(e.getError() != null && e.getError().getErrorCode() == 2191002) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
throw e; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|