Skip to content

Commit ae50576

Browse files
committed
Update WxMpService.java
增加NATIVE扫码支付类型, 1.将原来的getJSSDKPayInfo(String openId, String outTradeNo, double amt, String body, String tradeType, String ip, String notifyUrl)方法拆分为两个方法:1)拼装NATIVE发起支付请求需要的参数的方法 Map<String, String> getNativePayInfo(String productId, String outTradeNo, double amt, String body, String ip, String notifyUrl); 2) 拼装JSAPI发起支付请求需要的参数方法 Map<String, String> getJsapiPayInfo(String openId, String outTradeNo, double amt, String body, String ip, String notifyUrl); 2.修改getJSSDKPayInfo(Map<String, String> parameters)方式为getPayInfo(Map<String, String> parameters),适用上面两个方法调用。
1 parent b77e771 commit ae50576

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpService.java

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -721,31 +721,49 @@ public interface WxMpService {
721721
WxMpPrepayIdResult getPrepayId(Map<String, String> parameters);
722722

723723
/**
724-
* 该接口调用“统一下单”接口,并拼装JSSDK发起支付请求需要的参数
724+
* 该接口调用“统一下单”接口,并拼装发起支付请求需要的参数
725725
* 详见http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E5.8F.91.E8.B5.B7.E4.B8.80.E4.B8.AA.E5.BE.AE.E4.BF.A1.E6.94.AF.E4.BB.98.E8.AF.B7.E6.B1.82
726726
* @param parameters
727727
* the required or optional parameters
728728
* @return
729729
* @throws WxErrorException
730730
*/
731-
Map<String, String> getJSSDKPayInfo(Map<String, String> parameters) throws WxErrorException;
731+
Map<String, String> getPayInfo(Map<String, String> parameters) throws WxErrorException;
732732

733733
/**
734-
* 该接口调用“统一下单”接口,并拼装JSSDK发起支付请求需要的参数
734+
* 该接口调用“统一下单”接口,并拼装NATIVE发起支付请求需要的参数
735735
* 详见http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E5.8F.91.E8.B5.B7.E4.B8.80.E4.B8.AA.E5.BE.AE.E4.BF.A1.E6.94.AF.E4.BB.98.E8.AF.B7.E6.B1.82
736+
* tradeType 交易类型 NATIVE (其他交易类型JSAPI,APP,WAP)
737+
* @param productId 商户商品ID
738+
* @param outTradeNo 商户端对应订单号
739+
* @param amt 金额(单位元)
740+
* @param body 商品描述
741+
* @param ip 发起支付的客户端IP
742+
* @param notifyUrl 通知地址
743+
* @return
744+
* @throws WxErrorException
745+
* @deprecated Use me.chanjar.weixin.mp.api.WxMpService.getPayInfo(Map<String, String>) instead
746+
*/
747+
@Deprecated
748+
Map<String, String> getNativePayInfo(String productId, String outTradeNo, double amt, String body, String ip, String notifyUrl) throws WxErrorException;
749+
750+
/**
751+
* 该接口调用“统一下单”接口,并拼装JSAPI发起支付请求需要的参数
752+
* 详见http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E5.8F.91.E8.B5.B7.E4.B8.80.E4.B8.AA.E5.BE.AE.E4.BF.A1.E6.94.AF.E4.BB.98.E8.AF.B7.E6.B1.82
753+
* tradeType 交易类型 JSAPI(其他交易类型NATIVE,APP,WAP)
736754
* @param openId 支付人openId
737755
* @param outTradeNo 商户端对应订单号
738756
* @param amt 金额(单位元)
739757
* @param body 商品描述
740-
* @param tradeType 交易类型 JSAPI,NATIVE,APP,WAP
741758
* @param ip 发起支付的客户端IP
742759
* @param notifyUrl 通知地址
743760
* @return
744761
* @throws WxErrorException
745-
* @deprecated Use me.chanjar.weixin.mp.api.WxMpService.getJSSDKPayInfo(Map<String, String>) instead
762+
* @deprecated Use me.chanjar.weixin.mp.api.WxMpService.getPayInfo(Map<String, String>) instead
746763
*/
747764
@Deprecated
748-
Map<String, String> getJSSDKPayInfo(String openId, String outTradeNo, double amt, String body, String tradeType, String ip, String notifyUrl) throws WxErrorException;
765+
Map<String, String> getJsapiPayInfo(String openId, String outTradeNo, double amt, String body, String ip, String notifyUrl) throws WxErrorException;
766+
749767

750768
/**
751769
* 该接口提供所有微信支付订单的查询,当支付通知处理异常戒丢失的情冴,商户可以通过该接口查询订单支付状态。

0 commit comments

Comments
 (0)