diff --git a/composer.json b/composer.json index 2fd6bd6..47dd500 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tansilu/hfpay-lib", - "version": "0.0.9", + "version": "0.0.10", "type": "library", "require": { "php": ">=7.4", diff --git a/src/factory/object/trade/RefundRequest.php b/src/factory/object/trade/RefundRequest.php index b2b989c..a8ea410 100644 --- a/src/factory/object/trade/RefundRequest.php +++ b/src/factory/object/trade/RefundRequest.php @@ -44,15 +44,18 @@ class RefundRequest if(empty($this->data['org_order_id'])) { throw new ParamsException('原交易订单号不能为空', 'org_order_id'); } + $params['org_order_id'] = $this->data['org_order_id']; if(!empty($params['trans_type'])) { $params['trans_type'] = $this->data['trans_type']; } if(empty($this->data['trans_amt'])) { throw new ParamsException('退款金额不能为空', 'trans_amt'); } - if(!empty($params['div_details'])) { - $params['div_details'] = json_encode($this->data['div_details'], JSON_UNESCAPED_UNICODE); + $params['trans_amt'] = $this->data['trans_amt']; + if(empty($this->data['div_details'])) { + throw new ParamsException('退款明细不能为空', 'div_details'); } + $params['div_details'] = json_encode($this->data['div_details'], JSON_UNESCAPED_UNICODE); if(!empty($this->data['remark'])) { $params['remark'] = $this->data['remark']; } diff --git a/src/http/ErrCodeHelper.php b/src/http/ErrCodeHelper.php index 87c6cb8..f7069ca 100644 --- a/src/http/ErrCodeHelper.php +++ b/src/http/ErrCodeHelper.php @@ -76,7 +76,7 @@ class ErrCodeHelper // if(isset($err[$code])) { // throw new BizException($err[$code] . ' ' . $code . ' ' . $desc, $code); // } - if($code != 'C00000') { + if(!in_array($code, ['C00000', 'C00001', 'C00002'])) { throw new BizException($desc . ' ' . $code, $code); } }