- phpcbf 自动修复 3893 处格式问题 - 添加 phpcs.xml 排除不适用的规则 - 安全相关规则降级为 warning 保持可见 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
42 lines
1.3 KiB
PHP
Executable file
42 lines
1.3 KiB
PHP
Executable file
<?php
|
||
$alipay_config['partner'] = '';
|
||
$alipay_config['key'] = '';
|
||
$alipay_config['sign_type'] = strtoupper( 'MD5' );
|
||
|
||
//字符编码格式 目前支持 gbk 或 utf-8
|
||
$alipay_config['input_charset'] = strtolower( 'utf-8' );
|
||
|
||
//访问模式,根据自己的服务器是否支持ssl访问,若支持请选择https;若不支持请选择http
|
||
$alipay_config['transport'] = isHTTPS() ? 'https' : 'http';
|
||
|
||
//支付API地址 - 固定配置
|
||
$alipay_config['apiurl'] = 'https://payments.weithemes.com/';
|
||
|
||
// 获取当前站点的正确域名,避免使用localhost
|
||
$site_url = get_site_url();
|
||
if ( strpos( $site_url, 'localhost' ) !== false || strpos( $site_url, '127.0.0.1' ) !== false ) {
|
||
// 开发环境下,使用一个可以被支付宝访问的测试域名
|
||
// 注意:实际部署时需要替换为真实的域名
|
||
$site_url = ''; // 请替换为你的实际域名
|
||
}
|
||
$return_url = $site_url . '/my-account/orders';
|
||
|
||
function isHTTPS() {
|
||
if ( defined( 'HTTPS' ) && HTTPS ) {
|
||
return true;
|
||
}
|
||
if ( ! isset( $_SERVER ) ) {
|
||
return false;
|
||
}
|
||
if ( ! isset( $_SERVER['HTTPS'] ) ) {
|
||
return false;
|
||
}
|
||
if ( $_SERVER['HTTPS'] === 1 ) { //Apache
|
||
return true;
|
||
} elseif ( $_SERVER['HTTPS'] === 'on' ) { //IIS
|
||
return true;
|
||
} elseif ( $_SERVER['SERVER_PORT'] == 443 ) { //其他
|
||
return true;
|
||
}
|
||
return false;
|
||
}
|