diff --git a/WePayV3/Contracts/BasicWePay.php b/WePayV3/Contracts/BasicWePay.php index 601009923666b7103e17eacf2f066e3424c83097..8368957762c65484244a0061a0f8a99f3515013b 100644 --- a/WePayV3/Contracts/BasicWePay.php +++ b/WePayV3/Contracts/BasicWePay.php @@ -166,6 +166,9 @@ abstract class BasicWePay ]); if ($verify) { + if(empty($headers)){ + return json_decode($content, true); + } $headers = []; foreach (explode("\n", $header) as $line) { if (stripos($line, 'Wechatpay') !== false) { diff --git a/WePayV3/Order.php b/WePayV3/Order.php index 489f386dc3b56278c1358bba4a07cae17a511e04..d0a97a8469aefcee09e080594b787dccf72f1ea7 100644 --- a/WePayV3/Order.php +++ b/WePayV3/Order.php @@ -56,6 +56,8 @@ class Order extends BasicWePay } else { // 创建预支付码 $result = $this->doRequest('POST', $types[$type], json_encode($data, JSON_UNESCAPED_UNICODE), true); + //如果是生成码的话没有prepay_id + if (empty($result['prepay_id'])) return $result; if (empty($result['h5_url']) && empty($result['code_url']) && empty($result['prepay_id'])) { $message = isset($result['code']) ? "[ {$result['code']} ] " : ''; $message .= isset($result['message']) ? $result['message'] : json_encode($result, JSON_UNESCAPED_UNICODE); diff --git a/WePayV3/Refund.php b/WePayV3/Refund.php index e14ecb53ae547f03d6e3de750f0a79f59de04015..102e0336f0157de5ef8e640445ff85cb5e784936 100644 --- a/WePayV3/Refund.php +++ b/WePayV3/Refund.php @@ -38,7 +38,7 @@ class Refund extends BasicWePay */ public function create($data) { - return $this->doRequest('POST', '/v3/ecommerce/refunds/apply', json_encode($data, JSON_UNESCAPED_UNICODE), true); + return $this->doRequest('POST', '/v3/refund/domestic/refunds', json_encode($data, JSON_UNESCAPED_UNICODE), true); } /**