居然native支付不能用 罪过~

This commit is contained in:
jinyu 2015-11-21 22:40:31 +08:00
parent a4d660e7b0
commit f48943bec6
2 changed files with 5 additions and 10 deletions

View File

@ -99,14 +99,9 @@ public final class PayURLConsts {
public static final String MCH_SHORTURL_URL = MCH_BASE_URL
+ "/tools/shorturl";
/**
* 商户平台下native支付的url-模式1
* 商户平台下native支付的url(模式1)
*/
public static final String MCH_NATIVE_URL1 = "weixin://wxpay/bizpayurl?sign=%s&appid=%s&mch_id=%s&product_id=%s&time_stamp=%s&nonce_str=%s";
/**
* 商户平台下native支付的url-模式2
*/
public static final String MCH_NATIVE_URL2 = "weixin://wxpay/bizpayurl?sr=%s";
public static final String MCH_NATIVE_URL = "weixin://wxpay/bizpayurl?sign=%s&appid=%s&mch_id=%s&product_id=%s&time_stamp=%s&nonce_str=%s";
/**
* 授权码查询OPENID接口

View File

@ -209,7 +209,7 @@ public class PayUtil {
map.put("nonce_str", noncestr);
map.put("product_id", productId);
String sign = paysignMd5(map, weixinAccount.getPaySignKey());
return String.format(PayURLConsts.MCH_NATIVE_URL1, sign,
return String.format(PayURLConsts.MCH_NATIVE_URL, sign,
weixinAccount.getId(), weixinAccount.getMchId(), productId,
timestamp, noncestr);
}
@ -242,12 +242,12 @@ public class PayUtil {
String outTradeNo, double totalFee, String notifyUrl,
String createIp) throws PayException {
MchPayPackage payPackage = new MchPayPackage(weixinAccount, null, body,
outTradeNo, totalFee, createIp, notifyUrl, TradeType.NATIVE);
outTradeNo, totalFee, notifyUrl, createIp, TradeType.NATIVE);
payPackage.setProductId(productId);
String paySignKey = weixinAccount.getPaySignKey();
payPackage.setSign(paysignMd5(payPackage, paySignKey));
PrePay prePay = createPrePay(payPackage, paySignKey);
return String.format(PayURLConsts.MCH_NATIVE_URL2, prePay.getCodeUrl());
return prePay.getCodeUrl();
}
/**