(string)mnbt_plugin_option_get('epay', 'apiurl', ''),
'pid' => (string)mnbt_plugin_option_get('epay', 'pid', ''),
'key' => (string)mnbt_plugin_option_get('epay', 'key', ''),
];
$configured = $cfg['apiurl'] !== '' && $cfg['pid'] !== '' && $cfg['key'] !== '';
// 计算站点根 URL(admin/plugin.php → 去掉 /admin)
$scriptName = str_replace('\\', '/', $_SERVER['SCRIPT_NAME'] ?? '');
$siteRoot = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https://' : 'http://')
. ($_SERVER['HTTP_HOST'] ?? 'localhost')
. substr($scriptName, 0, strrpos($scriptName, '/')); // 去掉 /plugin.php
// 再去掉末尾的 /admin(如果存在)
if (substr($siteRoot, -6) === '/admin') {
$siteRoot = substr($siteRoot, 0, -6);
}
// 回调地址统一用 index.php?_r= 兼容路由:不依赖服务器伪静态重写
$notifyUrl = $siteRoot . '/index.php?_r=/pay/epay/notify';
$returnUrl = $siteRoot . '/index.php?_r=/pay/epay/return';
?>
易支付设置
配置彩虹易支付协议的接口地址、商户 ID 与密钥
说明:本页仅配置易支付的 API 凭证。是否在客户端显示该插件的付款方式,请前往
支付设置 启用。
回调地址
在易支付商户后台无需手动配置,本插件自动注册
| 类型 | URL |
| 异步通知(notify_url) |
=htmlspecialchars($notifyUrl, ENT_QUOTES)?> |
| 同步返回(return_url) |
=htmlspecialchars($returnUrl, ENT_QUOTES)?> |
回调路径由系统通过通用路由自动注册,无需在 Web 服务器上单独配置。若使用 nginx,请确保未命中的请求被转发到 index.php(详见插件开发文档)。