mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2025-04-05 19:41:44 +08:00
如果native支付方式的话没有prepay_id会报错
This commit is contained in:
parent
4802a7c6a5
commit
113c4023af
@ -56,6 +56,8 @@ class Order extends BasicWePay
|
|||||||
} else {
|
} else {
|
||||||
// 创建预支付码
|
// 创建预支付码
|
||||||
$result = $this->doRequest('POST', $types[$type], json_encode($data, JSON_UNESCAPED_UNICODE), true);
|
$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'])) {
|
if (empty($result['h5_url']) && empty($result['code_url']) && empty($result['prepay_id'])) {
|
||||||
$message = isset($result['code']) ? "[ {$result['code']} ] " : '';
|
$message = isset($result['code']) ? "[ {$result['code']} ] " : '';
|
||||||
$message .= isset($result['message']) ? $result['message'] : json_encode($result, JSON_UNESCAPED_UNICODE);
|
$message .= isset($result['message']) ? $result['message'] : json_encode($result, JSON_UNESCAPED_UNICODE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user