mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-07 22:27:47 +08:00
电商收付通支付调整
This commit is contained in:
parent
4f157b08ea
commit
34f0d99df1
@ -54,6 +54,19 @@ public interface EcommerceService {
|
|||||||
*/
|
*/
|
||||||
ApplymentsStatusResult queryApplyStatusByOutRequestNo(String outRequestNo) throws WxPayException;
|
ApplymentsStatusResult queryApplyStatusByOutRequestNo(String outRequestNo) throws WxPayException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 合单支付API(APP支付、JSAPI支付、H5支付、NATIVE支付).
|
||||||
|
* 请求URL:https://api.mch.weixin.qq.com/v3/combine-transactions/jsapi
|
||||||
|
* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/e-combine.shtml
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param tradeType 支付方式
|
||||||
|
* @param request 请求对象
|
||||||
|
* @return 微信合单支付返回
|
||||||
|
*/
|
||||||
|
TransactionsResult combine(TradeTypeEnum tradeType, CombineTransactionsRequest request) throws WxPayException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 合单支付API(APP支付、JSAPI支付、H5支付、NATIVE支付).
|
* 合单支付API(APP支付、JSAPI支付、H5支付、NATIVE支付).
|
||||||
@ -79,6 +92,18 @@ public interface EcommerceService {
|
|||||||
*/
|
*/
|
||||||
CombineTransactionsNotifyResult parseCombineNotifyResult(String notifyData, SignatureHeader header) throws WxPayException;
|
CombineTransactionsNotifyResult parseCombineNotifyResult(String notifyData, SignatureHeader header) throws WxPayException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 服务商模式普通支付API(APP支付、JSAPI支付、H5支付、NATIVE支付).
|
||||||
|
* 请求URL:https://api.mch.weixin.qq.com/v3/pay/partner/transactions/jsapi
|
||||||
|
* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/transactions_sl.shtml
|
||||||
|
* </pre>
|
||||||
|
* @param tradeType 支付方式
|
||||||
|
* @param request 请求对象
|
||||||
|
* @return 调起支付需要的参数
|
||||||
|
*/
|
||||||
|
TransactionsResult partner(TradeTypeEnum tradeType, PartnerTransactionsRequest request) throws WxPayException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 服务商模式普通支付API(APP支付、JSAPI支付、H5支付、NATIVE支付).
|
* 服务商模式普通支付API(APP支付、JSAPI支付、H5支付、NATIVE支付).
|
||||||
|
@ -46,10 +46,15 @@ public class EcommerceServiceImpl implements EcommerceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T combineTransactions(TradeTypeEnum tradeType, CombineTransactionsRequest request) throws WxPayException {
|
public TransactionsResult combine(TradeTypeEnum tradeType, CombineTransactionsRequest request) throws WxPayException {
|
||||||
String url = this.payService.getPayBaseUrl() + tradeType.getCombineUrl();
|
String url = this.payService.getPayBaseUrl() + tradeType.getCombineUrl();
|
||||||
String response = this.payService.postV3(url, GSON.toJson(request));
|
String response = this.payService.postV3(url, GSON.toJson(request));
|
||||||
TransactionsResult result = GSON.fromJson(response, TransactionsResult.class);
|
return GSON.fromJson(response, TransactionsResult.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> T combineTransactions(TradeTypeEnum tradeType, CombineTransactionsRequest request) throws WxPayException {
|
||||||
|
TransactionsResult result = this.combine(tradeType, request);
|
||||||
return result.getPayInfo(tradeType, request.getCombineAppid(),
|
return result.getPayInfo(tradeType, request.getCombineAppid(),
|
||||||
request.getCombineMchid(), payService.getConfig().getPrivateKey());
|
request.getCombineMchid(), payService.getConfig().getPrivateKey());
|
||||||
}
|
}
|
||||||
@ -76,10 +81,15 @@ public class EcommerceServiceImpl implements EcommerceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T partnerTransactions(TradeTypeEnum tradeType, PartnerTransactionsRequest request) throws WxPayException {
|
public TransactionsResult partner(TradeTypeEnum tradeType, PartnerTransactionsRequest request) throws WxPayException {
|
||||||
String url = this.payService.getPayBaseUrl() + tradeType.getPartnerUrl();
|
String url = this.payService.getPayBaseUrl() + tradeType.getPartnerUrl();
|
||||||
String response = this.payService.postV3(url, GSON.toJson(request));
|
String response = this.payService.postV3(url, GSON.toJson(request));
|
||||||
TransactionsResult result = GSON.fromJson(response, TransactionsResult.class);
|
return GSON.fromJson(response, TransactionsResult.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> T partnerTransactions(TradeTypeEnum tradeType, PartnerTransactionsRequest request) throws WxPayException {
|
||||||
|
TransactionsResult result = this.partner(tradeType, request);
|
||||||
return result.getPayInfo(tradeType, request.getSpAppid(),
|
return result.getPayInfo(tradeType, request.getSpAppid(),
|
||||||
request.getSpMchid(), payService.getConfig().getPrivateKey());
|
request.getSpMchid(), payService.getConfig().getPrivateKey());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user