diff --git a/WePayV3/Order.php b/WePayV3/Order.php index 489f386..d0a97a8 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);