mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-02-18 22:26:22 +08:00
#392 微信支付增加企业付款到银行卡的相关接口
This commit is contained in:
@@ -68,5 +68,17 @@ public interface EntPayService {
|
||||
*
|
||||
* @param request 请求对象
|
||||
*/
|
||||
EntPayBankResult payToBankCard(EntPayBankRequest request) throws WxPayException;
|
||||
EntPayBankResult payBank(EntPayBankRequest request) throws WxPayException;
|
||||
|
||||
/**
|
||||
* 企业付款到银行卡查询.
|
||||
* <pre>
|
||||
* 用于对商户企业付款到银行卡操作进行结果查询,返回付款操作详细结果。
|
||||
* 文档详见:https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=24_3
|
||||
* 接口链接:https://api.mch.weixin.qq.com/mmpaysptrans/query_bank
|
||||
* </pre>
|
||||
*
|
||||
* @param partnerTradeNo 商户订单号
|
||||
*/
|
||||
EntPayBankQueryResult queryPayBank(String partnerTradeNo) throws WxPayException;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class EntPayServiceImpl implements EntPayService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntPayBankResult payToBankCard(EntPayBankRequest request) throws WxPayException {
|
||||
public EntPayBankResult payBank(EntPayBankRequest request) throws WxPayException {
|
||||
File publicKeyFile = this.buildPublicKeyFile();
|
||||
request.setEncBankNo(this.encryptRSA(publicKeyFile, request.getEncBankNo()));
|
||||
request.setEncTrueName(this.encryptRSA(publicKeyFile, request.getEncTrueName()));
|
||||
@@ -90,6 +90,19 @@ public class EntPayServiceImpl implements EntPayService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntPayBankQueryResult queryPayBank(String partnerTradeNo) throws WxPayException {
|
||||
EntPayBankQueryRequest request = new EntPayBankQueryRequest();
|
||||
request.setPartnerTradeNo(partnerTradeNo);
|
||||
request.checkAndSign(this.payService.getConfig());
|
||||
|
||||
String url = this.payService.getPayBaseUrl() + "/mmpaysptrans/query_bank";
|
||||
String responseContent = this.payService.post(url, request.toXML(), true);
|
||||
EntPayBankQueryResult result = BaseWxPayResult.fromXML(responseContent, EntPayBankQueryResult.class);
|
||||
result.checkResult(this.payService, request.getSignType(), true);
|
||||
return result;
|
||||
}
|
||||
|
||||
private String encryptRSA(File publicKeyFile, String srcString) throws WxPayException {
|
||||
try {
|
||||
Security.addProvider(new BouncyCastleProvider());
|
||||
|
||||
Reference in New Issue
Block a user