Search in sources :

Example 1 with AlipayTradeQueryResponse

use of com.alipay.api.response.AlipayTradeQueryResponse in project leopard by tanhaichao.

the class AlipayClientImpl method queryOrderForStatus.

@Override
public AlipayOrderTradeStatus queryOrderForStatus(String outTradeNo) throws AlipayApiException {
    AlipayTradeQueryResponse response = this.queryOrder(outTradeNo);
    String tradeStatus = response.getTradeStatus();
    if ("WAIT_BUYER_PAY".equals(tradeStatus)) {
        return AlipayOrderTradeStatus.USERPAYING;
    } else if ("TRADE_SUCCESS".equals(tradeStatus)) {
        return AlipayOrderTradeStatus.SUCCESS;
    }
    logger.error("tradeStatus:" + tradeStatus);
    return AlipayOrderTradeStatus.PAYERROR;
}
Also used : AlipayTradeQueryResponse(com.alipay.api.response.AlipayTradeQueryResponse)

Example 2 with AlipayTradeQueryResponse

use of com.alipay.api.response.AlipayTradeQueryResponse in project synergic-developing by zeemood.

the class AlipayAssistant method orderStatusQuery.

/**
 * 订单状态查询
 *
 * @param out_trade_no
 * @return
 * @throws Exception
 */
public static String orderStatusQuery(String out_trade_no) throws Exception {
    AlipayClient alipayClient = new // 支付地址
    DefaultAlipayClient(// 支付地址
    AlipayConfigurations.GATE_URL, // 应用id
    AlipayConfigurations.getAppid(), // 私钥
    AlipayConfigurations.getPrivateKey(), // 固定值json,参数类型,
    AlipayConstants.FORMAT_JSON, // 编码方式
    AlipayConstants.CHARSET_UTF8, // 公钥
    AlipayConfigurations.getPublicKey(), AlipayConstants.SIGN_TYPE_RSA2);
    AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
    AlipayTradeQueryModel model = new AlipayTradeQueryModel();
    model.setOutTradeNo(out_trade_no);
    AlipayTradeQueryResponse response = alipayClient.execute(request);
    String tradeStatus = response.getTradeStatus();
    return tradeStatus;
}
Also used : AlipayTradeQueryResponse(com.alipay.api.response.AlipayTradeQueryResponse) DefaultAlipayClient(com.alipay.api.DefaultAlipayClient) AlipayClient(com.alipay.api.AlipayClient) DefaultAlipayClient(com.alipay.api.DefaultAlipayClient)

Aggregations

AlipayTradeQueryResponse (com.alipay.api.response.AlipayTradeQueryResponse)2 AlipayClient (com.alipay.api.AlipayClient)1 DefaultAlipayClient (com.alipay.api.DefaultAlipayClient)1