From b823b9110a2aad7cbdb7529a9cffeb9ff53337ea Mon Sep 17 00:00:00 2001 From: yin5th <541304803@qq.com> Date: Tue, 26 Sep 2023 16:43:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E8=AF=95=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/app/common/server/WeChatPayServer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/app/common/server/WeChatPayServer.php b/server/app/common/server/WeChatPayServer.php index 1a5da29c..c70d9027 100644 --- a/server/app/common/server/WeChatPayServer.php +++ b/server/app/common/server/WeChatPayServer.php @@ -121,12 +121,12 @@ class WeChatPayServer } //pc端 - if (in_array($order_source, [Client_::pc])) { + if (in_array($order_source, [Client_::pc, Client_::api])) { $data = self::getNativeCode($result, $order); } //h5(非微信环境) - if (in_array($order_source, [Client_::h5, Client_::api])) { + if (in_array($order_source, [Client_::h5])) { $redirect_url = request()->domain() . '/mobile/pages/user_order/user_order'; $redirect_url = urlencode($redirect_url); $data = $result['mweb_url'] . '&redirect_url=' . $redirect_url; @@ -248,14 +248,14 @@ class WeChatPayServer } //NATIVE模式设置 - if ($order_source == Client_::pc) { + if (in_array($order_source, [Client_::pc, Client_::api])) { $attributes['trade_type'] = 'NATIVE'; $attributes['product_id'] = $order['order_sn']; $attributes['openid'] = ""; } //h5支付类型 - if (in_array($order_source, [Client_::h5, Client_::api])) { + if (in_array($order_source, [Client_::h5])) { $attributes['trade_type'] = 'MWEB'; }