根据tradeNumber查询退款记录
@param tradeNumber
@return
505888
public RefundQuery refundQueryByTradeNumber(String tradeNumber) {
        RefundQueryRequestWrapper refundQueryRequestWrapper = new RefundQueryRequestWrapper();
        refundQueryRequestWrapper.setTradeNumber(tradeNumber);
        return refundQuery(refundQueryRequestWrapper);
    }
1369789
public static Trade adaptTrade(WexTrade bTCETrade, CurrencyPair currencyPair) {

    OrderType orderType =
        bTCETrade.getTradeType().equalsIgnoreCase("bid") ? OrderType.BID : OrderType.ASK;
    BigDecimal amount = bTCETrade.getAmount();
    BigDecimal price = bTCETrade.getPrice();
    Date date = DateUtils.fromMillisUtc(bTCETrade.getDate() * 1000L);

    final String tradeId = String.valueOf(bTCETrade.getTid());
    return new Trade(orderType, amount, currencyPair, price, date, tradeId);
  }
1288864
def _set_market_trade_type(self, ttype):
        """"""
        selects = self._main.child_window(
            control_id=self._config.TRADE_MARKET_TYPE_CONTROL_ID,
            class_name="ComboBox",
        )
        for i, text in selects.texts():
            # skip 0 index, because 0 index is current select index
            if i == 0:
                continue
            if ttype in text:
                selects.select(i - 1)
                break
        else:
            raise TypeError("不支持对应的市价类型: {}".format(ttype))
845072
public OkCoinTrade[] getTrades(CurrencyPair currencyPair, Long since) throws IOException {
    return okCoin.getTrades("1", OkCoinAdapters.adaptSymbol(currencyPair), since);
  }
129076
@RequestMapping("/submit")
    @ResponseBody
    public Boolean submit(
            @RequestParam("batchNo") String batchNo,
            @RequestParam("tradeNo") String tradeNo){
        RefundDetail detail = new RefundDetail();
        detail.setBatchNo(Dates.now("yyyyMMdd") + batchNo);
        RefundDetailData data = new RefundDetailData();
        data.setTradeNo(tradeNo);
        data.setFee("0.01");
        data.setReason("订单取消");
        detail.setDetailDatas(Arrays.asList(data));
        logger.info("refund submit: {}", detail);
        return alipayService.refund(detail);
    }
1176692
@AsParameterConverter
	public Trader retrieveTrader(String name) {
		for (Trader trader : traders) {
			if (trader.getName().equals(name)) {
				return trader;
			}
		}
		return mockTradePersister().retrieveTrader(name);
	}
689078
protected Integer getInteger(Exchange exchange, Message message, String name) {
        Object value = getObject(exchange, message, name);
        if (value instanceof Integer) {
            return (Integer)value;
        } else if (value instanceof Number) {
            return Integer.valueOf(((Number)value).intValue());
        } else if (value instanceof String) {
            return Integer.valueOf(((String)value).trim());
        }
        return null;
    }
78586
private ProductDescriptor getSwapProductDescriptor(Element trade) {

		InterestRateSwapLegProductDescriptor legReceiver = null;
		InterestRateSwapLegProductDescriptor legPayer = null;

		NodeList legs = trade.getElementsByTagName("swapStream");
		for(int legIndex = 0; legIndex < legs.getLength(); legIndex++) {
			Element leg = (Element) legs.item(legIndex);

			boolean isPayer = leg.getElementsByTagName("payerPartyReference").item(0).getAttributes().getNamedItem("href").getNodeValue().equals(homePartyId);

			if(isPayer) {
				legPayer = getSwapLegProductDescriptor(leg);
			} else {
				legReceiver = getSwapLegProductDescriptor(leg);
			}
		}

		return new InterestRateSwapProductDescriptor(legReceiver, legPayer);
	}
197418
public static Trades adaptTrades(BitsoTransaction[] transactions, CurrencyPair currencyPair) {

    List<Trade> trades = new ArrayList<>();
    long lastTradeId = 0;
    for (BitsoTransaction tx : transactions) {
      Order.OrderType type;
      switch (tx.getSide()) {
        case "buy":
          type = Order.OrderType.ASK;
          break;
        case "sell":
          type = Order.OrderType.BID;
          break;
        default:
          type = null;
      }
      final long tradeId = tx.getTid();
      if (tradeId > lastTradeId) {
        lastTradeId = tradeId;
      }
      trades.add(
          new Trade(
              type,
              tx.getAmount(),
              currencyPair,
              tx.getPrice(),
              DateUtils.fromMillisUtc(tx.getDate() * 1000L),
              String.valueOf(tradeId)));
    }

    return new Trades(trades, lastTradeId, TradeSortType.SortByID);
  }
1263902
public static Trade adaptTrade(ANXTrade anxTrade) {

    OrderType orderType = adaptSide(anxTrade.getTradeType());
    BigDecimal amount = anxTrade.getAmount();
    BigDecimal price = anxTrade.getPrice();
    CurrencyPair currencyPair = adaptCurrencyPair(anxTrade.getItem(), anxTrade.getPriceCurrency());
    Date dateTime = DateUtils.fromMillisUtc(anxTrade.getTid());
    final String tradeId = String.valueOf(anxTrade.getTid());

    return new Trade(orderType, amount, currencyPair, price, dateTime, tradeId);
  }
