From 918750047a7bf00966e97aa3a303c2f8e1dafc7b Mon Sep 17 00:00:00 2001 From: erio Date: Fri, 6 Mar 2026 22:32:53 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=20=E5=BE=AE=E4=BF=A1=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E6=9A=82=E6=97=B6=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20Native=20=E6=89=AB=E7=A0=81=E6=A8=A1=E5=BC=8F"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ef1078279a0cc03ee2f88afdd932858d555fbb00. --- src/lib/wxpay/provider.ts | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/lib/wxpay/provider.ts b/src/lib/wxpay/provider.ts index 55240d8..82decfb 100644 --- a/src/lib/wxpay/provider.ts +++ b/src/lib/wxpay/provider.ts @@ -35,22 +35,20 @@ export class WxpayProvider implements PaymentProvider { throw new Error('WXPAY_NOTIFY_URL is required'); } - // TODO: H5 支付需要在微信商户平台开通权限,开通后取消注释 - // if (request.isMobile) { - // if (!request.clientIp) { - // throw new Error('clientIp is required for H5 payment'); - // } - // const h5Url = await createH5Order({ - // out_trade_no: request.orderId, - // description: request.subject, - // notify_url: notifyUrl, - // amount: request.amount, - // payer_client_ip: request.clientIp, - // }); - // return { tradeNo: request.orderId, payUrl: h5Url }; - // } + if (request.isMobile) { + if (!request.clientIp) { + throw new Error('clientIp is required for H5 payment'); + } + const h5Url = await createH5Order({ + out_trade_no: request.orderId, + description: request.subject, + notify_url: notifyUrl, + amount: request.amount, + payer_client_ip: request.clientIp, + }); + return { tradeNo: request.orderId, payUrl: h5Url }; + } - // 统一使用 Native 扫码模式(PC + 移动端) const codeUrl = await createPcOrder({ out_trade_no: request.orderId, description: request.subject,