? YuPay —— 让赞助管理成为一种享受
Minecraft 服务器的赞助体验从未如此优雅。
原生集成微信支付与支付宝、兑换码系统、退款审核、多语言支持、全生命周期事件监听——你所需要的一切,YuPay 一次性提供。免费,无中间商,无套路。100% 的收益直接打入你的账户。唯一的费用是支付宝和微信收取的手续费。
? 它是什么
YuPay 是一款专为 Minecraft 服务器设计的免费现代化支付插件。它将“赞助管理”的繁琐流程简化为四个步骤:发起 → 支付 → 收款 → 记录。每一步都自动化,每一步都可追溯。
服务器运营者用它来收取赞助费,玩家只需扫码即可完成支付。双方都能享受无忧的体验。支持微信支付和支付宝的直接 API 集成——无需第三方中转,资金安全掌握在你自己手中。
⚠️ 本插件适用于“玩家自愿赞助服务器运营”的场景。请确保使用符合当地法律法规及支付平台规定。
✨ 亮点一览
| 类别 |
功能特性 |
| ? 支付 |
微信 + 支付宝双渠道,Native QR 扫码支付,自动降级 fallback |
| ? 经济 |
支持 Vault + PlayerPoints 双引擎,一键切换 |
| ? 奖励 |
基础奖励、单笔里程碑、累计成就、限时冲刺——四层触发机制 |
| ? 兑换码 |
创建/兑换/查询/修改,支持付费激活码,日志完整 |
| ? 退款 |
玩家申请退款,管理员审批/拒绝,强制退款,部分退款 |
| ? 数据 |
排行榜、订单历史、页面浏览、一键复制订单号 |
| ? 多语言 |
默认中文 + 英文,服务器所有者可自定义任意语言,不同玩家显示不同语言 |
| ? PAPI |
40+ 占位符,可用于记分板/标题/物品描述 |
| ?️ 安全 |
签名验证、IP 白名单、24 小时事件监控、防重复发放 |
| ⚡ 性能 |
全异步处理,HikariCP 连接池,启动速度提升 600% |
| ? 扩展性 |
提供全生命周期事件 API,供开发者深度集成 |
| ? Wiki / DOC |
WIKI |
? 完整的赞助流程是怎样的
- 玩家执行命令,例如
/donate 50 wechat
- 系统异步创建订单,写入数据库
- 调用微信/支付宝 API 生成支付二维码
- 根据你的配置,在聊天中发送可点击链接、文本艺术二维码或背包中的地图二维码
- 玩家扫码并完成支付
- 支付平台回调通知你的服务器
- 插件验证签名,确认收款,发放奖励(经济货币 + 命令)
- 排行榜和占位符实时更新
- 所有日志写入,随时可追溯
完全自动化。你只需配置奖励,其余交给 YuPay 处理。
? 四种奖励层,自由组合
YuPay 的奖励系统就像一个乐高盒——四种触发模式你可以自由组合。
| 层级 |
触发条件 |
示例 |
| 基础奖励 |
每次成功支付 |
give {player} diamond 1 |
| 单笔里程碑 |
单笔支付达到阈值 |
50 元 → 5 个金块 |
| 累计成就 |
历史累计达到新高度 |
500 元 → SVIP 权限组 |
| 限时冲刺 |
指定时间段内累计 |
24 小时内 200 元 → 附魔金苹果 |
每一层的命令均可完全自定义,支持 {player}、{amount}、{points} 等变量,并可整合 LuckPerms、CMI 等权限/经济插件。
? 添加 -n(例如 /donate 10 -n)将使其成为无奖励赞助——纯粹支持服务器,不触发任何奖励。
? 兑换码系统:不止于优惠券
YuPay 的兑换码模块远超普通的“礼品码”:
- 免费码:玩家输入即可领取——非常适合活动赠送
- 付费激活码:玩家必须扫描并支付指定金额后才能兑换——适用于出售物品权益、兑换其他平台的码等
- 经济奖励:兑换时自动发放 Vault 货币或 PlayerPoints
- 自定义命令:每个码可以绑定一组在兑换时执行的命令
- 使用限制与过期时间:每个码独立控制
- 兑换码 PAPI:占位符可直接读取任意码的状态、金额、剩余使用次数
通过一条命令创建付费激活码:
/yp code create --code VIP2026 --amount 50 --economy vault --eco-amount 5000 --commands "lp user {player} parent set vip" --max-uses 100 --expire 30d
? 退款系统:坏账终结者
退款不再是一场噩梦。YuPay 的退款流程完整且令人安心:
- 玩家申请退款:提交申请并说明理由
- 管理员审核:有序地批准/拒绝
- 强制退款:紧急情况下的直接操作,无需等待审核
- 部分退款:灵活处理,精确到分
- 兑换码退款:退还资金并回滚使用次数,状态自动恢复
- 退款回调:对接微信/支付宝官方退款 API,资金原路返回
- 完整日志:谁退了、退了多少、何时、为何——一目了然
? 千人千语——告别语言冲突
国际服运营者的救星。
- 自带简体中文和英文完整翻译
- 服务器所有者可以在
language.mappings 中添加任意语言文件
- 玩家通过
/yp lang <language> 切换偏好,存储在数据库中,跨会话持久保存
- 新玩家自动检测客户端语言并匹配最佳翻译
- 同一服务器上的不同玩家看到不同的语言提示——真正实现个性化本地化
? 完整的 PAPI 占位符列表
YuPay 提供了 40+ 个内置的 PlaceholderAPI 占位符,涵盖个人、服务器、排行榜和兑换码四个维度。所有金额均保留两位小数。完整列表如下:
1. 个人维度(需要玩家上下文)
| 占位符 |
描述 |
示例返回值 |
%yupay_is_banned% |
玩家是否被禁止赞助 |
true / false |
%yupay_total% |
玩家的终身总赞助额(元) |
158.00 |
%yupay_total_orders% |
玩家的订单总数(包括失败的) |
7 |
%yupay_success_orders% |
玩家的成功订单数 |
5 |
%yupay_rank% |
玩家的赞助排名(未排名时显示语言文件中的文本) |
3 或 Not ranked |
%yupay_has_paid_in_<time>% |
玩家在过去 <time> 毫秒内是否有过赞助行为 |
true / false |
%yupay_recent_amount_gt_<time>_<amount>% |
过去 <time> 毫秒内的赞助金额是否超过 <amount> 元 |
true / false |
%yupay_orders_in_<time>% |
过去 <time> 毫秒内的订单数量(包括失败的) |
2 |
%yupay_success_orders_in_<time>% |
过去 <time> 毫秒内的成功订单数 |
2 |
%yupay_amount_in_<time>% |
过去 <time> 毫秒内的总赞助金额(元) |
75.50 |
%yupay_is_limited% |
今日赞助是否已达到每日上限 |
true / false |
%yupay_daily_remaining% |
今日剩余的赞助额度(元) |
450.00 |
%yupay_lang% |
玩家当前的语言标识符 |
zh_cn |
%yupay_pay_methods_count% |
当前可用的支付渠道数量 |
2 |
%yupay_pay_methods_list% |
可用支付渠道名称列表(逗号分隔) |
wechat, alipay |
? 动态参数:<time> 单位为毫秒(例如 86400000 = 24小时),<amount> 为金额阈值(元)。所有金额占位符均保留两位小数。
2. 服务器维度(无需玩家)
| 占位符 |
描述 |
示例返回值 |
%yupay_server_total% |
服务器的终身总赞助额(元) |
12850.75 |
%yupay_server_total_orders% |
服务器的订单总数(包括失败的) |
312 |
%yupay_server_success_orders% |
服务器的成功订单数 |
289 |
%yupay_server_orders_in_<time>% |
过去 <time> 毫秒内的服务器订单数 |
45 |
%yupay_server_success_orders_in_<time>% |
过去 <time> 毫秒内的服务器成功订单数 |
42 |
%yupay_server_amount_in_<time>% |
过去 <time> 毫秒内的服务器总赞助额(元) |
3200.00 |
3. 排行榜维度(无需玩家)
支持两种格式(推荐第一种):
| 占位符 |
描述 |
示例返回值 |
%yupay_top_<rank>_name% |
排名第 N 位的玩家名称 |
Steve |
%yupay_top_<rank>_amount% |
排名第 N 位的总赞助额(元) |
2000.00 |
%yupay_top<rank>_name% |
(旧版格式)同上 |
Alex |
%yupay_top<rank>_amount% |
(旧版格式)同上 |
1500.00 |
<rank> 范围为 1 ~ 10。如果该排名不存在,名称将返回语言文件中的备用文本(默认为 "None"),金额返回 0.00。
4. 兑换码维度
包含全局统计(无需玩家)和特定代码属性(其中 redeemed 和 can_redeem 需要玩家上下文)。
全局统计
| 占位符 |
描述 |
示例返回值 |
%yupay_code_total% |
兑换码总数 |
25 |
%yupay_code_active% |
有效兑换码数量(状态为 ACTIVE) |
18 |
特定代码属性 — 将 <code> 替换为实际的代码字符串(自动转为大写)
| 占位符 |
描述 |
示例 (code = VIP2026) |
%yupay_code_<code>_status% |
当前代码状态 |
ACTIVE |
%yupay_code_<code>_amount% |
所需支付金额(元) |
50.00 |
%yupay_code_<code>_economy_type% |
经济奖励类型 |
vault |
%yupay_code_<code>_economy_amount% |
经济奖励金额 |
5000.00 |
%yupay_code_<code>_used% |
已兑换次数 |
23 |
%yupay_code_<code>_max_uses% |
最大兑换次数(-1 表示无限) |
100 |
%yupay_code_<code>_expire% |
过期时间戳(毫秒),-1 表示永不过期 |
1798675199999 |
%yupay_code_<code>_expire_formatted% |
格式化后的过期时间 |
2026-12-31 23:59 |
%yupay_code_<code>_remark% |
代码备注 |
"VIP activation code" |
%yupay_code_<code>_locked% |
是否被某笔支付锁定(有人正在支付) |
true / false |
%yupay_code_<code>_redeemed% |
当前玩家是否已兑换此代码 |
true / false |
%yupay_code_<code>_can_redeem% |
当前玩家现在是否可以兑换(综合检查) |
true / false |
? _can_redeem 检查逻辑:代码状态正常、未过期、剩余使用次数大于 0、未被他人锁定,且当前玩家尚未兑换。
使用说明
- 所有金额占位符单位均为
yuan(元),保留两位小数,例如 99.50。整数金额也会显示 .00。
- 动态时间参数
<time> 始终使用毫秒——24小时 = 86400000,7天 = 604800000。
- 占位符中的代码字符串会自动转为大写;输入小写同样有效。
- 服务器和排行榜占位符不需要玩家上下文;个人维度和部分代码占位符需要玩家,否则返回空值或默认值。
- 占位符可在任何支持 PlaceholderAPI 的插件中使用(如记分板、BossBar、DeluxeTags、聊天前缀、物品描述等)。
? 给开发者的礼物
如果你能编写插件,以下事件会让你的二次开发体验如虎添翼:
| 事件 |
触发时机 |
可修改参数 |
PrePaymentEvent |
支付前 |
金额、支付方式、订单 ID、取消标志 |
PaymentOrderCreatedEvent |
订单创建成功 |
只读(含二维码 URL) |
PaymentCompletedEvent |
支付成功 + 奖励发放 |
只读(完整数据) |
PaymentFailedEvent |
支付失败/取消 |
只读 |
RefundCompletedEvent |
退款完成 |
只读 |
RedeemCodeRedeemedEvent |
兑换码已使用 |
只读 |
RedeemCodeLifetimeEvent |
兑换码状态变更 |
只读(旧状态 → 新状态) |
PlayerPointsChangedEvent |
经济系统变化 |
只读 |
所有事件均支持同步拦截。你可以在订单创建前进行拦截,在支付后联动其他系统,或在退款时同步数据——赞助生命周期的每一个细节均可观测。
?️ 安全不止于空谈
- 签名验证:微信/支付宝回调均经过完整的签名验证,防止伪造
- 防重复发放:通过订单状态检查 + 幂等处理机制保障
- IP 白名单:回调接口可限制仅允许官方支付平台 IP 访问
- TLS/HTTPS:支持证书加密通信
- 事件监控:执行
/yp audit 一键审计,24小时监控哪些插件正在监听 YuPay 的资金事件
- 地图虚拟锁:当支付二维码放置在物品栏时,玩家会被锁定位置,无法丢弃或切换物品,完成支付后解锁
⚡ 极速启动
重写后的依赖加载系统意味着 YuPay 不再需要繁琐的 JVM 启动参数。所有依赖自动管理,验证速度提升 600%,开箱即用。将其放入 plugins 文件夹,启动服务器,即可直接使用。
? 数据触手可及
/yp history 是你使用频率最高的命令之一。订单历史记录支持分页浏览,点击订单 ID 即可一键复制——对账效率翻倍。
/yp top 让你随时了解谁在为服务器做出贡献——排行榜数据与占位符实时同步。
/yp total 查看个人统计,/yp total all 查看全服统计——一切尽在掌握。
? 两分钟快速上手指南
- 将
YuPay.jar 放入 plugins/ 文件夹
- 启动服务器,等待生成
config.yml 和 messages.yml
- 打开
config.yml,填写你的微信/支付宝参数
- 确保服务器防火墙和安全组中开放了回调端口(默认
8080)
- 在游戏中输入
/donate 0.01 测试小额支付
- 确认回调正常且奖励到账——正式营业 ?
? 为什么服务器所有者选择 YuPay
- ✅ 稳定:经生产环境验证,兼容 Spigot/Paper 1.8 至最新版本
- ✅ 可靠:直连官方 API,无中间商,资金直接进入你的账户
- ✅ 无忧:从支付到奖励全自动运行,只需简单配置
- ✅ 灵活:奖励逻辑完全可编程,命令别名自由定义
- ✅ 安全:签名验证 + 防重复 + IP 白名单 + 事件监控
- ✅ 透明:每笔订单、每次退款、每个兑换码均有日志记录
- ✅ 持续演进:积极维护,不断迭代,由社区驱动
? 插件 QQ 讨论群:1080918424
遇到问题、提出功能建议,或者只是聊聊天——欢迎加入。YuPay 的每一次改进都源于服务器所有者的反馈。
? 爱发电赞助作者:
如果 YuPay 帮助了你的服务器,请考虑给作者买杯奶茶 ~ 你的支持是插件持续演化的最大动力。
别再为赞助管理头疼。把专业的事交给 YuPay,专注于运营好你的服务器。
? YuPay 操作手册
1. 环境要求
| 项目 |
要求 |
| 服务端 |
Spigot / Paper / 兼容分支 / 兼容混合服务端,1.8 – 1.26+ |
| Java |
JDK 8 或更高版本 |
| 可选依赖 |
Vault (经济), PlayerPoints (点数), PlaceholderAPI (占位符), ProtocolLib (地图锁) |
? 好消息:你不再需要为 Java 9+ 手动添加 JVM 启动参数。YuPay 最新版本内置智能依赖管理——开箱即用。
2. 安装与启动
- 下载
YuPay.jar,放置在服务端的 plugins/ 目录中
- 启动服务器,插件将自动生成
config.yml、messages.yml 以及 SQLite 数据库文件
- 编辑
plugins/YuPay/config.yml,填写支付渠道配置参数
- 根据你的支付方式,在支付平台后台配置回调地址:
- 微信:
http(s)://your-domain-or-ip:port/pay/wechat/notify
- 支付宝:
http(s)://your-domain-or-ip:port/pay/alipay/notify
- 确保防火墙和安全组中开放了回调端口(默认
8080)
- 执行
/yupay reload 或在控制台输入 reload 以应用配置
- 在游戏中输入
/donate 0.01 测试小额支付
3. 配置快速参考
3.1 核心支付参数
| 路径 |
描述 |
示例 |
pay.default-method |
默认支付方式 |
wechat / alipay |
pay.min-amount |
单笔订单最低金额(元) |
0.01 |
pay.max-amount |
单笔订单最高金额(-1 = 无限制) |
500 |
pay.max-daily-amount |
每日累计限额(-1 = 无限制) |
1000 |
pay.order-subject |
订单标题模板 |
Sponsorship-{player}-{amount}yuan |
3.2 微信支付参数
| 路径 |
说明 |
wechat.enabled |
启用(true/false) |
wechat.mchid |
商户号 |
wechat.appid |
公众号 / 小程序 AppID |
wechat.serial-no |
API 证书序列号 |
wechat.private-key-path |
商户私钥(相对于 pems/ 目录的路径) |
wechat.public-key-path |
平台公钥(相对于 pems/ 目录的路径) |
wechat.public-key-id |
平台公钥 ID |
wechat.api-v3-key |
API v3 密钥(32 个字符) |
wechat.notify-url |
完整的回调通知 URL |
3.3 支付宝参数
| 路径 |
说明 |
alipay.enabled |
启用 |
alipay.mode |
public_key 或 cert |
alipay.app-id |
应用 ID |
alipay.merchant-private-key |
商户私钥(PKCS8 格式,不含头尾标识) |
alipay.alipay-public-key |
支付宝公钥(public_key 模式下必需) |
alipay.app-cert-path |
应用公钥证书(cert 模式下使用) |
alipay.alipay-cert-path |
支付宝公钥证书(cert 模式下使用) |
alipay.alipay-root-cert-path |
支付宝根证书(cert 模式下使用) |
alipay.notify-url |
异步通知 URL |
alipay.return-url |
同步返回 URL |
3.4 经济系统
| 路径 |
说明 |
economy.enabled |
启用经济奖励 |
economy.type |
vault 或 playerpoints |
economy.rate |
1 元 = 多少游戏内货币/积分 |
3.5 二维码显示
| 路径 |
说明 |
qrcode.default-output-mode |
link / text / map |
qrcode.text-qr-size |
文本模式下的 QR 码边长(字符数,默认 12) |
qrcode.text-black-char |
黑色像素字符(默认 ██) |
qrcode.api-url |
链接模式下的图片生成 API |
3.6 回调服务器
| 路径 |
说明 |
callback.port |
监听端口 |
callback.host |
绑定地址(0.0.0.0 = 所有接口) |
callback.io-threads |
IO 线程数量 |
callback.worker-threads |
工作线程数量 |
callback.allowed-ips |
IP 白名单(CIDR 格式,为空则允许所有) |
callback.access-log |
启用访问日志 |
3.7 数据库
| 路径 |
说明 |
database.type |
sqlite(单机版)或 mysql(多服同步) |
database.mysql.* |
MySQL 连接参数 |
database.connection-pool.* |
HikariCP 连接池参数 |
database.table-names.prefix |
表前缀,用于避免冲突 |
database.table-names.* |
各业务表的名称(可自定义) |
4. 完整奖励配置指南
4.1 基础奖励 (on-success)
每次成功支付时执行——适用于“每次赞助均给予基础奖励”的场景。
commands:
on-success:
- "give {player} diamond 1"
- "effect give {player} minecraft:speed 30 1"
可用变量:{player}(玩家名称)、{amount}(金额)、{points}(获得的经济点数)
4.2 单次里程碑 (on-single-achieved)
当单笔支付达到设定金额时触发。请将金额从低到高排序,支持多个层级。
commands:
on-single-achieved:
- amount: 50
commands:
- "say {player} 在单次赞助中达到了 50 元!"
- "give {player} minecraft:gold_block 5"
- amount: 100
commands:
- "give {player} minecraft:diamond_block 3"
- "lp user {player} parent set vip"
4.3 累计成就 (on-total-achieved)
当历史累计总额达到新高度时触发。每个层级仅触发一次——内置防重复机制。
commands:
on-total-achieved:
- total: 100
commands:
- "lp user {player} parent set vip"
- total: 1000
commands:
- "lp user {player} parent set ultimate"
- "give {player} minecraft:beacon 1"
4.4 限时冲刺奖励 (on-recent-achieved)
当指定时间段(毫秒)内的累计金额达到目标时触发。非常适合节假日活动、周末排行榜冲刺等场景。
commands:
on-recent-achieved:
- time: 86400000 # 24 小时
total: 200
commands:
- "give {player} minecraft:enchanted_golden_apple 5"
- time: 604800000 # 7 天
total: 500
commands:
- "give {player} minecraft:elytra 1"
4.5 退款触发命令 (on-refund)
退款成功后执行——可用于通知管理员、记录事件等。
commands:
on-refund:
- "say {player} 的订单 {order} 已退款 {amount} 元"
5. 命令系统
5.1 玩家命令
| 命令 |
功能 |
默认别名 |
/donate <amount> [payment] [output] [-n] |
发起赞助 |
/pay, /zanzhu |
/ytop |
赞助排行榜 Top10 |
/paytop, /yt |
/ytotal [player|all] |
查询总赞助额 |
/paytotal, /ytt |
/yp history [page] |
我的赞助历史 |
/yupay history |
/yp lang [language] |
切换个人语言偏好 |
|
/yp code redeem <code> |
兑换代码 |
|
/yp cancel |
取消当前地图支付 |
|
? -n 标志表示“无奖励赞助”——纯服务器支持,不触发任何奖励命令或经济物品。
5.2 管理员命令
| 命令 |
功能 |
/yp reload |
热重载配置 |
/yp set <option> <value> |
在线更改配置 |
/yp config |
查看当前核心配置 |
/yp ban <player|all> [reason] |
禁止赞助(all = 全局封禁) |
/yp unban <player|all> |
解除封禁 |
/yp convert <player> <from> <to> <amount> |
货币转换(vault/points) |
/yp audit |
审计所有监听 YuPay 事件的插件 |
/yp history <player> [page] |
查看任意玩家的订单历史 |
/yp code create ... |
创建兑换码 |
/yp code list [page] |
列出兑换码 |
/yp code info <code> |
查看兑换码详情 |
/yp code modify <code> <field> <newvalue> |
修改兑换码参数 |
/yp code delete <code> |
禁用兑换码(软删除) |
/yp code logs [code] [page] |
查看兑换日志 |
/yp refund <order-id> [amount] |
直接退款 |
/yp refund list [page] |
退款日志 |
/yp refund request <order-id> [amount] |
提交退款审核请求 |
/yp refund pending [page] |
查看待处理的退款请求 |
/yp refund approve <request-id> |
批准请求 |
/yp refund reject <request-id> |
拒绝请求 |
5.3 关键权限节点
| 权限节点 |
操作 |
yupay.command.pay |
发起赞助 |
yupay.command.top |
查看排行榜 |
yupay.command.total |
查询总赞助额 |
yupay.command.history |
查看订单历史 |
yupay.reload |
重载配置 |
yupay.ban |
管理黑名单 |
yupay.convert |
货币转换 |
yupay.audit |
事件监听器审计 |
yupay.admin |
包含上述所有管理员权限 |
6. 兑换码系统深入解析
6.1 创建兑换码命令详解
创建兑换码使用 --param value 格式的名称参数,可自由组合:
# 免费福利码(无限次数,永不过期)
/yp code create --code FREEGIFT --max-uses -1 --economy vault --eco-amount 100 --remark "新玩家礼物"
# 付费激活码(支付 50 元兑换,100 次使用机会,30 天后过期)
/yp code create --code PREMIUM --amount 50 --economy vault --eco-amount 5000 --max-uses 100 --expire 30d --commands "lp user {player} parent set vip"
# 仅执行命令的兑换码(无经济系统,无需付款)
/yp code create --code WELCOME --commands "give {player} diamond 5; say {player} Welcome back!"
参数快速参考:
| 参数 |
描述 |
示例 |
--code |
兑换码字符串(自动转大写) |
VIP2026 |
--amount |
所需支付金额(0 = 免费) |
50 |
--economy |
经济系统类型(vault / playerpoints / none) |
vault |
--eco-amount |
经济系统奖励金额 |
5000 |
--max-uses |
最大兑换次数(-1 = 无限) |
100 |
--expire |
过期时间(30d / 24h / 2026-12-31 / never) |
30d |
--commands |
兑换时执行的命令(分号分隔) |
"cmd1; cmd2" |
--remark |
备注说明 |
"VIP 激活码" |
6.2 兑换码状态说明
| 状态 |
含义 |
ACTIVE |
可用 |
DEPLETED |
使用次数已耗尽(自动) |
EXPIRED |
已过期(自动) |
DISABLED |
由管理员手动禁用 |
6.3 兑换码 PAPI 占位符
以兑换码 VIP2026 为例:
| 占位符 |
返回示例 |
%yupay_code_total% |
兑换码总数 |
%yupay_code_active% |
活跃兑换码数量 |
%yupay_code_VIP2026_status% |
ACTIVE |
%yupay_code_VIP2026_amount% |
50.00 |
%yupay_code_VIP2026_used% |
23 |
%yupay_code_VIP2026_max_uses% |
100 |
%yupay_code_VIP2026_expire_formatted% |
2026-12-31 23:59 |
%yupay_code_VIP2026_can_redeem% |
true / false |
%yupay_code_VIP2026_locked% |
true / false |
%yupay_code_VIP2026_redeemed% |
当前玩家是否已兑换 |
7. 退款系统深入解析
7.1 退款方式对比
| 方式 |
命令示例 |
使用场景 |
| 直接退款 |
/yp refund ORDER001 50 |
确认需要退款,快速处理 |
| 强制退款 |
/yp refund ORDER001 50 -f |
跳过金额检查,直接退款 |
| 部分退款 |
/yp refund ORDER001 30 |
退还部分金额 |
| 审批流程 |
/yp refund request ORDER001 → 等待批准 |
需要审批的场景 |
| 兑换码退款 |
/yp refund -r <redemption-log-id> |
退还兑换码费用并恢复使用次数 |
7.2 退款审批流程
- 玩家或管理员提交退款请求:
/yp refund request <order-id> [amount]
- 管理员查看待处理列表:
/yp refund pending
- 批准或拒绝:
/yp refund approve <request-id> / reject
- 批准后,实际退款自动执行;拒绝后,通知申请人
7.3 退款后的处理
- 支付平台(微信/支付宝)接收退款请求,资金退回原支付方式
- 插件更新订单退款状态(
FULL_REFUND / PARTIAL_REFUND)
- 如果是兑换码退款:兑换码使用次数 -1,状态恢复为
ACTIVE
- 执行
commands.on-refund 中配置的命令
- 触发
RefundCompletedEvent 供其他插件响应
- 完整的退款日志写入数据库
8. 多语言系统
8.1 添加语言
在 config.yml 的 language.mappings 节点下添加:
language:
mappings:
zh_cn:
file: "messages.yml"
aliases: [zh, cn, chinese]
client-locales: ["zh_cn", "zh_*"]
en:
file: "messages_en.yml"
aliases: [english, eng]
client-locales: ["en_*"]
ja:
file: "messages_ja.yml"
aliases: [japanese, jp]
client-locales: ["ja_*"]
然后创建 plugins/YuPay/messages_ja.yml,基于 messages.yml 进行翻译。插件将自动填充缺失的键值。
8.2 切换语言
- 玩家手动切换语言:
/yp lang en(支持别名,例如 english)
- 首次加入时自动检测客户端语言并匹配最佳翻译
- 语言偏好保存在数据库中,跨会话记忆
9. 数据库选型指南
| 服务器规模 |
推荐类型 |
原因 |
| 单个小型服务器 |
SQLite |
零配置,开箱即用 |
| 多服网络 |
MySQL |
数据统一,跨服同步 |
| 大型网络 |
MySQL + 连接池 |
支持高并发,复用连接 |
10. 常见问题排查
回调服务器启动失败
- 检查端口是否被占用
- 确认防火墙/安全组已开放该端口
- 查看控制台错误日志
支付成功但未收到奖励
- 检查数据库中订单的
status 字段——应为 SUCCESS
- 确认
economy.enabled 和 commands.enabled 均为 true
- 检查控制台中是否有经济插件加载错误的报错
地图二维码未显示
- 确认已安装与服务器版本匹配的 ProtocolLib
- 检查
qrcode.default-output-mode 是否设置为 map
- 若缺少 ProtocolLib,模式将自动回退为
link
微信支付提示找不到公钥文件
- 检查
plugins/YuPay/pems/ 目录是否存在
- 确认
wechat.public-key-path 路径正确
- 前往微信商户平台 → API 安全 → API 证书 → 下载平台证书
插件升级后配置文件丢失
- YuPay 内置智能配置升级器——会自动备份旧文件(添加
.bak 后缀)并合并新键值
- 升级前手动备份可更安心
11. 数据库表结构
| 表名 |
存储内容 |
yu_payments |
所有支付订单,含退款状态 |
yu_total_levels |
累计奖励档位记录 |
yu_banned_players |
赞助黑名单 |
yu_player_lang |
玩家语言偏好 |
yu_redeem_codes |
兑换码主表 |
yu_redeem_logs |
兑换记录 |
yu_refund_logs |
退款操作日志 |
yu_refund_requests |
退款审核请求 |
12. 卸载步骤
- 执行
/yp reload(确保内存中的配置已刷新)
- 停止服务器
- 删除
plugins/YuPay.jar
- 如需彻底移除,请删除
plugins/YuPay 文件夹(包括数据库)
? 插件交流群:1080918424
不要独自挣扎——带上你的日志和配置文件截图进群,作者和热心服主都在。
? 在爱发电支持作者:
如果 YuPay 帮助了你的服务器,不妨请作者喝杯奶茶 ~ 你的支持是插件持续进化的最大动力。
? YuPay —— Make Sponsorship Management a Pleasure
Minecraft server sponsorship has never been been this elegant.
Direct integration with WeChat Pay & Alipay, redeem code system, refund review, multi-language, full lifecycle event listening — everything you need, YuPay delivers it all at once. Free, no middlemen, no tricks. 100% of the revenue goes straight to your account. The only fees are those charged by Alipay and WeChat.
? What Is It
YuPay is a free, modern payment plugin tailored for Minecraft servers. It breaks down the hassle of "sponsorship management" into four steps: Initiate → Pay → Receive → Record. Every step is automated, every step traceable.
Server operators use it to collect sponsorships, players use it to scan and pay. Both sides enjoy a worry-free experience. Supports direct API integration with WeChat Pay and Alipay — no third-party relay, your funds stay secure in your own hands.
⚠️ This plugin is designed for scenarios where "players voluntarily sponsor server operations". Please ensure usage complies with local laws and payment platform regulations.
✨ Highlights at a Glance
| Category |
What You Get |
| ? Payment |
WeChat + Alipay dual channels, Native QR scan payment, automatic fallback |
| ? Economy |
Vault + PlayerPoints dual support, one-click switch |
| ? Rewards |
Base rewards, single milestone, total achievements, limited-time sprints — four trigger layers |
| ? Redeem Code |
Create/redeem/query/modify, supports paid codes, complete logs |
| ? Refund |
Players can request refunds, admin approve/deny, forced refund, partial refund |
| ? Data |
Leaderboards, order history, page browsing, one-click copy order ID |
| ? Multi-language |
Default Chinese + English, server owners can customize any language, different players see different languages |
| ? PAPI |
40+ placeholders, use in scoreboards/titles/item lore |
| ?️ Security |
Signature verification, IP whitelist, 24h event monitoring, anti-duplicate delivery |
| ⚡ Performance |
Fully async, HikariCP connection pool, 600% startup speed boost |
| ? Extensibility |
Full lifecycle event API for deep integration by developers |
| ? Wiki / DOC |
WIKI |
? What a Complete Sponsorship Looks Like
- Player executes a command, e.g.
/donate 50 wechat
- System creates order asynchronously, writes to database
- Calls WeChat/Alipay API to generate payment QR code
- Depending on your config, sends clickable link, text-art QR in chat, or map QR in inventory
- Player scans and completes payment
- Payment platform calls back to your server
- Plugin verifies signature, confirms receipt, grants rewards (economy + commands)
- Leaderboard and placeholders update in real time
- All logs written, traceable anytime
Fully automated. You just configure the rewards, YuPay handles the rest.
? Four Reward Layers, Mix and Match
YuPay's reward system is like a Lego box — four trigger modes you can combine freely.
| Layer |
Trigger |
Example |
| Base Reward |
Every successful payment |
give {player} diamond 1 |
| Single Milestone |
Single payment reaches threshold |
50 yuan → 5 gold blocks |
| Total Achievement |
Lifetime total reaches new height |
500 yuan → SVIP permission group |
| Limited Sprint |
Cumulative within specified time period |
200 yuan in 24h → enchanted golden apple |
Each layer's commands are fully customizable, support variables like {player}, {amount}, {points}, and can integrate with permission/economy plugins like LuckPerms, CMI, etc.
? Adding -n (e.g. /donate 10 -n) makes it a no-reward sponsorship — pure server support, no rewards triggered.
? Redeem Code System: More Than Just a Voucher
YuPay's redeem code module goes far beyond typical "gift codes":
- Free codes: Players enter to claim — great for event giveaways
- Paid activation codes: Players must scan and pay a specified amount before redeeming — suitable for selling item entitlements, redeeming codes from other platforms, etc.
- Economy rewards: Automatically grant Vault currency or PlayerPoints upon redemption
- Custom commands: Each code can bind a set of commands executed on redemption
- Usage limits & expiry: Independent control per code
- Code PAPI: Placeholders directly read any code's status, amount, remaining uses
Create a paid activation code with a single command:
/yp code create --code VIP2026 --amount 50 --economy vault --eco-amount 5000 --commands "lp user {player} parent set vip" --max-uses 100 --expire 30d
? Refund System: Bad Debt Terminator
Refunds are no longer a nightmare. YuPay's refund process is complete and reassuring:
- Players request refund: Submit application with reason
- Admin reviews: Approve/deny in an orderly manner
- Forced refund: Direct operation for urgent cases, no waiting for review
- Partial refund: Flexible handling, precise to the cent
- Code refund: Refund money and rollback usage count, status automatically restored
- Refund callback: Interfaces with WeChat/Alipay official refund API, money returns to original payment method
- Complete logs: Who refunded, how much, when, why — all clear
? Thousand Players, Thousand Languages — No Language Fights
A lifesaver for international server operators.
- Comes with Simplified Chinese and English complete translations
- Server owners can add any language file in
language.mappings
- Players switch preference with
/yp lang <language>, stored in database, persists across sessions
- New players automatically detect client language and match the best translation
- Different players on the same server see different language prompts — truly per-player localization
? Complete PAPI Placeholder List
YuPay provides 40+ built-in PlaceholderAPI placeholders, covering personal, server, leaderboard, and redeem code dimensions. All monetary values keep two decimal places. Full list below:
1. Personal Dimension (requires player context)
| Placeholder |
Description |
Example Return |
%yupay_is_banned% |
Whether the player is banned from sponsoring |
true / false |
%yupay_total% |
Player's lifetime total sponsorship (yuan) |
158.00 |
%yupay_total_orders% |
Player's total orders (including failed) |
7 |
%yupay_success_orders% |
Player's successful orders |
5 |
%yupay_rank% |
Player's sponsorship rank (off-rank shows text from language file) |
3 or Not ranked |
%yupay_has_paid_in_<time>% |
Whether the player has sponsored within the last <time> milliseconds |
true / false |
%yupay_recent_amount_gt_<time>_<amount>% |
Whether sponsorship amount in last <time> ms exceeds <amount> yuan |
true / false |
%yupay_orders_in_<time>% |
Number of orders in last <time> ms (including failed) |
2 |
%yupay_success_orders_in_<time>% |
Successful orders in last <time> ms |
2 |
%yupay_amount_in_<time>% |
Total sponsorship amount in last <time> ms (yuan) |
75.50 |
%yupay_is_limited% |
Whether today's sponsorship has reached daily limit |
true / false |
%yupay_daily_remaining% |
Remaining sponsorship amount for today (yuan) |
450.00 |
%yupay_lang% |
Player's current language identifier |
zh_cn |
%yupay_pay_methods_count% |
Number of currently available payment channels |
2 |
%yupay_pay_methods_list% |
List of available payment channel names (comma-separated) |
wechat, alipay |
? Dynamic parameters: <time> is in milliseconds (e.g. 86400000 = 24h), <amount> is monetary threshold (yuan). All monetary placeholders retain two decimals.
2. Server Dimension (no player needed)
| Placeholder |
Description |
Example Return |
%yupay_server_total% |
Server's lifetime total sponsorship (yuan) |
12850.75 |
%yupay_server_total_orders% |
Server's total orders (including failed) |
312 |
%yupay_server_success_orders% |
Server's successful orders |
289 |
%yupay_server_orders_in_<time>% |
Server orders in last <time> ms |
45 |
%yupay_server_success_orders_in_<time>% |
Server successful orders in last <time> ms |
42 |
%yupay_server_amount_in_<time>% |
Server total sponsorship in last <time> ms (yuan) |
3200.00 |
3. Leaderboard Dimension (no player needed)
Two formats supported (first recommended):
| Placeholder |
Description |
Example Return |
%yupay_top_<rank>_name% |
Player name at rank N |
Steve |
%yupay_top_<rank>_amount% |
Total sponsorship at rank N (yuan) |
2000.00 |
%yupay_top<rank>_name% |
(legacy format) Same as above |
Alex |
%yupay_top<rank>_amount% |
(legacy format) Same as above |
1500.00 |
<rank> ranges 1 ~ 10. If rank doesn't exist, name returns fallback text from language file (default "None"), amount returns 0.00.
4. Redeem Code Dimension
Includes global statistics (no player needed) and specific code attributes (where redeemed and can_redeem require player context).
Global Statistics
| Placeholder |
Description |
Example Return |
%yupay_code_total% |
Total number of codes |
25 |
%yupay_code_active% |
Number of active codes (status ACTIVE) |
18 |
Specific Code Attributes — replace <code> with actual code string (auto-uppercase)
| Placeholder |
Description |
Example (code = VIP2026) |
%yupay_code_<code>_status% |
Current status of the code |
ACTIVE |
%yupay_code_<code>_amount% |
Required payment amount (yuan) |
50.00 |
%yupay_code_<code>_economy_type% |
Economy reward type |
vault |
%yupay_code_<code>_economy_amount% |
Economy reward amount |
5000.00 |
%yupay_code_<code>_used% |
Number of times redeemed |
23 |
%yupay_code_<code>_max_uses% |
Max redeem count (-1 = unlimited) |
100 |
%yupay_code_<code>_expire% |
Expiry timestamp (ms), -1 = never |
1798675199999 |
%yupay_code_<code>_expire_formatted% |
Formatted expiry time |
2026-12-31 23:59 |
%yupay_code_<code>_remark% |
Code remark |
"VIP activation code" |
%yupay_code_<code>_locked% |
Whether locked by a payment (someone is paying) |
true / false |
%yupay_code_<code>_redeemed% |
Whether current player has redeemed this code |
true / false |
%yupay_code_<code>_can_redeem% |
Whether current player can redeem now (comprehensive check) |
true / false |
? _can_redeem checks: code status normal, not expired, uses left, not locked by others, and current player hasn't redeemed it.
Usage Notes
- All monetary placeholders are in
yuan, with two decimal places, e.g. 99.50. Integer amounts also show .00.
- Dynamic time parameter
<time> always uses milliseconds — 24h = 86400000, 7d = 604800000.
- Code strings in placeholders are auto-uppercased; lowercase input works too.
- Server and leaderboard placeholders do not require a player context; personal and some code placeholders require a player or return empty/default.
- Placeholders work in any plugin that supports PlaceholderAPI (scoreboard, BossBar, DeluxeTags, chat prefix, item lore, etc.).
? Gift for Developers
If you can write plugins, these events will make your secondary development experience fly:
| Event |
Trigger |
Modifiable Parameters |
PrePaymentEvent |
Before payment |
amount, payment method, order ID, cancel flag |
PaymentOrderCreatedEvent |
Order created successfully |
read-only (has QR URL) |
PaymentCompletedEvent |
Payment success + rewards granted |
read-only (full data) |
PaymentFailedEvent |
Payment failed / canceled |
read-only |
RefundCompletedEvent |
Refund completed |
read-only |
RedeemCodeRedeemedEvent |
Code redeemed |
read-only |
RedeemCodeLifetimeEvent |
Code status changed |
read-only (old → new state) |
PlayerPointsChangedEvent |
Economy changed |
read-only |
All events support sync. You can intercept before order creation, trigger联动 other systems after payment, sync data on refund — every detail of the sponsorship lifecycle is observable.
?️ Security Is Not Just Talk
- Signature verification: WeChat/Alipay callbacks are fully signature-verified against forgery
- Anti-duplicate delivery: Order status check + idempotent handling
- IP whitelist: Callback interface can restrict access to official payment platform IPs only
- TLS/HTTPS: Supports certificate-encrypted communication
- Event monitoring:
/yp audit one-click audit, 24h monitoring of which plugins are listening to YuPay's fund events
- Map virtual lock: When a payment QR is placed in the inventory, the player is locked in place, cannot drop/switch items, payment unlocks
⚡ Blazing Fast Startup
The rewritten dependency loading system means YuPay no longer requires cumbersome JVM startup parameters. All dependencies are automatically managed, verification speed increased by 600%, out-of-the-box. Drop it into the plugins folder, start the server, it's ready.
? Data at Your Fingertips
/yp history is one of your most-used commands. Order history supports page browsing, click an order ID to copy it with one click — reconciliation efficiency doubled.
/yp top lets you know at any time who is contributing to the server — leaderboard data syncs with placeholders in real time.
/yp total for personal stats, /yp total all for server-wide stats — all available at your fingertips.
? Two-Minute Quick Start Guide
- Drop
YuPay.jar into the plugins/ folder
- Start the server, wait for
config.yml and messages.yml to generate
- Open
config.yml, fill in your WeChat/Alipay parameters
- Ensure the callback port (default
8080) is open in your server firewall and security group
- In-game, type
/donate 0.01 to test a small payment
- Confirm callback works and rewards arrive — start business ?
? Why Server Owners Are Using YuPay
- ✅ Stable: Production-tested, compatible with Spigot/Paper 1.8 to latest versions
- ✅ Reliable: Direct official API connection, no middlemen, money goes to your account directly
- ✅ Worry-free: From payment to rewards fully automated, you just configure
- ✅ Flexible: Reward logic fully programmable, command aliases freely definable
- ✅ Secure: Signature verification + anti-duplicate + IP whitelist + event monitoring
- ✅ Transparent: Every order, every refund, every code redemption has logs
- ✅ Evolving: Actively maintained, continuously iterated, community-driven
? Plugin QQ Discussion Group: 1080918424
For issues, feature requests, or just to chat — welcome. Every improvement of YuPay comes from feedback from server owners.
? Support the Author on AiFaDian:
If YuPay has helped your server, consider buying the author a milk tea ~ Your support is the biggest motivation for the plugin's continued evolution.
Stop struggling with sponsorship management. Leave the professional stuff to YuPay, and focus on running your server well.
? YuPay Operation Manual
1. Environment Requirements
| Item |
Requirement |
| Server |
Spigot / Paper / compatible forks / compatible hybrid servers, 1.8 – 1.26+ |
| Java |
JDK 8 or higher |
| Optional dependencies |
Vault (economy), PlayerPoints (points), PlaceholderAPI (placeholders), ProtocolLib (map lock) |
? Good news: You no longer need to manually add JVM startup parameters for Java 9+. YuPay's latest version has built-in smart dependency management — out-of-the-box.
2. Installation & Startup
- Download
YuPay.jar, place it in the server's plugins/ directory
- Start the server, the plugin will automatically generate
config.yml, messages.yml, and SQLite database files
- Edit
plugins/YuPay/config.yml, fill in payment channel configuration parameters
- Depending on your payment method, configure callback URLs in the payment platform backend:
- WeChat:
http(s)://your-domain-or-ip:port/pay/wechat/notify
- Alipay:
http(s)://your-domain-or-ip:port/pay/alipay/notify
- Ensure the callback port (default
8080) is open in firewall and security group
- Execute
/yupay reload or type reload in console to apply configuration
- In-game, type
/donate 0.01 to test a small payment
3. Configuration Quick Reference
3.1 Core Payment Parameters
| Path |
Description |
Example |
pay.default-method |
Default payment method |
wechat / alipay |
pay.min-amount |
Minimum amount per order (yuan) |
0.01 |
pay.max-amount |
Maximum amount per order (-1 = unlimited) |
500 |
pay.max-daily-amount |
Daily cumulative limit (-1 = unlimited) |
1000 |
pay.order-subject |
Order subject template |
Sponsorship-{player}-{amount}yuan |
3.2 WeChat Pay Parameters
| Path |
Description |
wechat.enabled |
Enable (true/false) |
wechat.mchid |
Merchant ID |
wechat.appid |
Official account / Mini Program AppID |
wechat.serial-no |
API certificate serial number |
wechat.private-key-path |
Merchant private key (relative to pems/ directory) |
wechat.public-key-path |
Platform public key (relative to pems/ directory) |
wechat.public-key-id |
Platform public key ID |
wechat.api-v3-key |
API v3 key (32 characters) |
wechat.notify-url |
Complete callback notification URL |
3.3 Alipay Parameters
| Path |
Description |
alipay.enabled |
Enable |
alipay.mode |
public_key or cert |
alipay.app-id |
App ID |
alipay.merchant-private-key |
Merchant private key (PKCS8, without headers/footers) |
alipay.alipay-public-key |
Alipay public key (required for public_key mode) |
alipay.app-cert-path |
App public key certificate (cert mode) |
alipay.alipay-cert-path |
Alipay public key certificate (cert mode) |
alipay.alipay-root-cert-path |
Alipay root certificate (cert mode) |
alipay.notify-url |
Async notification URL |
alipay.return-url |
Sync return URL |
3.4 Economy System
| Path |
Description |
economy.enabled |
Enable economy rewards |
economy.type |
vault or playerpoints |
economy.rate |
1 yuan = how many in-game currency/points |
3.5 QR Code Display
| Path |
Description |
qrcode.default-output-mode |
link / text / map |
qrcode.text-qr-size |
Text mode QR side length (characters, default 12) |
qrcode.text-black-char |
Black pixel character (default ██) |
qrcode.api-url |
Image generation API for link mode |
3.6 Callback Server
| Path |
Description |
callback.port |
Listening port |
callback.host |
Bind address (0.0.0.0 = all interfaces) |
callback.io-threads |
IO thread count |
callback.worker-threads |
Worker thread count |
callback.allowed-ips |
IP whitelist (CIDR format, empty = allow all) |
callback.access-log |
Enable access logging |
3.7 Database
| Path |
Description |
database.type |
sqlite (standalone) or mysql (multi-server sync) |
database.mysql.* |
MySQL connection parameters |
database.connection-pool.* |
HikariCP connection pool parameters |
database.table-names.prefix |
Table prefix to avoid conflicts |
database.table-names.* |
Individual business table names (can be customized) |
4. Complete Reward Configuration Guide
4.1 Base Reward (on-success)
Executed on every successful payment — suitable for "base reward every sponsorship".
commands:
on-success:
- "give {player} diamond 1"
- "effect give {player} minecraft:speed 30 1"
Available variables: {player} (player name), {amount} (amount), {points} (economy points earned)
4.2 Single Milestone (on-single-achieved)
Triggered when a single payment reaches a set amount. Sort amounts from low to high, multiple tiers allowed.
commands:
on-single-achieved:
- amount: 50
commands:
- "say {player} reached 50 yuan in a single sponsorship!"
- "give {player} minecraft:gold_block 5"
- amount: 100
commands:
- "give {player} minecraft:diamond_block 3"
- "lp user {player} parent set vip"
4.3 Total Achievement (on-total-achieved)
Triggered when lifetime total reaches a new height. Each tier triggers only once — anti-duplicate mechanism built-in.
commands:
on-total-achieved:
- total: 100
commands:
- "lp user {player} parent set vip"
- total: 1000
commands:
- "lp user {player} parent set ultimate"
- "give {player} minecraft:beacon 1"
4.4 Limited Sprint Reward (on-recent-achieved)
Triggered when cumulative amount within a specified time period (milliseconds) reaches the target. Great for holiday events, weekend leaderboard pushes, etc.
commands:
on-recent-achieved:
- time: 86400000 # 24 hours
total: 200
commands:
- "give {player} minecraft:enchanted_golden_apple 5"
- time: 604800000 # 7 days
total: 500
commands:
- "give {player} minecraft:elytra 1"
4.5 Refund Trigger Commands (on-refund)
Executed after a successful refund — can be used to notify admins, log events.
commands:
on-refund:
- "say {player}'s order {order} has been refunded {amount} yuan"
5. Command System
5.1 Player Commands
| Command |
Function |
Default Aliases |
/donate <amount> [payment] [output] [-n] |
Initiate sponsorship |
/pay, /zanzhu |
/ytop |
Sponsorship leaderboard Top10 |
/paytop, /yt |
/ytotal [player|all] |
Query total sponsorship |
/paytotal, /ytt |
/yp history [page] |
My sponsorship history |
/yupay history |
/yp lang [language] |
Switch personal language preference |
|
/yp code redeem <code> |
Redeem a code |
|
/yp cancel |
Cancel current map payment |
|
? The -n flag means "no-reward sponsorship" — pure server support, no reward commands or economy items triggered.
5.2 Admin Commands
| Command |
Function |
/yp reload |
Hot reload configuration |
/yp set <option> <value> |
Change configuration online |
/yp config |
View current core config |
/yp ban <player|all> [reason] |
Ban from sponsoring (all = global ban) |
/yp unban <player|all> |
Unban |
/yp convert <player> <from> <to> <amount> |
Convert currency (vault/points) |
/yp audit |
Audit all plugins listening to YuPay events |
/yp history <player> [page] |
View any player's order history |
/yp code create ... |
Create a redeem code |
/yp code list [page] |
List codes |
/yp code info <code> |
View code details |
/yp code modify <code> <field> <newvalue> |
Modify code parameters |
/yp code delete <code> |
Disable code (soft delete) |
/yp code logs [code] [page] |
View redemption logs |
/yp refund <order-id> [amount] |
Direct refund |
/yp refund list [page] |
Refund logs |
/yp refund request <order-id> [amount] |
Submit refund review request |
/yp refund pending [page] |
View pending refund requests |
/yp refund approve <request-id> |
Approve request |
/yp refund reject <request-id> |
Reject request |
5.3 Key Permission Nodes
| Permission Node |
Operations |
yupay.command.pay |
Initiate sponsorship |
yupay.command.top |
View leaderboard |
yupay.command.total |
Query total sponsorship |
yupay.command.history |
View order history |
yupay.reload |
Reload config |
yupay.ban |
Manage blacklist |
yupay.convert |
Currency conversion |
yupay.audit |
Event listener audit |
yupay.admin |
Includes all above admin permissions |
6. Redeem Code System In-Depth
6.1 Code Creation Command Details
Code creation uses named parameters in --param value format, freely combinable:
# Free welfare code (unlimited uses, never expires)
/yp code create --code FREEGIFT --max-uses -1 --economy vault --eco-amount 100 --remark "New player gift"
# Paid activation code (pay 50 yuan to redeem, 100 uses, expires after 30 days)
/yp code create --code PREMIUM --amount 50 --economy vault --eco-amount 5000 --max-uses 100 --expire 30d --commands "lp user {player} parent set vip"
# Command-only code (no economy, no payment)
/yp code create --code WELCOME --commands "give {player} diamond 5; say {player} Welcome back!"
Parameter quick reference:
| Parameter |
Description |
Example |
--code |
Code string (auto-uppercase) |
VIP2026 |
--amount |
Required payment amount (0 = free) |
50 |
--economy |
Economy type (vault / playerpoints / none) |
vault |
--eco-amount |
Economy reward amount |
5000 |
--max-uses |
Max redeem count (-1 = unlimited) |
100 |
--expire |
Expiry time (30d / 24h / 2026-12-31 / never) |
30d |
--commands |
Commands to execute on redemption (semicolon-separated) |
"cmd1; cmd2" |
--remark |
Remark description |
"VIP activation code" |
6.2 Code Status Explanation
| Status |
Meaning |
ACTIVE |
Usable |
DEPLETED |
Uses exhausted (automatic) |
EXPIRED |
Expired (automatic) |
DISABLED |
Manually disabled by admin |
6.3 Code PAPI Placeholders
Using code VIP2026 as example:
| Placeholder |
Example Return |
%yupay_code_total% |
Total number of codes |
%yupay_code_active% |
Number of active codes |
%yupay_code_VIP2026_status% |
ACTIVE |
%yupay_code_VIP2026_amount% |
50.00 |
%yupay_code_VIP2026_used% |
23 |
%yupay_code_VIP2026_max_uses% |
100 |
%yupay_code_VIP2026_expire_formatted% |
2026-12-31 23:59 |
%yupay_code_VIP2026_can_redeem% |
true / false |
%yupay_code_VIP2026_locked% |
true / false |
%yupay_code_VIP2026_redeemed% |
Whether current player has redeemed |
7. Refund System In-Depth
7.1 Refund Method Comparison
| Method |
Command Example |
Use Case |
| Direct refund |
/yp refund ORDER001 50 |
Confirmed refund needed, quick processing |
| Forced refund |
/yp refund ORDER001 50 -f |
Skip amount check, refund directly |
| Partial refund |
/yp refund ORDER001 30 |
Refund part of the amount |
| Approval workflow |
/yp refund request ORDER001 → wait for approve |
Scenarios requiring approval |
| Code refund |
/yp refund -r <redemption-log-id> |
Refund code payment + restore usage count |
7.2 Refund Approval Workflow
- Player or admin submits refund request:
/yp refund request <order-id> [amount]
- Admin views pending list:
/yp refund pending
- Approve or reject:
/yp refund approve <request-id> / reject
- Upon approval, actual refund automatically executes; upon rejection, requester is notified
7.3 What Happens After Refund
- Payment platform (WeChat/Alipay) receives refund request, money returns to original payment method
- Plugin updates order refund status (
FULL_REFUND / PARTIAL_REFUND)
- If code refund: code usage count -1, status restored to
ACTIVE
- Executes commands configured in
commands.on-refund
- Triggers
RefundCompletedEvent for other plugins to react
- Complete refund logs written to database
8. Multi-Language System
8.1 Adding a Language
Add under language.mappings node in config.yml:
language:
mappings:
zh_cn:
file: "messages.yml"
aliases: [zh, cn, chinese]
client-locales: ["zh_cn", "zh_*"]
en:
file: "messages_en.yml"
aliases: [english, eng]
client-locales: ["en_*"]
ja:
file: "messages_ja.yml"
aliases: [japanese, jp]
client-locales: ["ja_*"]
Then create plugins/YuPay/messages_ja.yml, translating based on messages.yml. Plugin will automatically fill in missing keys.
8.2 Switching Language
- Players switch manually:
/yp lang en (supports aliases, e.g. english)
- First join auto-detects client language and matches best translation
- Language preference stored in database, remembered across sessions
9. Database Selection Guide
| Server Scale |
Recommended Type |
Reason |
| Single small server |
SQLite |
Zero configuration, out-of-the-box |
| Multi-server network |
MySQL |
Unified data, cross-server sync |
| Large network |
MySQL + connection pool |
High concurrency support, connection reuse |
10. Troubleshooting Common Issues
Callback server fails to start
- Check if port is occupied
- Confirm firewall/security group has opened the port
- Check console error logs
Payment successful but rewards not received
- Check order
status in database — should be SUCCESS
- Confirm
economy.enabled and commands.enabled are both true
- Check console for economy plugin load errors
Map QR code not showing
- Confirm ProtocolLib matching server version is installed
- Check if
qrcode.default-output-mode is set to map
- If ProtocolLib missing, mode auto-falls back to
link
WeChat Pay says public key file not found
- Check existence of
plugins/YuPay/pems/ directory
- Confirm
wechat.public-key-path is correct
- Go to WeChat Merchant Platform → API Security → API Certificates → download platform certificate
Configuration lost after plugin upgrade
- YuPay has built-in smart config upgrader — automatically backs up old file (
.bak suffix) and merges new keys
- Manual backup before upgrade for extra peace of mind
11. Database Tables
| Table Name |
Stored Content |
yu_payments |
All payment orders, including refund status |
yu_total_levels |
Cumulative reward tier records |
yu_banned_players |
Sponsorship blacklist |
yu_player_lang |
Player language preferences |
yu_redeem_codes |
Redeem code master table |
yu_redeem_logs |
Redemption records |
yu_refund_logs |
Refund operation logs |
yu_refund_requests |
Refund review requests |
12. Uninstallation Steps
- Execute
/yp reload (ensure in-memory config is flushed)
- Stop the server
- Delete
plugins/YuPay.jar
- For complete removal, delete
plugins/YuPay folder (including database)
? Plugin Discussion Group: 1080918424
Don't struggle alone — bring your logs and config screenshots to the group, the author and helpful server owners are there.
? Support the Author on AiFaDian:
If YuPay has helped your server, consider buying the author a milk tea ~ Your support is the biggest motivation for the plugin's continued evolution.
评论 0
登录后参与评分
还没有评论,来抢沙发吧