mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-23 22:11:40 +08:00
#646 修复申请退款接口组装退款代金券空指针的问题
This commit is contained in:
parent
82e2371847
commit
4710354d96
@ -1,14 +1,14 @@
|
||||
package com.github.binarywang.wxpay.bean.result;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 微信支付-申请退款返回结果.
|
||||
@ -108,7 +108,13 @@ public class WxPayRefundResult extends BaseWxPayResult implements Serializable {
|
||||
*/
|
||||
public void composeRefundCoupons() {
|
||||
List<WxPayRefundCouponInfo> coupons = Lists.newArrayList();
|
||||
for (int i = 0; i < this.getCouponRefundCount(); i++) {
|
||||
Integer refundCount = this.getCouponRefundCount();
|
||||
if (refundCount == null) {
|
||||
//无退款代金券信息
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < refundCount; i++) {
|
||||
coupons.add(
|
||||
new WxPayRefundCouponInfo(
|
||||
this.getXmlValue("xml/coupon_refund_id_" + i),
|
||||
@ -117,6 +123,7 @@ public class WxPayRefundResult extends BaseWxPayResult implements Serializable {
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
this.setRefundCoupons(coupons);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user