• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AlipayTradeQueryRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.alipay.api.request.AlipayTradeQueryRequest的典型用法代码示例。如果您正苦于以下问题:Java AlipayTradeQueryRequest类的具体用法?Java AlipayTradeQueryRequest怎么用?Java AlipayTradeQueryRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AlipayTradeQueryRequest类属于com.alipay.api.request包,在下文中一共展示了AlipayTradeQueryRequest类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: tradeQuery

import com.alipay.api.request.AlipayTradeQueryRequest; //导入依赖的package包/类
/**
 * 交易状态查询
 * @param query
 * @return
 */
public AlipayTradeQueryResult tradeQuery(AlipayTradeQuery query){
	AlipayTradeQueryResult result = null; 
	AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
	String json = BeanUtil.object2json(query);
	request.setBizContent(json);
	try {
		AlipayTradeQueryResponse res = client.execute(request);
		result = new AlipayTradeQueryResult(res);
	} catch (AlipayApiException e) {
		result = new AlipayTradeQueryResult();
		e.printStackTrace();
	}finally{
		log.warn("[单笔转账到支付宝账户][data:"+json+"][result:"+BeanUtil.object2json(result)+"]");
	}
	return result;
}
 
开发者ID:anylineorg,项目名称:anyline,代码行数:22,代码来源:AlipayUtil.java


示例2: 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;
}
 
开发者ID:iBase4J,项目名称:iBase4J-Common,代码行数:37,代码来源:AlipayUtil.java


示例3: queryAlipayWapPay

import com.alipay.api.request.AlipayTradeQueryRequest; //导入依赖的package包/类
private AlipayTradeQueryResponse queryAlipayWapPay(String tradeNo, PaymentAccountInfoInterface accountInfo) throws Exception {
    AlipayTradeQueryRequest queryRequest = new AlipayTradeQueryRequest();
    queryRequest.setBizContent("{" +
            "\"out_trade_no\":\"" + tradeNo + "\"" +
            "}");
   return getAlipayClient(accountInfo).execute(queryRequest);
}
 
开发者ID:superkoh,项目名称:k-framework,代码行数:8,代码来源:AlipayServiceImpl.java


示例4: 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);
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:10,代码来源:AlipayClientImpl.java


示例5: 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);
}
 
开发者ID:iBase4J,项目名称:iBase4J-Common,代码行数:6,代码来源:AliPay.java


示例6: 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);
}
 
开发者ID:guokezheng,项目名称:automat,代码行数:6,代码来源:AliPay.java


示例7: 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);
}
 
开发者ID:Javen205,项目名称:IJPay,代码行数:12,代码来源:AliPayApi.java



注:本文中的com.alipay.api.request.AlipayTradeQueryRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OWLObjectCardinalityRestriction类代码示例发布时间:2022-05-22
下一篇:
Java ProjectBuilder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap