File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 11package com .github .binarywang .wxpay .bean .result ;
22
3+ import java .io .Serializable ;
4+ import java .util .List ;
5+
36import com .google .common .collect .Lists ;
47import com .thoughtworks .xstream .annotations .XStreamAlias ;
58import lombok .Data ;
69import lombok .EqualsAndHashCode ;
710import lombok .NoArgsConstructor ;
811
9- import java .io .Serializable ;
10- import java .util .List ;
11-
1212/**
1313 * <pre>
1414 * 微信支付-申请退款返回结果.
@@ -108,7 +108,13 @@ public class WxPayRefundResult extends BaseWxPayResult implements Serializable {
108108 */
109109 public void composeRefundCoupons () {
110110 List <WxPayRefundCouponInfo > coupons = Lists .newArrayList ();
111- for (int i = 0 ; i < this .getCouponRefundCount (); i ++) {
111+ Integer refundCount = this .getCouponRefundCount ();
112+ if (refundCount == null ) {
113+ //无退款代金券信息
114+ return ;
115+ }
116+
117+ for (int i = 0 ; i < refundCount ; i ++) {
112118 coupons .add (
113119 new WxPayRefundCouponInfo (
114120 this .getXmlValue ("xml/coupon_refund_id_" + i ),
@@ -117,6 +123,7 @@ public void composeRefundCoupons() {
117123 )
118124 );
119125 }
126+
120127 this .setRefundCoupons (coupons );
121128 }
122129}
You can’t perform that action at this time.
0 commit comments