Commit f2cf1c54 by ping.wu

调用预支付接口

parent d6330d2a
...@@ -143,6 +143,8 @@ public class PayServiceImpl { ...@@ -143,6 +143,8 @@ public class PayServiceImpl {
private Boolean queryPayOrder; private Boolean queryPayOrder;
@Value("${use.pay.feign:true}") @Value("${use.pay.feign:true}")
private Boolean usePayFeignClient; private Boolean usePayFeignClient;
@Value("${pay.response.error:true}")
private Boolean printUnifiedPayResponseError;
private static final Integer MULITI_RESPONSE = 200; private static final Integer MULITI_RESPONSE = 200;
...@@ -502,7 +504,23 @@ public class PayServiceImpl { ...@@ -502,7 +504,23 @@ public class PayServiceImpl {
return orderPayResponse; return orderPayResponse;
} }
requestDto.setClientCode(Long.parseLong(clientCode)); requestDto.setClientCode(Long.parseLong(clientCode));
com.freemud.application.sdk.api.base.BaseResponse<UnifiedPayResponseDto> response = paymentNewClient.unifiedOrder(requestDto); // com.freemud.application.sdk.api.base.BaseResponse<UnifiedPayResponseDto> response = paymentNewClient.unifiedOrder(requestDto);
com.freemud.application.sdk.api.base.BaseResponse<UnifiedPayResponseDto> response = null;
//处理超时情况,后续冲正mq正常冲正,同支付sdk逻辑
try {
response = paymentNewClient.unifiedOrder(requestDto);
} catch (Exception e) {
AppLogUtil.errorLog("获取预支付信息异常", JSONObject.toJSONString(requestDto), null,e);
}
if (response == null || !ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(response.getCode())) {
//打印业务异常
if(response != null && printUnifiedPayResponseError){
AppLogUtil.errorLog("获取预支付信息失败", JSONObject.toJSONString(requestDto), JSONObject.toJSONString(response), null);
}
//预支付失败需要把原因进行记录
orderPayResponse.setMsg(response == null ? "unified fail" : response.getMessage());
return orderPayResponse;
}
putDelMq(request.getPartnerId(), request.getStoreId(), response.getData().getFmId(), orderBean.getOid(), null); putDelMq(request.getPartnerId(), request.getStoreId(), response.getData().getFmId(), orderBean.getOid(), null);
this.convent2CreateOrderResponseVo(orderPayResponse,paymentRequest.getWxAppId(),response.getData()); this.convent2CreateOrderResponseVo(orderPayResponse,paymentRequest.getWxAppId(),response.getData());
orderPayResponse.setOpenId(paymentRequest.getOpenId()); orderPayResponse.setOpenId(paymentRequest.getOpenId());
......
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