@@ -83,7 +83,7 @@ public class WxMpPayServiceImpl implements WxMpPayService { | |||||
String url = PAY_BASE_URL + "/pay/refundquery"; | String url = PAY_BASE_URL + "/pay/refundquery"; | ||||
String responseContent = this.executeRequest(url, request.toXML()); | String responseContent = this.executeRequest(url, request.toXML()); | ||||
WxPayRefundQueryResult result = WxPayRefundQueryResult.fromXML(responseContent, WxPayRefundQueryResult.class); | WxPayRefundQueryResult result = WxPayRefundQueryResult.fromXML(responseContent, WxPayRefundQueryResult.class); | ||||
result.composeRefundRecords(responseContent); | |||||
result.composeRefundRecords(); | |||||
this.checkResult(result); | this.checkResult(result); | ||||
return result; | return result; | ||||
} | } | ||||
@@ -189,7 +189,7 @@ public class WxMpPayServiceImpl implements WxMpPayService { | |||||
String url = PAY_BASE_URL + "/pay/orderquery"; | String url = PAY_BASE_URL + "/pay/orderquery"; | ||||
String responseContent = this.executeRequest(url, request.toXML()); | String responseContent = this.executeRequest(url, request.toXML()); | ||||
WxPayOrderQueryResult result = WxPayOrderQueryResult.fromXML(responseContent, WxPayOrderQueryResult.class); | WxPayOrderQueryResult result = WxPayOrderQueryResult.fromXML(responseContent, WxPayOrderQueryResult.class); | ||||
result.composeCoupons(responseContent); | |||||
result.composeCoupons(); | |||||
this.checkResult(result); | this.checkResult(result); | ||||
return result; | return result; | ||||
} | } | ||||
@@ -52,11 +52,11 @@ public class WxPayRedpackQueryResult extends WxPayBaseResult { | |||||
* RECEIVED | * RECEIVED | ||||
* string(16) | * string(16) | ||||
* SENDING:发放中, | * SENDING:发放中, | ||||
* SENT:已发放待领取, | |||||
* FAILED:发放失败, | |||||
* RECEIVED:已领取, | |||||
* RFUND_ING:退款中, | |||||
* REFUND:已退款 | |||||
* SENT:已发放待领取, | |||||
* FAILED:发放失败, | |||||
* RECEIVED:已领取, | |||||
* RFUND_ING:退款中, | |||||
* REFUND:已退款 | |||||
* </pre> | * </pre> | ||||
*/ | */ | ||||
@XStreamAlias("status") | @XStreamAlias("status") | ||||
@@ -184,10 +184,13 @@ public class WxPayRefundQueryResult extends WxPayBaseResult { | |||||
this.refundRecords = refundRecords; | this.refundRecords = refundRecords; | ||||
} | } | ||||
public void composeRefundRecords(String xmlString) { | |||||
/** | |||||
* 组装生成退款记录属性的内容 | |||||
*/ | |||||
public void composeRefundRecords() { | |||||
if (this.refundCount != null && this.refundCount > 0) { | if (this.refundCount != null && this.refundCount > 0) { | ||||
this.refundRecords = Lists.newArrayList(); | this.refundRecords = Lists.newArrayList(); | ||||
XmlPath xmlPath = new XmlPath(xmlString); | |||||
XmlPath xmlPath = new XmlPath(this.getXmlString()); | |||||
for (int i = 0; i < this.refundCount; i++) { | for (int i = 0; i < this.refundCount; i++) { | ||||
RefundRecord refundRecord = new RefundRecord(); | RefundRecord refundRecord = new RefundRecord(); | ||||
@@ -33,9 +33,8 @@ public class WxPayRefundQueryResultTest { | |||||
" <transaction_id><![CDATA[1008450740201411110005820873]]></transaction_id>\n" + | " <transaction_id><![CDATA[1008450740201411110005820873]]></transaction_id>\n" + | ||||
"</xml>"; | "</xml>"; | ||||
WxPayRefundQueryResult result = new WxPayRefundQueryResult(); | |||||
result.setRefundCount(1); | |||||
result.composeRefundRecords(xmlString); | |||||
WxPayRefundQueryResult result = WxPayRefundQueryResult.fromXML(xmlString, WxPayRefundQueryResult.class); | |||||
result.composeRefundRecords(); | |||||
Assert.assertNotNull(result.getRefundRecords()); | Assert.assertNotNull(result.getRefundRecords()); | ||||
Assert.assertEquals(result.getRefundRecords().size(), 1); | Assert.assertEquals(result.getRefundRecords().size(), 1); | ||||