app支付
@param request 支付请求对象
@return AppPayResponse对象，或抛WepayException
184931
public AppPayResponse appPay(PayRequest request){
        checkPayParams(request);
        Map<String, Object> respData = doAppPay(request, TradeType.APP);
        return buildAppPayResp(respData);
    }
477008
public static ProcessRetrieveResponse checkRequestParameter(
			HttpServletRequest request, ServletContext context) {
		ProcessRetrieveResponse response = new ProcessRetrieveResponse(context);
		Integer numItems = checkNumItems(request, response);
		String term = checkTerm(request, response);
		if (term == null) {
			return response;
		}
		SuggestTree index = checkIndexName(request, response, context);
		if (index == null) {
			response.addError(RetrieveStatusCodes.NO_INDEX_AVAILABLE);
			return response;
		}
		retrieveSuggestions(request, response, index, term, numItems);
		return response;
	}
1024398
public ClientTransaction sendRequest(Request request) throws SipException, TransactionUnavailableException {
		ensureCorrectDialogLocalTag(request);
		final ClientTransactionWrapper ctw = ra.getProviderWrapper().getNewDialogActivityClientTransaction(this,request);
		if (request.getMethod().equals(Request.INVITE))
			lastCancelableTransactionId = ctw.getActivityHandle();
		if (tracer.isInfoEnabled()) {
			tracer.info(String.valueOf(ctw)+" sending request:\n"+request);
		}
		wrappedDialog.sendRequest(ctw.getWrappedClientTransaction());				
		return ctw;
	}
885061
public QrPayResponse qrPay(QrPayRequest request, Boolean convert){

        checkPayParams(request);

        Map<String, Object> respData = doQrPay(request, TradeType.NATIVE);

        String codeUrl = String.valueOf(respData.get(WepayField.CODE_URL));
        if (convert){
            try {
                codeUrl = LIANTU_URL + URLEncoder.encode(codeUrl, "UTF-8");
            } catch (UnsupportedEncodingException e) {
                throw new WepayException(e);
            }
        }

        String prepayId = String.valueOf(respData.get(WepayField.PREPAY_ID));

        QrPayResponse resp = new QrPayResponse();
        resp.setCodeUrl(codeUrl);
        resp.setPrepayId(prepayId);

        return resp;
    }
309235
public static String getAppURL(HttpServletRequest request) {
		StringBuffer url = new StringBuffer();
		int port = request.getServerPort();
		if (port < 0) {
			port = 80; // Work around java.net.URL bug
		}
		String scheme = request.getScheme();
		url.append(scheme);
		url.append("://");
		url.append(request.getServerName());
		if ((scheme.equals("http") && (port != 80)) || (scheme.equals("https") && (port != 443))) {
			url.append(':');
			url.append(port);
		}
		return url.toString();
	}
34660
public static GlobalApp getGlobalApp( HttpServletRequest request )
    {
        SharedFlowController sf = getSharedFlow( InternalConstants.GLOBALAPP_CLASSNAME, request );
        return sf instanceof GlobalApp ? ( GlobalApp ) sf : null;
    }
1118001
private Map<String, String> buildApplyParams(RefundApplyRequest request) {
        Map<String, String> refundParams = new TreeMap<>();

        // 配置参数
        buildConfigParams(refundParams);

        // 业务参数
        putIfNotEmpty(refundParams, WepayField.TRANSACTION_ID, request.getTransactionId());
        putIfNotEmpty(refundParams, WepayField.OUT_TRADE_NO, request.getOutTradeNo());
        put(refundParams, WepayField.OUT_REFUND_NO, request.getOutRefundNo());
        put(refundParams, WepayField.TOTAL_FEE, request.getTotalFee() + "");
        put(refundParams, WepayField.REFUND_FEE, request.getRefundFee() + "");
        put(refundParams, WepayField.NONCE_STR, RandomStrs.generate(16));
        put(refundParams, WepayField.OP_USER_ID, request.getOpUserId());
        putIfNotEmpty(refundParams, WepayField.DEVICE_INFO, request.getDeviceInfo());
        if (request.getRefundFeeType() != null){
            put(refundParams, WepayField.REFUND_FEE_TYPE, request.getRefundFeeType().type());
        }

        // 签名参数
        buildSignParams(refundParams);

        return refundParams;
    }
877872
@Override
	public void serviceRequest(final Request request) {

		// Get expected step count
		UIContext uic = UIContextHolder.getCurrent();
		int expected = uic.getEnvironment().getStep();

		// Get step count from the request
		int got = StepCountUtil.getRequestStep(request);

		// Match (first time, both are zero)
		// or no Step count and processing a GET
		if (expected == got || (!StepCountUtil.isStepOnRequest(request) && "GET".equals(request.
				getMethod()))) {
			// Process Service Request
			getBackingComponent().serviceRequest(request);
		} else { // Invalid step
			LOG.warn(
					"SERVER: Wrong step detected. Expected step " + expected + " but got step " + got);

			// Redirect to error page
			if (StepCountUtil.isErrorRedirect()) {
				String url = StepCountUtil.getErrorUrl();
				LOG.warn("User will be redirected to an error page. URL: " + url);
				try {
					getResponse().sendRedirect(url);
				} catch (IOException e) {
					LOG.warn("Error trying to redirect for wrong step indicator.");
				}

				// Make sure the render phase is not processed
				throw new ActionEscape();
			} else {  // Warp to the future
				// Call handle step error
				WComponent application = getUI();
				if (application instanceof WApplication) {
					LOG.warn("The handleStepError method will be called on WApplication.");
					((WApplication) application).handleStepError();
				}

				LOG.warn("The render phase will warp the user back to the future.");
			}
		}
	}
870117
public RequestCtx makeRequestCtx(String request)
            throws MelcoeXacmlException {
        RequestCtx reqCtx = null;
        try {
            ByteArrayInputStream is =
                    new ByteArrayInputStream(request.getBytes());
            reqCtx = BasicRequestCtx.getInstance(is);
        } catch (ParsingException pe) {
            throw new MelcoeXacmlException("Error parsing response.", pe);
        }
        return reqCtx;
    }
960932
public GetAppStreamResponse queryAppStream(String app, String stream) {
        GetAppStreamRequest request = new GetAppStreamRequest();
        request.setApp(app);
        request.setStream(stream);
        return queryAppStream(request);
    }
607301
public static PaymentSession parsePaymentRequest(Protos.PaymentRequest paymentRequest)
            throws PaymentProtocolException {
        return new PaymentSession(paymentRequest, false, null);
    }
983965
public <T> T execute(String token, WePayRequest<T> req) throws IOException, WePayException {

		String uri = currentUrl + req.getEndpoint();

		String postJson = MAPPER.writeValueAsString(req);

		if (log.isTraceEnabled()) {
			log.trace("request to {}:  {}", uri, postJson);
		}

		// Use the data provider to get an input stream response. This is faked out in tests.
		InputStream is = dataProvider.getData(uri, postJson, token);

		JsonNode resp;
		if (log.isTraceEnabled()) {
			String results = IOUtils.toString(is);
			log.trace("response: " + results);
			resp = MAPPER.readTree(results);
		} else {
			resp = MAPPER.readTree(is);
		}

		// if there is an error in the response from wepay, it'll get thrown in this call.
		this.checkForError(resp);

		// This is a little bit of black magic with jackson.  We know that any request passed extends
		// the abstract WePayRequest and de-genericizes it.  This means the concrete class has full
		// generic type information, and we can use this to determine what type to deserialize.  The
		// trickiest case is WePayAccountFindRequest, whose response type is List<AccountWithUri>.
		ParameterizedType paramType = (ParameterizedType)req.getClass().getGenericSuperclass();
		JavaType type = MAPPER.constructType(paramType.getActualTypeArguments()[0]);

		return MAPPER.readValue(MAPPER.treeAsTokens(resp), type);
	}
694657
public void service(ConnectionProtocol request)
  {
    RequestBaratine req = (RequestBaratine) request;
    
    Thread thread = Thread.currentThread();
    ClassLoader oldLoader = thread.getContextClassLoader();
    
    try {
      if (_webApp != null) {
        thread.setContextClassLoader(_webApp.classLoader());
      }
      
      for (RouteBaratine route : _routes) {
        if (route.service(req)) {
          return;
        }
      }
      
      if (_routes.length > 0) {
        req.halt(HttpStatus.METHOD_NOT_ALLOWED);
      }
      else {
        req.halt(HttpStatus.NOT_FOUND);
        
      }
    } finally {
      thread.setContextClassLoader(oldLoader);
    }
  }
649683
function request (app) {
  app = app || blueprint.app.server.express;
  return supertest (app);
}
547249
@Override
  public Response doRequest(final StitchRequest stitchReq) {
    initAppMetadata(clientAppId);

    return super.doRequestUrl(stitchReq, getHostname());
  }
1329367
public static int getPage(final HttpServletRequest request) {
        int ret = 1;
        final String p = request.getParameter("p");
        if (Strings.isNumeric(p)) {
            try {
                ret = Integer.parseInt(p);
            } catch (final Exception e) {
                // ignored
            }
        }

        if (1 > ret) {
            ret = 1;
        }

        return ret;
    }
423618
public static AlipayTradeFastpayRefundQueryResponse tradeRefundQueryToResponse(
			AlipayTradeFastpayRefundQueryModel model) throws AlipayApiException {
		AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}