对不同的支付方式经常会有不同的逻辑判断 国内常用的两种支付方式 微信支付宝的判断如何?
class CheckPayWay{
getClientType: function () {
var userAgent = navigator.userAgent.toLowerCase(), type = 'other';
if (userAgent.match(/Alipay/i) == "alipay") {
type = 'zfb';
} else if (userAgent.match(/MicroMessenger/i) == "micromessenger") {
type = 'wx';
}else{
return type
}
}
}
本文介绍了一种用于判断客户端支付方式的逻辑实现,通过分析用户代理信息来确定是使用微信还是支付宝进行支付,适用于国内常见的支付场景。
1565

被折叠的 条评论
为什么被折叠?



