com.alipay.api.internal.util.RequestParametersHolder Java Examples
The following examples show how to use
com.alipay.api.internal.util.RequestParametersHolder.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractAlipayClient.java From alipay-sdk-java-all with Apache License 2.0 | 6 votes |
/** * 获取POST请求的base url * * @param requestHolder * @return * @throws AlipayApiException */ private String getRequestUrl(RequestParametersHolder requestHolder) throws AlipayApiException { StringBuilder urlSb = new StringBuilder(serverUrl); try { String sysMustQuery = WebUtils.buildQuery(loadTest ? LoadTestUtil.getParamsWithLoadTestFlag(requestHolder.getProtocalMustParams()) : requestHolder.getProtocalMustParams(), charset); String sysOptQuery = WebUtils.buildQuery(requestHolder.getProtocalOptParams(), charset); urlSb.append("?"); urlSb.append(sysMustQuery); if (sysOptQuery != null && sysOptQuery.length() > 0) { urlSb.append("&"); urlSb.append(sysOptQuery); } } catch (IOException e) { throw new AlipayApiException(e); } return urlSb.toString(); }
Example #2
Source File: DefaultAlipayClient.java From alipay-sdk with Apache License 2.0 | 6 votes |
/** * 获取POST请求的base url * * @param requestHolder * @return * @throws AlipayApiException */ private String getRequestUrl(RequestParametersHolder requestHolder) throws AlipayApiException { StringBuffer urlSb = new StringBuffer(serverUrl); try { String sysMustQuery = WebUtils.buildQuery(requestHolder.getProtocalMustParams(), charset); String sysOptQuery = WebUtils.buildQuery(requestHolder.getProtocalOptParams(), charset); urlSb.append("?"); urlSb.append(sysMustQuery); if (sysOptQuery != null & sysOptQuery.length() > 0) { urlSb.append("&"); urlSb.append(sysOptQuery); } } catch (IOException e) { throw new AlipayApiException(e); } return urlSb.toString(); }
Example #3
Source File: DefaultAlipayClient.java From pay with Apache License 2.0 | 6 votes |
/** * 获取POST请求的base url * * @param requestHolder * @return * @throws AlipayApiException */ private String getRequestUrl(RequestParametersHolder requestHolder) throws AlipayApiException { StringBuffer urlSb = new StringBuffer(serverUrl); try { String sysMustQuery = WebUtils.buildQuery(requestHolder.getProtocalMustParams(), charset); String sysOptQuery = WebUtils.buildQuery(requestHolder.getProtocalOptParams(), charset); urlSb.append("?"); urlSb.append(sysMustQuery); if (sysOptQuery != null & sysOptQuery.length() > 0) { urlSb.append("&"); urlSb.append(sysOptQuery); } } catch (IOException e) { throw new AlipayApiException(e); } return urlSb.toString(); }
Example #4
Source File: DefaultAlipayClient.java From pay with Apache License 2.0 | 6 votes |
/** * GET模式下获取跳转链接 * * @param requestHolder * @return * @throws AlipayApiException */ private String getRedirectUrl(RequestParametersHolder requestHolder) throws AlipayApiException { StringBuffer urlSb = new StringBuffer(serverUrl); try { Map<String, String> sortedMap = AlipaySignature.getSortedMap(requestHolder); String sortedQuery = WebUtils.buildQuery(sortedMap, charset); String sign = requestHolder.getProtocalMustParams().get(AlipayConstants.SIGN); urlSb.append("?"); urlSb.append(sortedQuery); if (sign != null & sign.length() > 0) { Map<String, String> signMap = new HashMap<String, String>(); signMap.put(AlipayConstants.SIGN, sign); String signQuery = WebUtils.buildQuery(signMap, charset); urlSb.append("&"); urlSb.append(signQuery); } } catch (IOException e) { throw new AlipayApiException(e); } return urlSb.toString(); }
Example #5
Source File: AbstractAlipayClient.java From alipay-sdk-java-all with Apache License 2.0 | 5 votes |
/** * @param request * @return * @throws AlipayApiException */ private Map<String, Object> doPost(BatchAlipayRequest request) throws AlipayApiException { Map<String, Object> result = new HashMap<String, Object>(); RequestParametersHolder requestHolder = getRequestHolderWithSign(request); String url = getRequestUrl(requestHolder); // 打印完整请求报文 if (AlipayLogger.isBizDebugEnabled()) { AlipayLogger.logBizDebug(getRedirectUrl(requestHolder)); } result.put("prepareTime", System.currentTimeMillis()); String rsp = null; try { rsp = WebUtils.doPost(url, requestHolder.getApplicationParams(), charset, connectTimeout, readTimeout, proxyHost, proxyPort); } catch (IOException e) { throw new AlipayApiException(e); } result.put("requestTime", System.currentTimeMillis()); result.put("rsp", rsp); result.put("textParams", requestHolder.getApplicationParams()); result.put("protocalMustParams", requestHolder.getProtocalMustParams()); result.put("protocalOptParams", requestHolder.getProtocalOptParams()); result.put("url", url); return result; }
Example #6
Source File: AbstractAlipayClient.java From alipay-sdk-java-all with Apache License 2.0 | 5 votes |
/** * GET模式下获取跳转链接 * * @param requestHolder * @return * @throws AlipayApiException */ private String getRedirectUrl(RequestParametersHolder requestHolder) throws AlipayApiException { StringBuilder urlSb = new StringBuilder(serverUrl); try { Map<String, String> sortedMap = AlipaySignature.getSortedMap(requestHolder); String sortedQuery = WebUtils.buildQuery(loadTest ? LoadTestUtil.getParamsWithLoadTestFlag(sortedMap) : sortedMap, charset); urlSb.append("?"); urlSb.append(sortedQuery); } catch (IOException e) { throw new AlipayApiException(e); } return urlSb.toString(); }
Example #7
Source File: AbstractAlipayClient.java From alipay-sdk-java-all with Apache License 2.0 | 5 votes |
/** * 拼装sdk调用时所传参数 * * @param requestHolder * @return * @throws AlipayApiException */ private String getSdkParams(RequestParametersHolder requestHolder) throws AlipayApiException { StringBuilder urlSb = new StringBuilder(); try { Map<String, String> sortedMap = AlipaySignature.getSortedMap(requestHolder); String sortedQuery = WebUtils.buildQuery(loadTest ? LoadTestUtil.getParamsWithLoadTestFlag(sortedMap) : sortedMap, charset); urlSb.append(sortedQuery); } catch (IOException e) { throw new AlipayApiException(e); } return urlSb.toString(); }
Example #8
Source File: DefaultAlipayClient.java From alipay-sdk with Apache License 2.0 | 5 votes |
/** * GET模式下获取跳转链接 * * @param requestHolder * @return * @throws AlipayApiException */ private String getRedirectUrl(RequestParametersHolder requestHolder) throws AlipayApiException { StringBuffer urlSb = new StringBuffer(serverUrl); try { Map<String, String> sortedMap = AlipaySignature.getSortedMap(requestHolder); String sortedQuery = WebUtils.buildQuery(sortedMap, charset); urlSb.append("?"); urlSb.append(sortedQuery); } catch (IOException e) { throw new AlipayApiException(e); } return urlSb.toString(); }
Example #9
Source File: DefaultAlipayClient.java From alipay-sdk with Apache License 2.0 | 5 votes |
/** * 拼装sdk调用时所传参数 * * @param requestHolder * @return * @throws AlipayApiException */ private String getSdkParams(RequestParametersHolder requestHolder) throws AlipayApiException { StringBuffer urlSb = new StringBuffer(); try { Map<String, String> sortedMap = AlipaySignature.getSortedMap(requestHolder); String sortedQuery = WebUtils.buildQuery(sortedMap, charset); urlSb.append(sortedQuery); } catch (IOException e) { throw new AlipayApiException(e); } return urlSb.toString(); }
Example #10
Source File: DefaultAlipayClient.java From alipay-sdk with Apache License 2.0 | 5 votes |
/** * * * @param request * @param accessToken * @param appAuthToken * @return * @throws AlipayApiException */ private <T extends AlipayResponse> Map<String, Object> doPost(AlipayRequest<T> request, String accessToken, String appAuthToken) throws AlipayApiException { Map<String, Object> result = new HashMap<String, Object>(); RequestParametersHolder requestHolder = getRequestHolderWithSign(request, accessToken, appAuthToken); String url = getRequestUrl(requestHolder); // 打印完整请求报文 if (AlipayLogger.isBizDebugEnabled()) { AlipayLogger.logBizDebug(getRedirectUrl(requestHolder)); } String rsp = null; try { if (request instanceof AlipayUploadRequest) { AlipayUploadRequest<T> uRequest = (AlipayUploadRequest<T>) request; Map<String, FileItem> fileParams = AlipayUtils.cleanupMap(uRequest.getFileParams()); rsp = WebUtils.doPost(url, requestHolder.getApplicationParams(), fileParams, charset, connectTimeout, readTimeout, proxyHost, proxyPort); } else { rsp = WebUtils.doPost(url, requestHolder.getApplicationParams(), charset, connectTimeout, readTimeout, proxyHost, proxyPort); } } catch (IOException e) { throw new AlipayApiException(e); } result.put("rsp", rsp); result.put("textParams", requestHolder.getApplicationParams()); result.put("protocalMustParams", requestHolder.getProtocalMustParams()); result.put("protocalOptParams", requestHolder.getProtocalOptParams()); result.put("url", url); return result; }
Example #11
Source File: DefaultAlipayClient.java From pay with Apache License 2.0 | 5 votes |
/** * 拼装sdk调用时所传参数 * * @param requestHolder * @return * @throws AlipayApiException */ private String getSdkParams(RequestParametersHolder requestHolder) throws AlipayApiException { StringBuffer urlSb = new StringBuffer(); try { Map<String, String> sortedMap = AlipaySignature.getSortedMap(requestHolder); String sortedQuery = WebUtils.buildQuery(sortedMap, charset); urlSb.append(sortedQuery); } catch (IOException e) { throw new AlipayApiException(e); } return urlSb.toString(); }
Example #12
Source File: DefaultAlipayClient.java From pay with Apache License 2.0 | 5 votes |
/** * * * @param request * @param accessToken * @param signType * @return * @throws AlipayApiException */ private <T extends AlipayResponse> Map<String, Object> doPost(AlipayRequest<T> request, String accessToken, String appAuthToken) throws AlipayApiException { Map<String, Object> result = new HashMap<String, Object>(); RequestParametersHolder requestHolder = getRequestHolderWithSign(request, accessToken, appAuthToken); String url = getRequestUrl(requestHolder); // 打印完整请求报文 if (AlipayLogger.isBizDebugEnabled()) { AlipayLogger.logBizDebug(getRedirectUrl(requestHolder)); } String rsp = null; try { if (request instanceof AlipayUploadRequest) { AlipayUploadRequest<T> uRequest = (AlipayUploadRequest<T>) request; Map<String, FileItem> fileParams = AlipayUtils.cleanupMap(uRequest.getFileParams()); rsp = WebUtils.doPost(url, requestHolder.getApplicationParams(), fileParams, charset, connectTimeout, readTimeout); } else { rsp = WebUtils.doPost(url, requestHolder.getApplicationParams(), charset, connectTimeout, readTimeout); } } catch (IOException e) { throw new AlipayApiException(e); } result.put("rsp", rsp); result.put("textParams", requestHolder.getApplicationParams()); result.put("protocalMustParams", requestHolder.getProtocalMustParams()); result.put("protocalOptParams", requestHolder.getProtocalOptParams()); result.put("url", url); return result; }