mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
#178 实现查询代金券批次和信息的接口
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package com.github.binarywang.wxpay.service;
|
||||
|
||||
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponSendRequest;
|
||||
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponSendResult;
|
||||
import com.github.binarywang.wxpay.bean.coupon.*;
|
||||
import com.github.binarywang.wxpay.bean.request.*;
|
||||
import com.github.binarywang.wxpay.bean.result.*;
|
||||
import com.github.binarywang.wxpay.config.WxPayConfig;
|
||||
@@ -351,4 +350,22 @@ public interface WxPayService {
|
||||
* </pre>
|
||||
*/
|
||||
WxPayCouponSendResult sendCoupon(WxPayCouponSendRequest request) throws WxPayException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 查询代金券批次
|
||||
* 接口请求链接:https://api.mch.weixin.qq.com/mmpaymkttransfers/query_coupon_stock
|
||||
* 文档地址:https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_4
|
||||
* </pre>
|
||||
*/
|
||||
WxPayCouponStockQueryResult queryCouponStock(WxPayCouponStockQueryRequest request) throws WxPayException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 查询代金券信息
|
||||
* 接口请求链接:https://api.mch.weixin.qq.com/mmpaymkttransfers/querycouponsinfo
|
||||
* 文档地址:https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_5
|
||||
* </pre>
|
||||
*/
|
||||
WxPayCouponInfoQueryResult queryCouponInfo(WxPayCouponInfoQueryRequest request) throws WxPayException;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.github.binarywang.wxpay.service.impl;
|
||||
|
||||
import com.github.binarywang.utils.qrcode.QrcodeUtils;
|
||||
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponSendRequest;
|
||||
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponSendResult;
|
||||
import com.github.binarywang.wxpay.bean.coupon.*;
|
||||
import com.github.binarywang.wxpay.bean.request.*;
|
||||
import com.github.binarywang.wxpay.bean.result.*;
|
||||
import com.github.binarywang.wxpay.config.WxPayConfig;
|
||||
@@ -476,4 +475,26 @@ public abstract class WxPayServiceAbstractImpl implements WxPayService {
|
||||
result.checkResult(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxPayCouponStockQueryResult queryCouponStock(WxPayCouponStockQueryRequest request) throws WxPayException {
|
||||
request.checkAndSign(this.getConfig());
|
||||
|
||||
String url = this.getPayBaseUrl() + "/mmpaymkttransfers/query_coupon_stock";
|
||||
String responseContent = this.post(url, request.toXML(), false);
|
||||
WxPayCouponStockQueryResult result = WxPayBaseResult.fromXML(responseContent, WxPayCouponStockQueryResult.class);
|
||||
result.checkResult(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxPayCouponInfoQueryResult queryCouponInfo(WxPayCouponInfoQueryRequest request) throws WxPayException {
|
||||
request.checkAndSign(this.getConfig());
|
||||
|
||||
String url = this.getPayBaseUrl() + "/mmpaymkttransfers/querycouponsinfo";
|
||||
String responseContent = this.post(url, request.toXML(), false);
|
||||
WxPayCouponInfoQueryResult result = WxPayBaseResult.fromXML(responseContent, WxPayCouponInfoQueryResult.class);
|
||||
result.checkResult(this);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user