Code Duplication    Length = 4-4 lines in 4 locations

src/Wechat/Payment/QueryOrder.php 1 location

@@ 96-99 (lines=4) @@
93
            throw new Exception($transaction['err_code'].': '.$transaction['err_code_des']);
94
        }
95
96
        if (isset($transaction['return_code']) &&
97
            $transaction['return_code'] === 'FAIL') {
98
            throw new Exception($transaction['return_code'].': '.$transaction['return_msg']);
99
        }
100
101
        return $transactionInfo = new Bag($transaction);
102
    }

src/Wechat/Payment/Refund.php 2 locations

@@ 149-152 (lines=4) @@
146
        }
147
        $refundOrder = XML::parse($response);
148
149
        if (isset($refundOrder['return_code']) &&
150
            $refundOrder['return_code'] === 'FAIL') {
151
            throw new Exception($refundOrder['return_code'].': '.$refundOrder['return_msg']);
152
        }
153
154
        //返回签名数据校验
155
        if (empty($refundOrder) || empty($refundOrder['sign'])) {
@@ 174-177 (lines=4) @@
171
            throw new Exception($refundOrder['err_code'].': '.$refundOrder['err_code_des']);
172
        }
173
174
        if (isset($refundOrder['return_code']) &&
175
            $refundOrder['return_code'] === 'FAIL') {
176
            throw new Exception($refundOrder['return_code'].': '.$refundOrder['return_msg']);
177
        }
178
179
        return $this->refundInfo = $refundOrder;
180
    }

src/Wechat/Payment/UnifiedOrder.php 1 location

@@ 192-195 (lines=4) @@
189
            throw new Exception($unifiedOrder['err_code'].': '.$unifiedOrder['err_code_des']);
190
        }
191
192
        if (isset($unifiedOrder['return_code']) &&
193
            $unifiedOrder['return_code'] === 'FAIL') {
194
            throw new Exception($unifiedOrder['return_code'].': '.$unifiedOrder['return_msg']);
195
        }
196
197
        return $this->unifiedOrder = $unifiedOrder;
198
    }