如果native支付方式的话没有prepay_id会报错

This commit is contained in:
yao978318542 2023-05-06 11:58:32 +08:00
parent 4802a7c6a5
commit 113c4023af

View File

@ -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);