wp-woocommerce-pay/inc/easypay.config.php
feibisi daf7932d59
Some checks are pending
gitleaks 密钥泄露扫描 / gitleaks (push) Waiting to run
feicode/ai-security No obvious risky pattern in latest diff
WordPress 插件 CI / ci (push) Successful in -8h1m15s
fix: phpcbf 自动修复 + phpcs.xml 代码规范配置
- phpcbf 自动修复 3893 处格式问题
- 添加 phpcs.xml 排除不适用的规则
- 安全相关规则降级为 warning 保持可见

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-18 15:19:03 +08:00

42 lines
1.3 KiB
PHP
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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;
}