1236176
public static UserTrades adaptTradeHistory(LakeBTCTradeResponse[] transactions) {

    List<UserTrade> trades = new ArrayList<>();
    long lastTradeId = 0;
    for (LakeBTCTradeResponse trade : transactions) {
      final OrderType orderType = trade.getType().startsWith("buy") ? OrderType.BID : OrderType.ASK;
      BigDecimal originalAmount = trade.getAmount();
      BigDecimal price = trade.getTotal().abs();
      Date timestamp = DateUtils.fromMillisUtc(trade.getAt() * 1000L);

      final String tradeId = trade.getId();
      final CurrencyPair currencyPair = CurrencyPair.BTC_CNY;
      UserTrade userTrade =
          new UserTrade(
              orderType,
              originalAmount,
              currencyPair,
              price,
              timestamp,
              tradeId,
              null,
              null,
              Currency.getInstance(currencyPair.counter.getCurrencyCode()));
      trades.add(userTrade);
    }

    return new UserTrades(trades, lastTradeId, Trades.TradeSortType.SortByTimestamp);
  }
1012518
def trade(self, trade_id, trade_price, trade_amount, trade_time):
        
        if self.status in [ORDER_STATUS.SUCCESS_PART, ORDER_STATUS.QUEUED]:
            trade_amount = int(trade_amount)
            trade_id = str(trade_id)

            if trade_amount < 1:

                self._status = ORDER_STATUS.NEXT
            else:
                if trade_id not in self.trade_id:
                    trade_price = float(trade_price)

                    trade_time = str(trade_time)

                    self.trade_id.append(trade_id)
                    self.trade_price = (
                        self.trade_price * self.trade_amount +
                        trade_price * trade_amount
                    ) / (
                        self.trade_amount + trade_amount
                    )
                    self.trade_amount += trade_amount
                    self.trade_time.append(trade_time)
                    self.callback(
                        self.code,
                        trade_id,
                        self.order_id,
                        self.realorder_id,
                        trade_price,
                        trade_amount,
                        self.towards,
                        trade_time
                    )
                else:
                    pass
        else:
            raise RuntimeError(
                'ORDER STATUS {} CANNNOT TRADE'.format(self.status)
            )
410010
public static AlipayTradePayResponse tradePayToResponse(AlipayTradePayModel model, String notifyUrl)
			throws AlipayApiException {
		AlipayTradePayRequest request = new AlipayTradePayRequest();
		request.setBizModel(model);// 填充业务参数
		request.setNotifyUrl(notifyUrl);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
296186
public static FastMoney of(Number number, String currencyCode) {
        CurrencyUnit currency = Monetary.getCurrency(currencyCode);
        return of(number, currency);
    }
852517
@SuppressWarnings("unchecked")
  public static <E extends Enum<E> & NumberedValue> Option<E> valueOf(final Class<E> type, int number) {
    checkNotNull(type);
    E value = (E) mappings.getUnchecked(type).get(number);
    return Option.of(value);
  }
642513
@Override
  public UserTrades getTradeHistory(TradeHistoryParams p) throws IOException {
    try {
      if (p instanceof CoingiTradeHistoryParams) {
        CoingiTradeHistoryParams params = (CoingiTradeHistoryParams) p;

        CoingiGetOrderHistoryRequest request = new CoingiGetOrderHistoryRequest();

        if (params.getCurrencyPair() != null) request.setCurrencyPair(params.getCurrencyPair());

        request.setPageNumber(params.getPageNumber());
        request.setPageSize(params.getPageSize());

        if (params.getStatus() != null) request.setStatus(params.getStatus());

        if (params.getType() != null) request.setType(params.getType());

        CoingiOrdersList orderList = getCoingiOrderHistory(request);
        return CoingiAdapters.adaptTradeHistory(orderList);
      }

      return null;
    } catch (CoingiException e) {
      throw CoingiErrorAdapter.adapt(e);
    }
  }
991544
public Reflecter<T> autoExchange() {
	    if (!this.autoExchangeAdd) {
	        exchange(Funcs.TO_BOOLEAN, booleanD);
	        exchange(Funcs.TO_BYTE, byteD);
	        exchange(Funcs.TO_DOUBLE, doubleD);
	        exchange(Funcs.TO_FLOAT, floatD);
	        exchange(Funcs.TO_INTEGER, integerD);
	        exchange(Funcs.TO_LONG, longD);
	        exchange(Funcs.TO_SHORT, shortD);
	        exchange(Funcs.TO_DATE, dateD);
	        exchange(Funcs.TO_CHARACTER, characterD);
	        exchange(Funcs.TO_STRING, stringD);
	        exchange(Funcs.TO_BIGDECIMAL, bigDecimalD);
	        exchange(Funcs.TO_BIGINTEGER, bigIntegerD);
	        this.autoExchangeAdd = true;
	    }
	    
	    this.autoExchange = Boolean.TRUE;
	    return this;
	}