<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\PayCenter\Util; use ModStart\Core\Util\AgentUtil; use ModStart\Module\ModuleManager; use Module\PayCenter\Provider\PayCenterProvider; use Module\PayCenter\Type\PayType; class PayUtil { public static function hasPay() { goto bcgyO; LhIwm: if (self::isAlipayWebEnable()) { return true; } goto WqKFJ; KPqWO: if (self::isAlipayEnable()) { return true; } goto LhIwm; bcgyO: if (self::isWechatEnable()) { return true; } goto KPqWO; OPjMY: return false; goto Nib8p; WqKFJ: if (self::isMemberMoneyEnable()) { return true; } goto jU1y0; jU1y0: foreach (PayCenterProvider::all() as $oMd7I) { if ($oMd7I->enable()) { return true; } } goto OPjMY; Nib8p: } public static function isPayEnable($ri8KE) { switch ($ri8KE) { case PayType::ALIPAY: return self::isAlipayEnable(); case PayType::ALIPAY_WEB: case PayType::ALIPAY_MOBILE: return self::isAlipayWebEnable(); case PayType::WECHAT: case PayType::WECHAT_MOBILE: case PayType::WECHAT_MINI_PROGRAM: case PayType::WECHAT_H5: return self::isWechatEnable(); case PayType::MEMBER_MONEY: return self::isMemberMoneyEnable(); case PayType::WECHAT_APP: return true; default: goto TOPv_; TOPv_: $oMd7I = PayCenterProvider::get($ri8KE); goto HiEHZ; O71kQ: break; goto NWS48; HiEHZ: if ($oMd7I) { return $oMd7I->enable(); } goto O71kQ; NWS48: } return false; } public static function isMemberMoneyEnable() { goto ncrYi; Isz_B: if (!ModuleManager::getModuleConfig('Member', 'moneyEnable', false)) { return false; } goto RjHfr; RjHfr: return boolval(modstart_config('payMemberMoneyOn', false)); goto AdNJw; ncrYi: if (!modstart_module_enabled('Member')) { return false; } goto Isz_B; AdNJw: } public static function isWechatEnable() { return boolval(modstart_config('payWechatOn', false)); } public static function isAlipayEnable() { return boolval(modstart_config('payAlipayOn', false)); } public static function isAlipayWebEnable() { return boolval(modstart_config('payAlipayWebOn', false)); } public static function preferShowQuick() { if (modstart_config('payQuickPreferEnable', false) && (self::isWechatEnable() || self::isAlipayEnable() || self::isAlipayWebEnable()) && !AgentUtil::isMobile()) { return true; } return false; } }