Files
m2pool_payment/integration/wordpress/templates/settings.php

82 lines
3.7 KiB
PHP
Raw Normal View History

2025-11-18 17:26:07 +08:00
<?php
/**
* 设置页面模板
*/
if (!defined('ABSPATH')) {
exit;
}
?>
<div class="wrap">
<h1><?php echo esc_html__('M2Pool ETH 支付设置', 'm2pool-eth-payment'); ?></h1>
<form method="post" action="">
<?php wp_nonce_field('m2pool_eth_settings'); ?>
<table class="form-table">
<tr>
<th scope="row">
<label for="api_url"><?php echo esc_html__('API 地址', 'm2pool-eth-payment'); ?></label>
</th>
<td>
<input type="url" id="api_url" name="api_url" value="<?php echo esc_attr($api_url); ?>" class="regular-text" />
<p class="description"><?php echo esc_html__('支付系统的 API 地址,例如: http://localhost:8080', 'm2pool-eth-payment'); ?></p>
</td>
</tr>
<tr>
<th scope="row">
<label for="api_key"><?php echo esc_html__('API 密钥', 'm2pool-eth-payment'); ?></label>
</th>
<td>
<input type="text" id="api_key" name="api_key" value="<?php echo esc_attr($api_key); ?>" class="regular-text" />
<p class="description"><?php echo esc_html__('用于签名验证的 API 密钥', 'm2pool-eth-payment'); ?></p>
</td>
</tr>
<tr>
<th scope="row">
<label for="from_address"><?php echo esc_html__('发送地址', 'm2pool-eth-payment'); ?></label>
</th>
<td>
<input type="text" id="from_address" name="from_address" value="<?php echo esc_attr($from_address); ?>" class="regular-text" />
<p class="description"><?php echo esc_html__('用于发送支付的以太坊地址(可选)', 'm2pool-eth-payment'); ?></p>
</td>
</tr>
<tr>
<th scope="row">
<label for="to_address"><?php echo esc_html__('接收地址', 'm2pool-eth-payment'); ?></label>
</th>
<td>
<input type="text" id="to_address" name="to_address" value="<?php echo esc_attr($to_address); ?>" class="regular-text" />
<p class="description"><?php echo esc_html__('用于接收支付的以太坊地址', 'm2pool-eth-payment'); ?></p>
</td>
</tr>
<tr>
<th scope="row">
<label for="listen_interval"><?php echo esc_html__('监听间隔(秒)', 'm2pool-eth-payment'); ?></label>
</th>
<td>
<input type="number" id="listen_interval" name="listen_interval" value="<?php echo esc_attr($listen_interval); ?>" min="10" max="300" />
<p class="description"><?php echo esc_html__('检查支付状态的间隔时间(秒),建议 30-60 秒', 'm2pool-eth-payment'); ?></p>
</td>
</tr>
</table>
<p class="submit">
<input type="submit" name="m2pool_eth_save_settings" class="button button-primary" value="<?php echo esc_attr__('保存设置', 'm2pool-eth-payment'); ?>" />
</p>
</form>
<hr />
<h2><?php echo esc_html__('Webhook 设置', 'm2pool-eth-payment'); ?></h2>
<p><?php echo esc_html__('Webhook URL用于接收支付状态通知:', 'm2pool-eth-payment'); ?></p>
<code><?php echo esc_url(rest_url('m2pool-eth/v1/webhook')); ?></code>
<p class="description"><?php echo esc_html__('将此 URL 配置到您的支付系统中,以便接收支付状态更新', 'm2pool-eth-payment'); ?></p>
</div>