统一收单线下交易查询

名称:alipay.trade.query
类型:服务端接口
功能:通过该接口可以查询单笔明细的详细信息。


注意:接口为通用接口,该场景下,请参考如下编写:

/**
 * 
 *测试预授权交易查询
 */
@Test
public void testTradeQuery() throws Exception {
    AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do","app_id","your private_key","json","GBK","alipay_public_key","RSA2");
    AlipayTradeQueryModel model = new AlipayTradeQueryModel();
    model.setOutTradeNo("tradePay000002");
    AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
    request.setBizModel(model);
    AlipayTradeQueryResponse response = alipayClient.execute(request);
    logger.info("response: {}"+ response.getBody());
}


入参TIPS:

1、outTradeNo为授权转支付时传入的outTradeNo


出参处理:

1、如果查询返回处理中(如:trade_ status=WAIT_BUYER_PAY或ORDER SUCCESS PAY INPROGRESS),商户可以调用预授权转支付,重新发起扣款(注意:商户订单号out_trade_no保持不变)

onlineServer