weixin4j-qy:新增企业号登陆授权API
This commit is contained in:
@@ -34,7 +34,7 @@ import com.foxinmy.weixin4j.model.Consts;
|
||||
import com.foxinmy.weixin4j.model.Token;
|
||||
import com.foxinmy.weixin4j.mp.model.WeixinMpAccount;
|
||||
import com.foxinmy.weixin4j.mp.payment.PayUtil;
|
||||
import com.foxinmy.weixin4j.mp.payment.conver.ListsuffixResultConverter;
|
||||
import com.foxinmy.weixin4j.mp.payment.conver.ListsuffixResultDeserializer;
|
||||
import com.foxinmy.weixin4j.mp.payment.v2.Order;
|
||||
import com.foxinmy.weixin4j.mp.payment.v2.RefundRecord;
|
||||
import com.foxinmy.weixin4j.mp.payment.v2.RefundResult;
|
||||
@@ -442,7 +442,7 @@ public class Pay2Api extends PayApi {
|
||||
String sign = PayUtil.paysignMd5(map, weixinAccount.getPartnerKey());
|
||||
map.put("sign", sign.toLowerCase());
|
||||
WeixinResponse response = weixinClient.get(refundquery_uri, map);
|
||||
return ListsuffixResultConverter.containRefundConvert(
|
||||
return ListsuffixResultDeserializer.containRefundDeserialize(
|
||||
response.getAsString(), RefundRecord.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import com.foxinmy.weixin4j.http.weixin.XmlResult;
|
||||
import com.foxinmy.weixin4j.model.Consts;
|
||||
import com.foxinmy.weixin4j.mp.model.WeixinMpAccount;
|
||||
import com.foxinmy.weixin4j.mp.payment.PayUtil;
|
||||
import com.foxinmy.weixin4j.mp.payment.conver.ListsuffixResultConverter;
|
||||
import com.foxinmy.weixin4j.mp.payment.conver.ListsuffixResultDeserializer;
|
||||
import com.foxinmy.weixin4j.mp.payment.v3.ApiResult;
|
||||
import com.foxinmy.weixin4j.mp.payment.v3.Order;
|
||||
import com.foxinmy.weixin4j.mp.payment.v3.RefundRecord;
|
||||
@@ -80,7 +80,7 @@ public class Pay3Api extends PayApi {
|
||||
String param = XmlStream.map2xml(map);
|
||||
String orderquery_uri = getRequestUri("orderquery_v3_uri");
|
||||
WeixinResponse response = weixinClient.post(orderquery_uri, param);
|
||||
return ListsuffixResultConverter.containCouponConvert(
|
||||
return ListsuffixResultDeserializer.containCouponDeserialize(
|
||||
response.getAsString(), Order.class);
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ public class Pay3Api extends PayApi {
|
||||
map.put("sign", sign);
|
||||
String param = XmlStream.map2xml(map);
|
||||
WeixinResponse response = weixinClient.post(refundquery_uri, param);
|
||||
return ListsuffixResultConverter.containRefundDetailConvert(
|
||||
return ListsuffixResultDeserializer.containRefundDetailDeserialize(
|
||||
response.getAsString(), RefundRecord.class);
|
||||
}
|
||||
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.foxinmy.weixin4j.mp.payment.conver;
|
||||
|
||||
/**
|
||||
* 对 后缀为_$n 的 xml节点序列化
|
||||
*
|
||||
* @className ListsuffixResultSerializer
|
||||
* @author jy
|
||||
* @date 2015年3月24日
|
||||
* @since JDK 1.7
|
||||
* @see
|
||||
*/
|
||||
public class ListsuffixResultSerializer {
|
||||
/**
|
||||
* 序列化为json
|
||||
*
|
||||
* @param object
|
||||
* @return json
|
||||
*/
|
||||
public String serializeToJSON(Object object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 序列化为xml
|
||||
*
|
||||
* @param object
|
||||
* @return xml
|
||||
*/
|
||||
public String serializeToXML(Object object) {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -84,10 +84,10 @@ public class Order extends ApiResult {
|
||||
@JSONField(name = "coupon_count")
|
||||
private Integer couponCount;
|
||||
/**
|
||||
* 代金券信息
|
||||
* 代金券信息 验证签名有点麻烦
|
||||
*/
|
||||
@XmlTransient
|
||||
@JSONField(serialize = false)
|
||||
@JSONField(serialize = false, deserialize = false)
|
||||
private List<CouponInfo> couponList;
|
||||
/**
|
||||
* 现金支付金额
|
||||
@@ -135,7 +135,7 @@ public class Order extends ApiResult {
|
||||
protected Order() {
|
||||
// jaxb required
|
||||
}
|
||||
|
||||
|
||||
public TradeState getTradeState() {
|
||||
return tradeState;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.foxinmy.weixin4j.model.Token;
|
||||
import com.foxinmy.weixin4j.mp.payment.conver.ListsuffixResultConverter;
|
||||
import com.foxinmy.weixin4j.mp.payment.conver.ListsuffixResultDeserializer;
|
||||
import com.foxinmy.weixin4j.mp.payment.v2.RefundRecord;
|
||||
import com.foxinmy.weixin4j.mp.payment.v3.Order;
|
||||
import com.foxinmy.weixin4j.xml.XmlStream;
|
||||
@@ -60,7 +60,7 @@ public class XmlstreamTest {
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
System.err.println(ListsuffixResultConverter.containCouponConvert(
|
||||
System.err.println(ListsuffixResultDeserializer.containCouponDeserialize(
|
||||
sb.toString(), Order.class));
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class XmlstreamTest {
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
System.err.println(ListsuffixResultConverter.containRefundConvert(
|
||||
System.err.println(ListsuffixResultDeserializer.containRefundDeserialize(
|
||||
sb.toString(), RefundRecord.class));
|
||||
}
|
||||
|
||||
@@ -94,8 +94,8 @@ public class XmlstreamTest {
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
System.err.println(ListsuffixResultConverter
|
||||
.containRefundDetailConvert(sb.toString(),
|
||||
System.err.println(ListsuffixResultDeserializer
|
||||
.containRefundDetailDeserialize(sb.toString(),
|
||||
com.foxinmy.weixin4j.mp.payment.v3.RefundRecord.class));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user