Explorar el Código

//..

release_toaliyun_real
xhxu hace 3 años
padre
commit
0bd7b2413c
Se han modificado 1 ficheros con 24 adiciones y 4 borrados
  1. +24
    -4
      mallinkService/src/main/java/com/iformall/douyin/web/api/order/impl/TtWebOrderServiceImpl.java

+ 24
- 4
mallinkService/src/main/java/com/iformall/douyin/web/api/order/impl/TtWebOrderServiceImpl.java Ver fichero

@@ -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.order.TtWebPayService;
import com.iformall.douyin.web.api.web.*; import com.iformall.douyin.web.api.web.*;
import com.iformall.douyin.web.bean.*; import com.iformall.douyin.web.bean.*;
import com.iformall.enums.EnumPayStatus;
import com.iformall.service.pay.service.pay.entity.PayQueryAdapterResult;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import me.chanjar.weixin.common.error.WxError; import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.error.WxErrorException;
@@ -48,8 +50,17 @@ public class TtWebOrderServiceImpl implements TtWebOrderService {
public TtPayOrderQueryV2Result queryOrderV2(TtPayOrderQueryV2Request request) throws WxErrorException { public TtPayOrderQueryV2Result queryOrderV2(TtPayOrderQueryV2Request request) throws WxErrorException {
final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp());
String apiUrl = this.service.getTtWebConfig().getApiBegin().getPrefix() + this.QUERY_ORDER; 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 @Override
@@ -60,8 +71,17 @@ public class TtWebOrderServiceImpl implements TtWebOrderService {
request.setOrderId(StringUtils.trimToNull(orderId)); request.setOrderId(StringUtils.trimToNull(orderId));


String apiUrl = this.service.getTtWebConfig().getApiBegin().getPrefix() + this.QUERY_CPS; 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 @Override


Cargando…
Cancelar
Guardar