@@ -35,22 +35,20 @@ export class WxpayProvider implements PaymentProvider {
|
|||||||
throw new Error('WXPAY_NOTIFY_URL is required');
|
throw new Error('WXPAY_NOTIFY_URL is required');
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: H5 支付需要在微信商户平台开通权限,开通后取消注释
|
if (request.isMobile) {
|
||||||
// if (request.isMobile) {
|
if (!request.clientIp) {
|
||||||
// if (!request.clientIp) {
|
throw new Error('clientIp is required for H5 payment');
|
||||||
// throw new Error('clientIp is required for H5 payment');
|
}
|
||||||
// }
|
const h5Url = await createH5Order({
|
||||||
// const h5Url = await createH5Order({
|
out_trade_no: request.orderId,
|
||||||
// out_trade_no: request.orderId,
|
description: request.subject,
|
||||||
// description: request.subject,
|
notify_url: notifyUrl,
|
||||||
// notify_url: notifyUrl,
|
amount: request.amount,
|
||||||
// amount: request.amount,
|
payer_client_ip: request.clientIp,
|
||||||
// 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,
|
||||||
|
|||||||
Reference in New Issue
Block a user