Ejemplo n.º 1
0
 @Override
 public TradePayPoolReverseResponse tradePayPoolReverse(TradePayPoolReverseRequest request) {
   TradePayPoolReverseResponse response =
       (TradePayPoolReverseResponse) assertExcecuteSuccess(execute(request));
   response.setOrderNo(request.getOrderNo());
   return response;
 }
Ejemplo n.º 2
0
 @Override
 public TradePayPoolReverseResponse batchTransfer(List<SubOrder> subOrders, String tradeMemo) {
   if (subOrders == null || subOrders.isEmpty()) {
     throw new OpenApiClientException("批量支付子订单不能为空");
   }
   String mainAmount = "1";
   String payerUserId = subOrders.iterator().next().getPayerUserId();
   TradePayPoolReverseResponse response = null;
   try {
     TradeCreatePoolReverseResponse responseCreate =
         tradeCreatePoolReverse(new TradeCreatePoolReverseRequest(payerUserId, mainAmount));
     TradePayPoolReverseRequest request = new TradePayPoolReverseRequest();
     request.setTradeNo(responseCreate.getTradeNo());
     request.setTradeMemo(tradeMemo);
     request.setSubOrders(subOrders);
     response = tradePayPoolReverse(request);
     tradeFinishPoolReverse(new TradeFinishPoolReverseRequest(responseCreate.getTradeNo()));
   } catch (OpenApiServiceException ose) {
     throw ose;
   } catch (Exception e) {
     throw new OpenApiClientException("批量支付交易请求失败:" + e.getMessage());
   }
   return response;
 }