com.alipay.demo.trade.model.result.AlipayF2FQueryResult Java Examples

The following examples show how to use com.alipay.demo.trade.model.result.AlipayF2FQueryResult. 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: AlipayController.java    From springboot-pay-example with Apache License 2.0 5 votes vote down vote up
/**
     * 订单查询(最主要用于查询订单的支付状态)
     * @param orderNo 商户订单号
     * @return
     */
    @GetMapping("/query")
    public String query(String orderNo){

        AlipayTradeQueryRequestBuilder builder = new AlipayTradeQueryRequestBuilder()
                .setOutTradeNo(orderNo);
        AlipayF2FQueryResult result = alipayTradeService.queryTradeResult(builder);
        switch (result.getTradeStatus()) {
            case SUCCESS:
                log.info("查询返回该订单支付成功: )");

                AlipayTradeQueryResponse resp = result.getResponse();
                log.info(resp.getTradeStatus());
//                log.info(resp.getFundBillList());
                break;

            case FAILED:
                log.error("查询返回该订单支付失败!!!");
                break;

            case UNKNOWN:
                log.error("系统异常,订单支付状态未知!!!");
                break;

            default:
                log.error("不支持的交易状态,交易返回异常!!!");
                break;
        }
        return result.getResponse().getBody();
    }
 
Example #2
Source File: Main.java    From mmall20180107 with Apache License 2.0 5 votes vote down vote up
public void test_trade_query() {
    // (必填) 商户订单号,通过此商户订单号查询当面付的交易状态
    String outTradeNo = "tradepay14817938139942440181";

    // 创建查询请求builder,设置请求参数
    AlipayTradeQueryRequestBuilder builder = new AlipayTradeQueryRequestBuilder()
            .setOutTradeNo(outTradeNo);

    AlipayF2FQueryResult result = tradeService.queryTradeResult(builder);
    switch (result.getTradeStatus()) {
        case SUCCESS:
            log.info("查询返回该订单支付成功: )");

            AlipayTradeQueryResponse response = result.getResponse();
            dumpResponse(response);

            log.info(response.getTradeStatus());
            if (Utils.isListNotEmpty(response.getFundBillList())) {
                for (TradeFundBill bill : response.getFundBillList()) {
                    log.info(bill.getFundChannel() + ":" + bill.getAmount());
                }
            }
            break;

        case FAILED:
            log.error("查询返回该订单支付失败或被关闭!!!");
            break;

        case UNKNOWN:
            log.error("系统异常,订单支付状态未知!!!");
            break;

        default:
            log.error("不支持的交易状态,交易返回异常!!!");
            break;
    }
}
 
Example #3
Source File: Main.java    From mmall-kay-Java with Apache License 2.0 5 votes vote down vote up
public void test_trade_query() {
    // (必填) 商户订单号,通过此商户订单号查询当面付的交易状态
    String outTradeNo = "tradepay14817938139942440181";

    // 创建查询请求builder,设置请求参数
    AlipayTradeQueryRequestBuilder builder = new AlipayTradeQueryRequestBuilder()
        .setOutTradeNo(outTradeNo);

    AlipayF2FQueryResult result = tradeService.queryTradeResult(builder);
    switch (result.getTradeStatus()) {
        case SUCCESS:
            log.info("查询返回该订单支付成功: )");

            AlipayTradeQueryResponse response = result.getResponse();
            dumpResponse(response);

            log.info(response.getTradeStatus());
            if (Utils.isListNotEmpty(response.getFundBillList())) {
                for (TradeFundBill bill : response.getFundBillList()) {
                    log.info(bill.getFundChannel() + ":" + bill.getAmount());
                }
            }
            break;

        case FAILED:
            log.error("查询返回该订单支付失败或被关闭!!!");
            break;

        case UNKNOWN:
            log.error("系统异常,订单支付状态未知!!!");
            break;

        default:
            log.error("不支持的交易状态,交易返回异常!!!");
            break;
    }
}
 
Example #4
Source File: Main.java    From MMall_JAVA with GNU General Public License v3.0 5 votes vote down vote up
public void test_trade_query() {
    // (必填) 商户订单号,通过此商户订单号查询当面付的交易状态
    String outTradeNo = "tradepay14817938139942440181";

    // 创建查询请求builder,设置请求参数
    AlipayTradeQueryRequestBuilder builder = new AlipayTradeQueryRequestBuilder()
        .setOutTradeNo(outTradeNo);

    AlipayF2FQueryResult result = tradeService.queryTradeResult(builder);
    switch (result.getTradeStatus()) {
        case SUCCESS:
            log.info("查询返回该订单支付成功: )");

            AlipayTradeQueryResponse response = result.getResponse();
            dumpResponse(response);

            log.info(response.getTradeStatus());
            if (Utils.isListNotEmpty(response.getFundBillList())) {
                for (TradeFundBill bill : response.getFundBillList()) {
                    log.info(bill.getFundChannel() + ":" + bill.getAmount());
                }
            }
            break;

        case FAILED:
            log.error("查询返回该订单支付失败或被关闭!!!");
            break;

        case UNKNOWN:
            log.error("系统异常,订单支付状态未知!!!");
            break;

        default:
            log.error("不支持的交易状态,交易返回异常!!!");
            break;
    }
}