居然native支付不能用 罪过~
This commit is contained in:
parent
a4d660e7b0
commit
f48943bec6
@ -99,14 +99,9 @@ public final class PayURLConsts {
|
|||||||
public static final String MCH_SHORTURL_URL = MCH_BASE_URL
|
public static final String MCH_SHORTURL_URL = MCH_BASE_URL
|
||||||
+ "/tools/shorturl";
|
+ "/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";
|
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";
|
||||||
|
|
||||||
/**
|
|
||||||
* 商户平台下native支付的url-模式2
|
|
||||||
*/
|
|
||||||
public static final String MCH_NATIVE_URL2 = "weixin://wxpay/bizpayurl?sr=%s";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 授权码查询OPENID接口
|
* 授权码查询OPENID接口
|
||||||
|
|||||||
@ -209,7 +209,7 @@ public class PayUtil {
|
|||||||
map.put("nonce_str", noncestr);
|
map.put("nonce_str", noncestr);
|
||||||
map.put("product_id", productId);
|
map.put("product_id", productId);
|
||||||
String sign = paysignMd5(map, weixinAccount.getPaySignKey());
|
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,
|
weixinAccount.getId(), weixinAccount.getMchId(), productId,
|
||||||
timestamp, noncestr);
|
timestamp, noncestr);
|
||||||
}
|
}
|
||||||
@ -242,12 +242,12 @@ public class PayUtil {
|
|||||||
String outTradeNo, double totalFee, String notifyUrl,
|
String outTradeNo, double totalFee, String notifyUrl,
|
||||||
String createIp) throws PayException {
|
String createIp) throws PayException {
|
||||||
MchPayPackage payPackage = new MchPayPackage(weixinAccount, null, body,
|
MchPayPackage payPackage = new MchPayPackage(weixinAccount, null, body,
|
||||||
outTradeNo, totalFee, createIp, notifyUrl, TradeType.NATIVE);
|
outTradeNo, totalFee, notifyUrl, createIp, TradeType.NATIVE);
|
||||||
payPackage.setProductId(productId);
|
payPackage.setProductId(productId);
|
||||||
String paySignKey = weixinAccount.getPaySignKey();
|
String paySignKey = weixinAccount.getPaySignKey();
|
||||||
payPackage.setSign(paysignMd5(payPackage, paySignKey));
|
payPackage.setSign(paysignMd5(payPackage, paySignKey));
|
||||||
PrePay prePay = createPrePay(payPackage, paySignKey);
|
PrePay prePay = createPrePay(payPackage, paySignKey);
|
||||||
return String.format(PayURLConsts.MCH_NATIVE_URL2, prePay.getCodeUrl());
|
return prePay.getCodeUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user