<?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 xx7dM; DJYOh: foreach (PayCenterProvider::all() as $sefXk) { if ($sefXk->enable()) { return true; } } goto hpp02; dgorF: if (self::isMemberMoneyEnable()) { return true; } goto DJYOh; xx7dM: if (self::isWechatEnable()) { return true; } goto SC1NM; SC1NM: if (self::isAlipayEnable()) { return true; } goto Oh0cY; hpp02: return false; goto YQtVS; Oh0cY: if (self::isAlipayWebEnable()) { return true; } goto dgorF; YQtVS: } public static function isPayEnable($xN3qr) { switch ($xN3qr) { 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 qCHVo; qZDwi: if ($sefXk) { return $sefXk->enable(); } goto Mnt2P; Mnt2P: break; goto VcLEv; qCHVo: $sefXk = PayCenterProvider::get($xN3qr); goto qZDwi; VcLEv: } return false; } public static function isMemberMoneyEnable() { goto osmrb; kf8rP: return boolval(modstart_config('payMemberMoneyOn', false)); goto llr6n; FROai: if (!ModuleManager::getModuleConfig('Member', 'moneyEnable', false)) { return false; } goto kf8rP; osmrb: if (!modstart_module_enabled('Member')) { return false; } goto FROai; llr6n: } 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; } }