| @@ -1,14 +1,14 @@ | |||||
| package com.github.binarywang.wxpay.bean.result; | package com.github.binarywang.wxpay.bean.result; | ||||
| import java.io.Serializable; | |||||
| import java.util.List; | |||||
| import com.google.common.collect.Lists; | import com.google.common.collect.Lists; | ||||
| import com.thoughtworks.xstream.annotations.XStreamAlias; | import com.thoughtworks.xstream.annotations.XStreamAlias; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import lombok.NoArgsConstructor; | import lombok.NoArgsConstructor; | ||||
| import java.io.Serializable; | |||||
| import java.util.List; | |||||
| /** | /** | ||||
| * <pre> | * <pre> | ||||
| * 微信支付-申请退款返回结果. | * 微信支付-申请退款返回结果. | ||||
| @@ -108,7 +108,13 @@ public class WxPayRefundResult extends BaseWxPayResult implements Serializable { | |||||
| */ | */ | ||||
| public void composeRefundCoupons() { | public void composeRefundCoupons() { | ||||
| List<WxPayRefundCouponInfo> coupons = Lists.newArrayList(); | 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( | coupons.add( | ||||
| new WxPayRefundCouponInfo( | new WxPayRefundCouponInfo( | ||||
| this.getXmlValue("xml/coupon_refund_id_" + i), | this.getXmlValue("xml/coupon_refund_id_" + i), | ||||
| @@ -117,6 +123,7 @@ public class WxPayRefundResult extends BaseWxPayResult implements Serializable { | |||||
| ) | ) | ||||
| ); | ); | ||||
| } | } | ||||
| this.setRefundCoupons(coupons); | this.setRefundCoupons(coupons); | ||||
| } | } | ||||
| } | } | ||||