本文整理汇总了Java中com.alipay.api.request.AlipayTradeQueryRequest.setBizModel方法的典型用法代码示例。如果您正苦于以下问题:Java AlipayTradeQueryRequest.setBizModel方法的具体用法?Java AlipayTradeQueryRequest.setBizModel怎么用?Java AlipayTradeQueryRequest.setBizModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alipay.api.request.AlipayTradeQueryRequest
的用法示例。
在下文中一共展示了AlipayTradeQueryRequest.setBizModel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: searchTreade
import com.alipay.api.request.AlipayTradeQueryRequest; //导入方法依赖的package包/类
public static Map<?, ?> searchTreade(String outTradeNo, String tradeNo) {
// 实例化客户端
AlipayClient alipayClient = AliPayConfig.build().getAlipayClient();
// 实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
AlipayTradeQueryModel model = new AlipayTradeQueryModel();
model.setOutTradeNo(outTradeNo);
model.setTradeNo(tradeNo);
request.setBizModel(model);
Map<String, Object> result = InstanceUtil.newHashMap();
try {
AlipayTradeQueryResponse response = alipayClient.execute(request);
if (!response.isSuccess()) {
result.put("trade_state_desc", response.getSubMsg());
result.put("trade_state", "0");
} else {
Map<?, ?> body = JSON.parseObject(response.getBody(), Map.class);
Map<?, ?> resultMap = JSON.parseObject(body.get("alipay_trade_query_response").toString());
Object trade_status = resultMap.get("trade_status");
if ("TRADE_SUCCESS".equals(trade_status) || "TRADE_FINISHED".equals(trade_status)) {
Date date = DateUtil.stringToDate((String)resultMap.get("send_pay_date"));
result.put("time_end", date);
result.put("trade_no", resultMap.get("trade_no"));
result.put("trade_state", "1");
} else {
result.put("trade_state_desc", resultMap.get("msg"));
result.put("trade_state", "2");
}
}
} catch (AlipayApiException e) {
logger.error("", e);
result.put("trade_state_desc", e.getMessage());
result.put("trade_state", "0");
}
return result;
}
示例2: queryOrder
import com.alipay.api.request.AlipayTradeQueryRequest; //导入方法依赖的package包/类
@Override
public AlipayTradeQueryResponse queryOrder(String outTradeNo) throws AlipayApiException {
AlipayTradeQueryModel model = new AlipayTradeQueryModel();
model.setOutTradeNo(outTradeNo);
AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
request.setBizModel(model);
return alipayClient.execute(request);
}
示例3: tradeQuery
import com.alipay.api.request.AlipayTradeQueryRequest; //导入方法依赖的package包/类
public static AlipayTradeQueryResponse tradeQuery(AlipayTradeQueryModel model) throws AlipayApiException {
AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
request.setBizModel(model);
return AliPayConfig.build().getAlipayClient().execute(request);
}
示例4: tradeQuery
import com.alipay.api.request.AlipayTradeQueryRequest; //导入方法依赖的package包/类
public static AlipayTradeQueryResponse tradeQuery(AlipayTradeQueryModel model) throws AlipayApiException {
AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
request.setBizModel(model);
return AliPayConfig.build().getAlipayClient().execute(request);
}
示例5: tradeQueryToResponse
import com.alipay.api.request.AlipayTradeQueryRequest; //导入方法依赖的package包/类
/**
* 交易查询接口
* @param model
* @return {AlipayTradeQueryResponse}
* @throws {AlipayApiException}
*/
public static AlipayTradeQueryResponse tradeQueryToResponse(AlipayTradeQueryModel model) throws AlipayApiException{
AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
request.setBizModel(model);
return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
}