fix: 微信支付暂时统一使用 Native 扫码模式

H5 支付需要在微信商户平台单独开通权限,当前未开通会报
NO_AUTH 错误。暂时移动端也走 Native 二维码,待 H5 权限
开通后再恢复。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
erio
2026-03-06 22:32:13 +08:00
parent 225f2e0c5a
commit ef1078279a

View File

@@ -35,20 +35,22 @@ export class WxpayProvider implements PaymentProvider {
throw new Error('WXPAY_NOTIFY_URL is required'); throw new Error('WXPAY_NOTIFY_URL is required');
} }
if (request.isMobile) { // TODO: H5 支付需要在微信商户平台开通权限,开通后取消注释
if (!request.clientIp) { // if (request.isMobile) {
throw new Error('clientIp is required for H5 payment'); // if (!request.clientIp) {
} // throw new Error('clientIp is required for H5 payment');
const h5Url = await createH5Order({ // }
out_trade_no: request.orderId, // const h5Url = await createH5Order({
description: request.subject, // out_trade_no: request.orderId,
notify_url: notifyUrl, // description: request.subject,
amount: request.amount, // notify_url: notifyUrl,
payer_client_ip: request.clientIp, // amount: request.amount,
}); // payer_client_ip: request.clientIp,
return { tradeNo: request.orderId, payUrl: h5Url }; // });
} // return { tradeNo: request.orderId, payUrl: h5Url };
// }
// 统一使用 Native 扫码模式PC + 移动端)
const codeUrl = await createPcOrder({ const codeUrl = await createPcOrder({
out_trade_no: request.orderId, out_trade_no: request.orderId,
description: request.subject, description: request.subject,