coupon param fixed
This commit is contained in:
parent
e1beceb5aa
commit
69a52f09a8
@ -45,8 +45,8 @@ public class CouponApi extends MchApi {
|
|||||||
* "https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_3">发放代金券接口</a>
|
* "https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_3">发放代金券接口</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public CouponResult sendCoupon(String couponStockId, String partnerTradeNo, String openId, String opUserId)
|
public CouponResult sendCoupon(String couponStockId, String partnerTradeNo,
|
||||||
throws WeixinException {
|
String openId, String opUserId) throws WeixinException {
|
||||||
Map<String, String> map = createBaseRequestMap(null);
|
Map<String, String> map = createBaseRequestMap(null);
|
||||||
map.put("coupon_stock_id", couponStockId);
|
map.put("coupon_stock_id", couponStockId);
|
||||||
map.put("partner_trade_no", partnerTradeNo);
|
map.put("partner_trade_no", partnerTradeNo);
|
||||||
@ -62,7 +62,8 @@ public class CouponApi extends MchApi {
|
|||||||
map.put("type", "XML");
|
map.put("type", "XML");
|
||||||
map.put("sign", weixinSignature.sign(map));
|
map.put("sign", weixinSignature.sign(map));
|
||||||
String param = XmlStream.map2xml(map);
|
String param = XmlStream.map2xml(map);
|
||||||
WeixinResponse response = getWeixinSSLExecutor().post(getRequestUri("coupon_send_uri"), param);
|
WeixinResponse response = getWeixinSSLExecutor().post(
|
||||||
|
getRequestUri("coupon_send_uri"), param);
|
||||||
return response.getAsObject(new TypeReference<CouponResult>() {
|
return response.getAsObject(new TypeReference<CouponResult>() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -78,12 +79,14 @@ public class CouponApi extends MchApi {
|
|||||||
* "https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_4">查询代金券批次信息接口</a>
|
* "https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_4">查询代金券批次信息接口</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public CouponStock queryCouponStock(String couponStockId) throws WeixinException {
|
public CouponStock queryCouponStock(String couponStockId)
|
||||||
|
throws WeixinException {
|
||||||
Map<String, String> map = createBaseRequestMap(null);
|
Map<String, String> map = createBaseRequestMap(null);
|
||||||
map.put("coupon_stock_id", couponStockId);
|
map.put("coupon_stock_id", couponStockId);
|
||||||
map.put("sign", weixinSignature.sign(map));
|
map.put("sign", weixinSignature.sign(map));
|
||||||
String param = XmlStream.map2xml(map);
|
String param = XmlStream.map2xml(map);
|
||||||
WeixinResponse response = weixinExecutor.post(getRequestUri("couponstock_query_uri"), param);
|
WeixinResponse response = weixinExecutor.post(
|
||||||
|
getRequestUri("couponstock_query_uri"), param);
|
||||||
return response.getAsObject(new TypeReference<CouponStock>() {
|
return response.getAsObject(new TypeReference<CouponStock>() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -95,19 +98,24 @@ public class CouponApi extends MchApi {
|
|||||||
* 用户ID
|
* 用户ID
|
||||||
* @param couponId
|
* @param couponId
|
||||||
* 代金券ID
|
* 代金券ID
|
||||||
|
* @param stockId
|
||||||
|
* 代金劵对应的批次号
|
||||||
* @return 代金券详细信息
|
* @return 代金券详细信息
|
||||||
* @see com.foxinmy.weixin4j.payment.coupon.CouponDetail
|
* @see com.foxinmy.weixin4j.payment.coupon.CouponDetail
|
||||||
* @see <a href=
|
* @see <a href=
|
||||||
* "https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_5">查询代金券详细信息接口</a>
|
* "https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_5">查询代金券详细信息接口</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public CouponDetail queryCouponDetail(String openId, String couponId) throws WeixinException {
|
public CouponDetail queryCouponDetail(String openId, String couponId,
|
||||||
|
String stockId) throws WeixinException {
|
||||||
Map<String, String> map = createBaseRequestMap(null);
|
Map<String, String> map = createBaseRequestMap(null);
|
||||||
map.put("openid", openId);
|
map.put("openid", openId);
|
||||||
map.put("coupon_id", couponId);
|
map.put("coupon_id", couponId);
|
||||||
|
map.put("stock_id", stockId);
|
||||||
map.put("sign", weixinSignature.sign(map));
|
map.put("sign", weixinSignature.sign(map));
|
||||||
String param = XmlStream.map2xml(map);
|
String param = XmlStream.map2xml(map);
|
||||||
WeixinResponse response = weixinExecutor.post(getRequestUri("coupondetail_query_uri"), param);
|
WeixinResponse response = weixinExecutor.post(
|
||||||
|
getRequestUri("coupondetail_query_uri"), param);
|
||||||
return response.getAsObject(new TypeReference<CouponDetail>() {
|
return response.getAsObject(new TypeReference<CouponDetail>() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,7 +82,8 @@ public class WeixinPayProxy {
|
|||||||
* 微信支付接口实现(使用weixin4j.properties配置的account商户信息)
|
* 微信支付接口实现(使用weixin4j.properties配置的account商户信息)
|
||||||
*/
|
*/
|
||||||
public WeixinPayProxy() {
|
public WeixinPayProxy() {
|
||||||
this(JSON.parseObject(Weixin4jConfigUtil.getValue("account"), WeixinPayAccount.class));
|
this(JSON.parseObject(Weixin4jConfigUtil.getValue("account"),
|
||||||
|
WeixinPayAccount.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -93,7 +94,8 @@ public class WeixinPayProxy {
|
|||||||
*/
|
*/
|
||||||
public WeixinPayProxy(WeixinPayAccount weixinPayAccount) {
|
public WeixinPayProxy(WeixinPayAccount weixinPayAccount) {
|
||||||
if (weixinPayAccount == null) {
|
if (weixinPayAccount == null) {
|
||||||
throw new IllegalArgumentException("weixinPayAccount must not be empty");
|
throw new IllegalArgumentException(
|
||||||
|
"weixinPayAccount must not be empty");
|
||||||
}
|
}
|
||||||
this.weixinPayAccount = weixinPayAccount;
|
this.weixinPayAccount = weixinPayAccount;
|
||||||
this.payApi = new PayApi(weixinPayAccount);
|
this.payApi = new PayApi(weixinPayAccount);
|
||||||
@ -154,7 +156,8 @@ public class WeixinPayProxy {
|
|||||||
* @see com.foxinmy.weixin4j.payment.mch.MchPayRequest#toRequestString()
|
* @see com.foxinmy.weixin4j.payment.mch.MchPayRequest#toRequestString()
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public MchPayRequest createPayRequest(MchPayPackage payPackage) throws WeixinException {
|
public MchPayRequest createPayRequest(MchPayPackage payPackage)
|
||||||
|
throws WeixinException {
|
||||||
return payApi.createPayRequest(payPackage);
|
return payApi.createPayRequest(payPackage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,9 +184,11 @@ public class WeixinPayProxy {
|
|||||||
* @return JSAPI支付对象
|
* @return JSAPI支付对象
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public MchPayRequest createJSPayRequest(String openId, String body, String outTradeNo, double totalFee,
|
public MchPayRequest createJSPayRequest(String openId, String body,
|
||||||
String notifyUrl, String createIp, String attach) throws WeixinException {
|
String outTradeNo, double totalFee, String notifyUrl,
|
||||||
return payApi.createJSPayRequest(openId, body, outTradeNo, totalFee, notifyUrl, createIp, attach);
|
String createIp, String attach) throws WeixinException {
|
||||||
|
return payApi.createJSPayRequest(openId, body, outTradeNo, totalFee,
|
||||||
|
notifyUrl, createIp, attach);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -191,16 +196,11 @@ public class WeixinPayProxy {
|
|||||||
* 生成编辑地址请求
|
* 生成编辑地址请求
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* err_msg edit_address:ok获取编辑收货地址成功</br>
|
* err_msg edit_address:ok获取编辑收货地址成功</br> edit_address:fail获取编辑收货地址失败</br>
|
||||||
* edit_address:fail获取编辑收货地址失败</br>
|
* userName 收货人姓名</br> telNumber 收货人电话</br> addressPostalCode 邮编</br>
|
||||||
* userName 收货人姓名</br>
|
* proviceFirstStageName 国标收货地址第一级地址</br> addressCitySecondStageName
|
||||||
* telNumber 收货人电话</br>
|
* 国标收货地址第二级地址</br> addressCountiesThirdStageName 国标收货地址第三级地址</br>
|
||||||
* addressPostalCode 邮编</br>
|
* addressDetailInfo 详细收货地址信息</br> nationalCode 收货地址国家码</br>
|
||||||
* proviceFirstStageName 国标收货地址第一级地址</br>
|
|
||||||
* addressCitySecondStageName 国标收货地址第二级地址</br>
|
|
||||||
* addressCountiesThirdStageName 国标收货地址第三级地址</br>
|
|
||||||
* addressDetailInfo 详细收货地址信息</br>
|
|
||||||
* nationalCode 收货地址国家码</br>
|
|
||||||
*
|
*
|
||||||
* @param url
|
* @param url
|
||||||
* 当前访问页的URL
|
* 当前访问页的URL
|
||||||
@ -262,9 +262,11 @@ public class WeixinPayProxy {
|
|||||||
* </a>
|
* </a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public NativePayResponse createNativePayResponse(String productId, String body, String outTradeNo, double totalFee,
|
public NativePayResponse createNativePayResponse(String productId,
|
||||||
String notifyUrl, String createIp, String attach) throws WeixinException {
|
String body, String outTradeNo, double totalFee, String notifyUrl,
|
||||||
return payApi.createNativePayResponse(productId, body, outTradeNo, totalFee, notifyUrl, createIp, attach);
|
String createIp, String attach) throws WeixinException {
|
||||||
|
return payApi.createNativePayResponse(productId, body, outTradeNo,
|
||||||
|
totalFee, notifyUrl, createIp, attach);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -296,9 +298,11 @@ public class WeixinPayProxy {
|
|||||||
* </a>
|
* </a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public MchPayRequest createNativePayRequest(String productId, String body, String outTradeNo, double totalFee,
|
public MchPayRequest createNativePayRequest(String productId, String body,
|
||||||
String notifyUrl, String createIp, String attach) throws WeixinException {
|
String outTradeNo, double totalFee, String notifyUrl,
|
||||||
return payApi.createNativePayRequest(productId, body, outTradeNo, totalFee, notifyUrl, createIp, attach);
|
String createIp, String attach) throws WeixinException {
|
||||||
|
return payApi.createNativePayRequest(productId, body, outTradeNo,
|
||||||
|
totalFee, notifyUrl, createIp, attach);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -325,9 +329,11 @@ public class WeixinPayProxy {
|
|||||||
* APP支付</a>
|
* APP支付</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public MchPayRequest createAppPayRequest(String body, String outTradeNo, double totalFee, String notifyUrl,
|
public MchPayRequest createAppPayRequest(String body, String outTradeNo,
|
||||||
String createIp, String attach) throws WeixinException {
|
double totalFee, String notifyUrl, String createIp, String attach)
|
||||||
return payApi.createAppPayRequest(body, outTradeNo, totalFee, notifyUrl, createIp, attach);
|
throws WeixinException {
|
||||||
|
return payApi.createAppPayRequest(body, outTradeNo, totalFee,
|
||||||
|
notifyUrl, createIp, attach);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -354,9 +360,11 @@ public class WeixinPayProxy {
|
|||||||
* </a>
|
* </a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public MchPayRequest createWapPayRequest(String body, String outTradeNo, double totalFee, String notifyUrl,
|
public MchPayRequest createWapPayRequest(String body, String outTradeNo,
|
||||||
String createIp, String attach) throws WeixinException {
|
double totalFee, String notifyUrl, String createIp, String attach)
|
||||||
return payApi.createWapPayRequest(body, outTradeNo, totalFee, notifyUrl, createIp, attach);
|
throws WeixinException {
|
||||||
|
return payApi.createWapPayRequest(body, outTradeNo, totalFee,
|
||||||
|
notifyUrl, createIp, attach);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -384,18 +392,18 @@ public class WeixinPayProxy {
|
|||||||
* 提交被扫支付API</a>
|
* 提交被扫支付API</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public MchPayRequest createMicroPayRequest(String authCode, String body, String outTradeNo, double totalFee,
|
public MchPayRequest createMicroPayRequest(String authCode, String body,
|
||||||
String createIp, String attach) throws WeixinException {
|
String outTradeNo, double totalFee, String createIp, String attach)
|
||||||
return payApi.createMicroPayRequest(authCode, body, outTradeNo, totalFee, createIp, attach);
|
throws WeixinException {
|
||||||
|
return payApi.createMicroPayRequest(authCode, body, outTradeNo,
|
||||||
|
totalFee, createIp, attach);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单查询
|
* 订单查询
|
||||||
* <p>
|
* <p>
|
||||||
* 当商户后台、网络、服务器等出现异常,商户系统最终未接收到支付通知;</br>
|
* 当商户后台、网络、服务器等出现异常,商户系统最终未接收到支付通知;</br> 调用支付接口后,返回系统错误或未知交易状态情况;</br>
|
||||||
* 调用支付接口后,返回系统错误或未知交易状态情况;</br>
|
* 调用被扫支付API,返回USERPAYING的状态;</br> 调用关单或撤销接口API之前,需确认支付状态;
|
||||||
* 调用被扫支付API,返回USERPAYING的状态;</br>
|
|
||||||
* 调用关单或撤销接口API之前,需确认支付状态;
|
|
||||||
* </P>
|
* </P>
|
||||||
*
|
*
|
||||||
* @param idQuery
|
* @param idQuery
|
||||||
@ -450,10 +458,12 @@ public class WeixinPayProxy {
|
|||||||
* @since V3
|
* @since V3
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public RefundResult applyRefund(IdQuery idQuery, String outRefundNo, double totalFee, double refundFee,
|
public RefundResult applyRefund(IdQuery idQuery, String outRefundNo,
|
||||||
CurrencyType refundFeeType, String opUserId, RefundAccountType refundAccountType) throws WeixinException {
|
double totalFee, double refundFee, CurrencyType refundFeeType,
|
||||||
return payApi.applyRefund(idQuery, outRefundNo, totalFee, refundFee, refundFeeType, opUserId,
|
String opUserId, RefundAccountType refundAccountType)
|
||||||
refundAccountType);
|
throws WeixinException {
|
||||||
|
return payApi.applyRefund(idQuery, outRefundNo, totalFee, refundFee,
|
||||||
|
refundFeeType, opUserId, refundAccountType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -463,7 +473,8 @@ public class WeixinPayProxy {
|
|||||||
*
|
*
|
||||||
* @see {@link #applyRefund(IdQuery, String, double, double, String,CurrencyType)}
|
* @see {@link #applyRefund(IdQuery, String, double, double, String,CurrencyType)}
|
||||||
*/
|
*/
|
||||||
public RefundResult applyRefund(IdQuery idQuery, String outRefundNo, double totalFee) throws WeixinException {
|
public RefundResult applyRefund(IdQuery idQuery, String outRefundNo,
|
||||||
|
double totalFee) throws WeixinException {
|
||||||
return payApi.applyRefund(idQuery, outRefundNo, totalFee);
|
return payApi.applyRefund(idQuery, outRefundNo, totalFee);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -512,18 +523,16 @@ public class WeixinPayProxy {
|
|||||||
* 下载对账单API</a>
|
* 下载对账单API</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public void downloadBill(Date billDate, BillType billType, OutputStream outputStream, TarType tarType)
|
public void downloadBill(Date billDate, BillType billType,
|
||||||
throws WeixinException {
|
OutputStream outputStream, TarType tarType) throws WeixinException {
|
||||||
payApi.downloadBill(billDate, billType, outputStream, tarType);
|
payApi.downloadBill(billDate, billType, outputStream, tarType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 冲正订单(需要证书)</br>
|
* 冲正订单(需要证书)</br> 当支付返回失败,或收银系统超时需要取消交易,可以调用该接口</br> 接口逻辑:支
|
||||||
* 当支付返回失败,或收银系统超时需要取消交易,可以调用该接口</br>
|
* 付失败的关单,支付成功的撤销支付</br> <font color="red">7天以内的单可撤销,其他正常支付的单
|
||||||
* 接口逻辑:支 付失败的关单,支付成功的撤销支付</br>
|
* 如需实现相同功能请调用退款接口</font></br> <font
|
||||||
* <font color="red">7天以内的单可撤销,其他正常支付的单 如需实现相同功能请调用退款接口</font></br>
|
* color="red">调用扣款接口后请勿立即调用撤销,需要等待5秒以上。先调用查单接口,如果没有确切的返回,再调用撤销</font> </br>
|
||||||
* <font color="red">调用扣款接口后请勿立即调用撤销,需要等待5秒以上。先调用查单接口,如果没有确切的返回,再调用撤销</font>
|
|
||||||
* </br>
|
|
||||||
*
|
*
|
||||||
* @param idQuery
|
* @param idQuery
|
||||||
* 商户系统内部的订单号, transaction_id 、 out_trade_no 二选一,如果同时存在优先级:
|
* 商户系统内部的订单号, transaction_id 、 out_trade_no 二选一,如果同时存在优先级:
|
||||||
@ -599,9 +608,11 @@ public class WeixinPayProxy {
|
|||||||
* 接口测试上报API</a>
|
* 接口测试上报API</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public XmlResult reportInterface(String interfaceUrl, int executeTime, String outTradeNo, String ip, Date time,
|
public XmlResult reportInterface(String interfaceUrl, int executeTime,
|
||||||
XmlResult returnXml) throws WeixinException {
|
String outTradeNo, String ip, Date time, XmlResult returnXml)
|
||||||
return payApi.reportInterface(interfaceUrl, executeTime, outTradeNo, ip, time, returnXml);
|
throws WeixinException {
|
||||||
|
return payApi.reportInterface(interfaceUrl, executeTime, outTradeNo,
|
||||||
|
ip, time, returnXml);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -623,9 +634,10 @@ public class WeixinPayProxy {
|
|||||||
* 发放代金券接口</a>
|
* 发放代金券接口</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public CouponResult sendCoupon(String couponStockId, String partnerTradeNo, String openId, String opUserId)
|
public CouponResult sendCoupon(String couponStockId, String partnerTradeNo,
|
||||||
throws WeixinException {
|
String openId, String opUserId) throws WeixinException {
|
||||||
return couponApi.sendCoupon(couponStockId, partnerTradeNo, openId, opUserId);
|
return couponApi.sendCoupon(couponStockId, partnerTradeNo, openId,
|
||||||
|
opUserId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -641,7 +653,8 @@ public class WeixinPayProxy {
|
|||||||
* 查询代金券批次信息接口</a>
|
* 查询代金券批次信息接口</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public CouponStock queryCouponStock(String couponStockId) throws WeixinException {
|
public CouponStock queryCouponStock(String couponStockId)
|
||||||
|
throws WeixinException {
|
||||||
return couponApi.queryCouponStock(couponStockId);
|
return couponApi.queryCouponStock(couponStockId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -652,6 +665,8 @@ public class WeixinPayProxy {
|
|||||||
* 用户ID
|
* 用户ID
|
||||||
* @param couponId
|
* @param couponId
|
||||||
* 代金券ID
|
* 代金券ID
|
||||||
|
* @param stockId
|
||||||
|
* 代金劵对应的批次号
|
||||||
* @return 代金券详细信息
|
* @return 代金券详细信息
|
||||||
* @see com.foxinmy.weixin4j.api.CouponApi
|
* @see com.foxinmy.weixin4j.api.CouponApi
|
||||||
* @see com.foxinmy.weixin4j.payment.coupon.CouponDetail
|
* @see com.foxinmy.weixin4j.payment.coupon.CouponDetail
|
||||||
@ -660,8 +675,9 @@ public class WeixinPayProxy {
|
|||||||
* 查询代金券详细信息接口</a>
|
* 查询代金券详细信息接口</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public CouponDetail queryCouponDetail(String openId, String couponId) throws WeixinException {
|
public CouponDetail queryCouponDetail(String openId, String couponId,
|
||||||
return couponApi.queryCouponDetail(openId, couponId);
|
String stockId) throws WeixinException {
|
||||||
|
return couponApi.queryCouponDetail(openId, couponId, stockId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -681,7 +697,8 @@ public class WeixinPayProxy {
|
|||||||
* 发放裂变红包接口</a>
|
* 发放裂变红包接口</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public RedpacketSendResult sendRedpack(Redpacket redpacket) throws WeixinException {
|
public RedpacketSendResult sendRedpack(Redpacket redpacket)
|
||||||
|
throws WeixinException {
|
||||||
return cashApi.sendRedpack(redpacket);
|
return cashApi.sendRedpack(redpacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -695,7 +712,8 @@ public class WeixinPayProxy {
|
|||||||
* @see #sendRedpacks(Redpacket...)
|
* @see #sendRedpacks(Redpacket...)
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public List<Future<RedpacketSendResult>> sendRedpacks(Redpacket... redpackets) {
|
public List<Future<RedpacketSendResult>> sendRedpacks(
|
||||||
|
Redpacket... redpackets) {
|
||||||
return cashApi.sendRedpacks(redpackets);
|
return cashApi.sendRedpacks(redpackets);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -715,7 +733,8 @@ public class WeixinPayProxy {
|
|||||||
* 查询裂变红包接口</a>
|
* 查询裂变红包接口</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public RedpacketRecord queryRedpack(String outTradeNo) throws WeixinException {
|
public RedpacketRecord queryRedpack(String outTradeNo)
|
||||||
|
throws WeixinException {
|
||||||
return cashApi.queryRedpack(outTradeNo);
|
return cashApi.queryRedpack(outTradeNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -742,7 +761,8 @@ public class WeixinPayProxy {
|
|||||||
* 企业付款接口</a>
|
* 企业付款接口</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public CorpPaymentResult sendCorpPayment(CorpPayment payment) throws WeixinException {
|
public CorpPaymentResult sendCorpPayment(CorpPayment payment)
|
||||||
|
throws WeixinException {
|
||||||
return cashApi.sendCorpPayment(payment);
|
return cashApi.sendCorpPayment(payment);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -759,7 +779,8 @@ public class WeixinPayProxy {
|
|||||||
* 企业付款查询接口</a>
|
* 企业付款查询接口</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public CorpPaymentRecord queryCorpPayment(String outTradeNo) throws WeixinException {
|
public CorpPaymentRecord queryCorpPayment(String outTradeNo)
|
||||||
|
throws WeixinException {
|
||||||
return cashApi.queryCorpPayment(outTradeNo);
|
return cashApi.queryCorpPayment(outTradeNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -799,8 +820,8 @@ public class WeixinPayProxy {
|
|||||||
* "https://pay.weixin.qq.com/wiki/doc/api/external/micropay.php?chapter=9_14&index=7">
|
* "https://pay.weixin.qq.com/wiki/doc/api/external/micropay.php?chapter=9_14&index=7">
|
||||||
* 查询结算资金接口</a>
|
* 查询结算资金接口</a>
|
||||||
*/
|
*/
|
||||||
public SettlementRecord querySettlement(boolean status, Pageable pageable, Date start, Date end)
|
public SettlementRecord querySettlement(boolean status, Pageable pageable,
|
||||||
throws WeixinException {
|
Date start, Date end) throws WeixinException {
|
||||||
return cashApi.querySettlement(status, pageable, start, end);
|
return cashApi.querySettlement(status, pageable, start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -818,7 +839,8 @@ public class WeixinPayProxy {
|
|||||||
* "https://pay.weixin.qq.com/wiki/doc/api/external/micropay.php?chapter=9_15&index=8">
|
* "https://pay.weixin.qq.com/wiki/doc/api/external/micropay.php?chapter=9_15&index=8">
|
||||||
* 查询汇率接口</a>
|
* 查询汇率接口</a>
|
||||||
*/
|
*/
|
||||||
public double queryExchageRate(CurrencyType currencyType, Date date) throws WeixinException {
|
public double queryExchageRate(CurrencyType currencyType, Date date)
|
||||||
|
throws WeixinException {
|
||||||
return cashApi.queryExchageRate(currencyType, date);
|
return cashApi.queryExchageRate(currencyType, date);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -836,7 +858,8 @@ public class WeixinPayProxy {
|
|||||||
* 附加订单信息提交接口</a>
|
* 附加订单信息提交接口</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public CustomsOrderResult declareCustomsOrder(CustomsOrder customsOrder) throws WeixinException {
|
public CustomsOrderResult declareCustomsOrder(CustomsOrder customsOrder)
|
||||||
|
throws WeixinException {
|
||||||
return customsApi.declareCustomsOrder(customsOrder);
|
return customsApi.declareCustomsOrder(customsOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -855,7 +878,8 @@ public class WeixinPayProxy {
|
|||||||
* 附加订单信息查询接口</a>
|
* 附加订单信息查询接口</a>
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
*/
|
*/
|
||||||
public CustomsOrderRecord queryCustomsOrder(IdQuery idQuery, CustomsCity customsCity) throws WeixinException {
|
public CustomsOrderRecord queryCustomsOrder(IdQuery idQuery,
|
||||||
|
CustomsCity customsCity) throws WeixinException {
|
||||||
return customsApi.queryCustomsOrder(idQuery, customsCity);
|
return customsApi.queryCustomsOrder(idQuery, customsCity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,8 +25,10 @@ public class CouponTest extends PayTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void sendCoupon() throws WeixinException {
|
public void sendCoupon() throws WeixinException {
|
||||||
String partnerTradeNo = String.format("%s%s%s", ACCOUNT.getMchId(), DateUtil.fortmat2yyyyMMdd(new Date()), "1");
|
String partnerTradeNo = String.format("%s%s%s", ACCOUNT.getMchId(),
|
||||||
CouponResult result = PAY.sendCoupon("123", partnerTradeNo, "oyFLst1bqtuTcxK-ojF8hOGtLQao", null);
|
DateUtil.fortmat2yyyyMMdd(new Date()), "1");
|
||||||
|
CouponResult result = PAY.sendCoupon("123", partnerTradeNo,
|
||||||
|
"oyFLst1bqtuTcxK-ojF8hOGtLQao", null);
|
||||||
Assert.assertEquals(Consts.SUCCESS, result.getReturnCode());
|
Assert.assertEquals(Consts.SUCCESS, result.getReturnCode());
|
||||||
Assert.assertEquals(Consts.SUCCESS, result.getResultCode());
|
Assert.assertEquals(Consts.SUCCESS, result.getResultCode());
|
||||||
System.err.println(result);
|
System.err.println(result);
|
||||||
@ -42,7 +44,8 @@ public class CouponTest extends PayTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void queryCouponDetail() throws WeixinException {
|
public void queryCouponDetail() throws WeixinException {
|
||||||
CouponDetail result = PAY.queryCouponDetail("openId", "couponId");
|
CouponDetail result = PAY.queryCouponDetail("openId", "couponId",
|
||||||
|
"stockId");
|
||||||
Assert.assertEquals(Consts.SUCCESS, result.getReturnCode());
|
Assert.assertEquals(Consts.SUCCESS, result.getReturnCode());
|
||||||
Assert.assertEquals(Consts.SUCCESS, result.getResultCode());
|
Assert.assertEquals(Consts.SUCCESS, result.getResultCode());
|
||||||
System.err.println(result);
|
System.err.println(result);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user