Java Code Examples for com.alipay.api.AlipayConstants#ERROR_RESPONSE

The following examples show how to use com.alipay.api.AlipayConstants#ERROR_RESPONSE . 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: JsonConverter.java    From alipay-sdk with Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param request
 * @param body
 * @return
 */
private String getSignSourceData(AlipayRequest<?> request, String body) {

    // 加签源串起点
    String rootNode = request.getApiMethodName().replace('.', '_')
                      + AlipayConstants.RESPONSE_SUFFIX;
    String errorRootNode = AlipayConstants.ERROR_RESPONSE;

    int indexOfRootNode = body.indexOf(rootNode);
    int indexOfErrorRoot = body.indexOf(errorRootNode);

    // 成功或者新版接口
    if (indexOfRootNode > 0) {

        return parseSignSourceData(body, rootNode, indexOfRootNode);

        // 老版本失败接口
    } else if (indexOfErrorRoot > 0) {

        return parseSignSourceData(body, errorRootNode, indexOfErrorRoot);
    } else {
        return null;
    }
}
 
Example 2
Source File: JsonConverter.java    From alipay-sdk with Apache License 2.0 6 votes vote down vote up
/**
 *  获取JSON响应加签内容串
 * 
 * @param request
 * @param body
 * @return
 */
private ResponseParseItem getJSONSignSourceData(AlipayRequest<?> request, String body) {

    String rootNode = request.getApiMethodName().replace('.', '_')
                      + AlipayConstants.RESPONSE_SUFFIX;
    String errorRootNode = AlipayConstants.ERROR_RESPONSE;

    int indexOfRootNode = body.indexOf(rootNode);
    int indexOfErrorRoot = body.indexOf(errorRootNode);

    if (indexOfRootNode > 0) {

        return parseJSONSignSourceData(body, rootNode, indexOfRootNode);

    } else if (indexOfErrorRoot > 0) {

        return parseJSONSignSourceData(body, errorRootNode, indexOfErrorRoot);
    } else {
        return null;
    }
}
 
Example 3
Source File: XmlConverter.java    From alipay-sdk with Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param request
 * @param body
 * @return
 */
private String getSignSourceData(AlipayRequest<?> request, String body) {

    // XML不同的节点
    String rootNode = request.getApiMethodName().replace('.', '_')
                      + AlipayConstants.RESPONSE_SUFFIX;
    String errorRootNode = AlipayConstants.ERROR_RESPONSE;

    int indexOfRootNode = body.indexOf(rootNode);
    int indexOfErrorRoot = body.indexOf(errorRootNode);

    // 成功或者新版接口
    if (indexOfRootNode > 0) {

        return parseSignSourceData(body, rootNode, indexOfRootNode);
        // 老版本接口
    } else if (indexOfErrorRoot > 0) {

        return parseSignSourceData(body, errorRootNode, indexOfErrorRoot);
    } else {
        return null;
    }
}
 
Example 4
Source File: XmlConverter.java    From alipay-sdk with Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param request
 * @param body
 * @return
 */
private ResponseParseItem getXMLSignSourceData(AlipayRequest<?> request, String body) {

    // XML涓�������������
    String rootNode = request.getApiMethodName().replace('.', '_')
                      + AlipayConstants.RESPONSE_SUFFIX;
    String errorRootNode = AlipayConstants.ERROR_RESPONSE;

    int indexOfRootNode = body.indexOf(rootNode);
    int indexOfErrorRoot = body.indexOf(errorRootNode);

    if (indexOfRootNode > 0) {

        return parseXMLSignSourceData(body, rootNode, indexOfRootNode);

    } else if (indexOfErrorRoot > 0) {

        return parseXMLSignSourceData(body, errorRootNode, indexOfErrorRoot);
    } else {
        return null;
    }
}
 
Example 5
Source File: JsonConverter.java    From pay with Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param request
 * @param body
 * @return
 */
private String getSignSourceData(AlipayRequest<?> request, String body) {

    // 加签源串起点
    String rootNode = request.getApiMethodName().replace('.', '_')
                      + AlipayConstants.RESPONSE_SUFFIX;
    String errorRootNode = AlipayConstants.ERROR_RESPONSE;

    int indexOfRootNode = body.indexOf(rootNode);
    int indexOfErrorRoot = body.indexOf(errorRootNode);

    // 成功或者新版接口
    if (indexOfRootNode > 0) {

        return parseSignSourceData(body, rootNode, indexOfRootNode);

        // 老版本失败接口
    } else if (indexOfErrorRoot > 0) {

        return parseSignSourceData(body, errorRootNode, indexOfErrorRoot);
    } else {
        return null;
    }
}
 
Example 6
Source File: JsonConverter.java    From pay with Apache License 2.0 6 votes vote down vote up
/**
 *  获取JSON响应加签内容串
 * 
 * @param request
 * @param body
 * @return
 */
private ResponseParseItem getJSONSignSourceData(AlipayRequest<?> request, String body) {

    String rootNode = request.getApiMethodName().replace('.', '_')
                      + AlipayConstants.RESPONSE_SUFFIX;
    String errorRootNode = AlipayConstants.ERROR_RESPONSE;

    int indexOfRootNode = body.indexOf(rootNode);
    int indexOfErrorRoot = body.indexOf(errorRootNode);

    if (indexOfRootNode > 0) {

        return parseJSONSignSourceData(body, rootNode, indexOfRootNode);

    } else if (indexOfErrorRoot > 0) {

        return parseJSONSignSourceData(body, errorRootNode, indexOfErrorRoot);
    } else {
        return null;
    }
}
 
Example 7
Source File: XmlConverter.java    From pay with Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param request
 * @param body
 * @return
 */
private String getSignSourceData(AlipayRequest<?> request, String body) {

    // XML不同的节点
    String rootNode = request.getApiMethodName().replace('.', '_')
                      + AlipayConstants.RESPONSE_SUFFIX;
    String errorRootNode = AlipayConstants.ERROR_RESPONSE;

    int indexOfRootNode = body.indexOf(rootNode);
    int indexOfErrorRoot = body.indexOf(errorRootNode);

    // 成功或者新版接口
    if (indexOfRootNode > 0) {

        return parseSignSourceData(body, rootNode, indexOfRootNode);
        // 老版本接口
    } else if (indexOfErrorRoot > 0) {

        return parseSignSourceData(body, errorRootNode, indexOfErrorRoot);
    } else {
        return null;
    }
}
 
Example 8
Source File: XmlConverter.java    From pay with Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param request
 * @param body
 * @return
 */
private ResponseParseItem getXMLSignSourceData(AlipayRequest<?> request, String body) {

    // XML涓�������������
    String rootNode = request.getApiMethodName().replace('.', '_')
                      + AlipayConstants.RESPONSE_SUFFIX;
    String errorRootNode = AlipayConstants.ERROR_RESPONSE;

    int indexOfRootNode = body.indexOf(rootNode);
    int indexOfErrorRoot = body.indexOf(errorRootNode);

    if (indexOfRootNode > 0) {

        return parseXMLSignSourceData(body, rootNode, indexOfRootNode);

    } else if (indexOfErrorRoot > 0) {

        return parseXMLSignSourceData(body, errorRootNode, indexOfErrorRoot);
    } else {
        return null;
    }
}