Java Code Examples for com.alipay.api.internal.util.AlipaySignature#getSortedMap()

The following examples show how to use com.alipay.api.internal.util.AlipaySignature#getSortedMap() . 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: DefaultAlipayClient.java    From pay with Apache License 2.0 6 votes vote down vote up
/**
 * 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 2
Source File: AbstractAlipayClient.java    From alipay-sdk-java-all with Apache License 2.0 5 votes vote down vote up
/**
 * 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 3
Source File: AbstractAlipayClient.java    From alipay-sdk-java-all with Apache License 2.0 5 votes vote down vote up
/**
 * 拼装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 4
Source File: DefaultAlipayClient.java    From alipay-sdk with Apache License 2.0 5 votes vote down vote up
/**
 * 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 5
Source File: DefaultAlipayClient.java    From alipay-sdk with Apache License 2.0 5 votes vote down vote up
/**
 * 拼装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 6
Source File: DefaultAlipayClient.java    From pay with Apache License 2.0 5 votes vote down vote up
/**
 * 拼装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();
}