up
This commit is contained in:
parent
8f0d53b84a
commit
102f37cc77
@ -2,6 +2,7 @@ package com.foxinmy.weixin4j.payment.mch;
|
||||
|
||||
import com.foxinmy.weixin4j.model.WeixinPayAccount;
|
||||
import com.foxinmy.weixin4j.payment.PayRequest;
|
||||
import com.foxinmy.weixin4j.type.SignType;
|
||||
import com.foxinmy.weixin4j.type.TradeType;
|
||||
import com.foxinmy.weixin4j.util.DigestUtil;
|
||||
import com.foxinmy.weixin4j.util.MapUtil;
|
||||
@ -37,16 +38,18 @@ public class APPPayRequest extends AbstractPayRequest {
|
||||
"Sign=WXPay");
|
||||
payRequest.setPartnerId(getPaymentAccount().getPartnerId());
|
||||
payRequest.setPrepayId(getPrePayId());
|
||||
String sign = DigestUtil.MD5(
|
||||
String.format("%s&key=%s",
|
||||
MapUtil.toJoinString(payRequest, false, true),
|
||||
getPaymentAccount().getPaySignKey())).toUpperCase();
|
||||
payRequest.setPaySign(sign);
|
||||
payRequest.setSignType(SignType.MD5);
|
||||
return payRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toRequestString() {
|
||||
PayRequest payRequest = toRequestObject();
|
||||
String sign = DigestUtil.MD5(
|
||||
String.format("%s&key=%s",
|
||||
MapUtil.toJoinString(payRequest, false, true),
|
||||
getPaymentAccount().getPaySignKey())).toUpperCase();
|
||||
StringBuilder content = new StringBuilder();
|
||||
content.append("<xml>");
|
||||
content.append(String.format("<appid><![CDATA[%s]]></appid>",
|
||||
@ -61,7 +64,8 @@ public class APPPayRequest extends AbstractPayRequest {
|
||||
payRequest.getNonceStr()));
|
||||
content.append(String.format("<timestamp><![CDATA[%s]]></timestamp>",
|
||||
payRequest.getTimeStamp()));
|
||||
content.append(String.format("<sign><![CDATA[%s]]></sign>", sign));
|
||||
content.append(String.format("<sign><![CDATA[%s]]></sign>",
|
||||
payRequest.getPaySign()));
|
||||
content.append("</xml>");
|
||||
return content.toString();
|
||||
}
|
||||
|
||||
@ -29,13 +29,24 @@ public class OpenIdResult extends MerchantResult {
|
||||
@JSONField(name = "openid")
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 用户在商户appid下的唯一标识
|
||||
*/
|
||||
@XmlElement(name = "sub_openid")
|
||||
@JSONField(name = "sub_openid")
|
||||
private String subOpenId;
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public String getSubOpenId() {
|
||||
return subOpenId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OpenIdResult [openId=" + openId + ", "
|
||||
+ super.toString() + "]";
|
||||
return "OpenIdResult [openId=" + openId + ", subOpenId=" + subOpenId
|
||||
+ ", " + super.toString() + "]";
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ import com.foxinmy.weixin4j.util.StringUtil;
|
||||
public final class XmlStream {
|
||||
private final static String ROOT_ELEMENT_XML = "xml";
|
||||
private final static String XML_VERSION = "1.0";
|
||||
private final static ConcurrentHashMap<Class<?>, JAXBContext> jaxbContexts = new ConcurrentHashMap<Class<?>, JAXBContext>();;
|
||||
private final static ConcurrentHashMap<Class<?>, JAXBContext> jaxbContexts = new ConcurrentHashMap<Class<?>, JAXBContext>();
|
||||
|
||||
/**
|
||||
* Xml2Bean
|
||||
|
||||
@ -190,6 +190,12 @@ tag_untagging_uri={api_cgi_url}/tags/members/batchuntagging?access_token=%s
|
||||
tag_userids_uri={api_cgi_url}/tags/getidlist?access_token=%s
|
||||
# \u83b7\u53d6\u6807\u7b7e\u4e0b\u7c89\u4e1d\u5217\u8868
|
||||
tag_user_uri={api_cgi_url}/user/tag/get?access_token=%s
|
||||
# \u83b7\u53d6\u9ed1\u540d\u5355\u5217\u8868
|
||||
getblacklist_uri={api_cgi_url}/tags/members/getblacklist?access_token=%s
|
||||
# \u62c9\u9ed1\u7528\u6237
|
||||
batchblacklist_uri={api_cgi_url}/tags/members/batchblacklist?access_token=%s
|
||||
# \u53d6\u6d88\u62c9\u9ed1\u7528\u6237
|
||||
batchunblacklist_uri={api_cgi_url}/tags/members/batchunblacklist?access_token=%s
|
||||
|
||||
# \u521b\u5efa\u5361\u5238
|
||||
card_create_uri={api_base_url}/card/create?access_token=%s
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user