🎨 【微信支付】平台收付通APP支付接口新增SDK所需要签名参数
This commit is contained in:
@@ -83,7 +83,11 @@ public class TransactionsResult implements Serializable {
|
|||||||
private String packageValue;
|
private String packageValue;
|
||||||
private String noncestr;
|
private String noncestr;
|
||||||
private String timestamp;
|
private String timestamp;
|
||||||
|
private String sign;
|
||||||
|
|
||||||
|
private String getSignStr() {
|
||||||
|
return String.format("%s\n%s\n%s\n%s\n", appid, timestamp, noncestr, prepayid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> T getPayInfo(TradeTypeEnum tradeType, String appId, String mchId, PrivateKey privateKey) {
|
public <T> T getPayInfo(TradeTypeEnum tradeType, String appId, String mchId, PrivateKey privateKey) {
|
||||||
@@ -104,7 +108,7 @@ public class TransactionsResult implements Serializable {
|
|||||||
appResult.setAppid(appId).setPrepayid(this.prepayId).setPartnerid(mchId)
|
appResult.setAppid(appId).setPrepayid(this.prepayId).setPartnerid(mchId)
|
||||||
.setNoncestr(nonceStr).setTimestamp(timestamp)
|
.setNoncestr(nonceStr).setTimestamp(timestamp)
|
||||||
//暂填写固定值Sign=WXPay
|
//暂填写固定值Sign=WXPay
|
||||||
.setPackageValue("Sign=WXPay");
|
.setPackageValue("Sign=WXPay").setSign(SignUtils.sign(appResult.getSignStr(), privateKey));
|
||||||
return (T) appResult;
|
return (T) appResult;
|
||||||
case NATIVE:
|
case NATIVE:
|
||||||
return (T) this.codeUrl;
|
return (T) this.codeUrl;
|
||||||
|
|||||||
Reference in New Issue
Block a user