|
|
|
@@ -37,6 +37,11 @@ public class WxPay { |
|
|
|
// 查询企业付款 |
|
|
|
private static final String GETTRANSFERINFO_URL = "https://api.mch.weixin.qq.com/mmpaymkttransfers/gettransferinfo"; |
|
|
|
|
|
|
|
// 查询代金券批次 |
|
|
|
private static final String GETCOUPONSTOCK_URL = "https://api.mch.weixin.qq.com/mmpaymkttransfers/query_coupon_stock"; |
|
|
|
// 查询代金券信息 |
|
|
|
private static final String GETCOUPONINFO_URL = "https://api.mch.weixin.qq.com/mmpaymkttransfers/querycouponsinfo"; |
|
|
|
|
|
|
|
// 沙箱 |
|
|
|
private static final String SANDBOX_GETSIGNKEY_URL = "https://api.mch.weixin.qq.com/sandboxnew/pay/getsignkey"; |
|
|
|
|
|
|
|
@@ -280,6 +285,28 @@ public class WxPay { |
|
|
|
return qrCodeUrl; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询代金券批次 |
|
|
|
* https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_4&index=5 |
|
|
|
* |
|
|
|
* @param params |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public static String getCouponStock(Map<String, String> params) { |
|
|
|
return doPost(GETCOUPONSTOCK_URL, params); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询代金券信息 |
|
|
|
* https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_5&index=6 |
|
|
|
* |
|
|
|
* @param params |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public static String getCouponInfo(Map<String, String> params) { |
|
|
|
return doPost(GETCOUPONINFO_URL, params); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取验签秘钥API |
|
|
|
* https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=23_1 |
|
|
|
@@ -291,6 +318,8 @@ public class WxPay { |
|
|
|
return doPost(SANDBOX_GETSIGNKEY_URL, params); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static String doPost(String url, Map<String, String> params) { |
|
|
|
return HttpUtil.payPost(url, WxPayment.toXml(params)); |
|
|
|
} |
|
|
|
|