feat: 延期微信支付在微信内直接拉起
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 19m17s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 19m17s
- 微信支付下单带 app_type;拿到 pay_config 后与套餐购买一样拉起微信支付,继续支付同样处理 - 微信内打开时支付方式默认微信;取消支付保留同一请求号,再次确认不重复建单
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { markPendingPaymentRefresh, openAlipayPayment } from '@/utils/payment.js';
|
||||
import { isValidWechatPayConfig, markPendingPaymentRefresh, openAlipayPayment, wechatH5Pay } from '@/utils/payment.js';
|
||||
import { isPaymentLink } from '@/utils/silence.js';
|
||||
|
||||
export const SILENCE_REFRESH_TARGET = {
|
||||
@@ -19,6 +19,10 @@ const isInWechat = () => typeof navigator !== 'undefined' && /micromessenger/i.t
|
||||
* 在微信外且为链接时直接跳转;其余情况进入延期支付页展示二维码与链接。
|
||||
*/
|
||||
export const openSilencePayment = (order, refreshTarget) => {
|
||||
// 微信内直接支付(JSAPI):与套餐购买一致,用 pay_config 拉起微信支付
|
||||
if (order?.pay_config && isValidWechatPayConfig(order.pay_config)) {
|
||||
return wechatH5Pay(order.pay_config).then(() => ({ paid: true }));
|
||||
}
|
||||
const content = String(order?.qr_content || '').trim();
|
||||
if (!content) return Promise.reject(new Error('支付内容为空'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user