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;
}
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;
}
Aggregations