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
ort/pay/wechat/notify
- Alipay: http(s)://your-domain-or-ip
ort/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 (Text):
[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
[SIZE=4][B]5.3 Key Permission Nodes[/B][/SIZE]
[B]Permission Node[/B] [B]Operations[/B]
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
[SIZE=5][B]6. Redeem Code System In-Depth[/B][/SIZE]
[SIZE=4][B]6.1 Code Creation Command Details[/B][/SIZE]
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:
[B]Parameter[/B] [B]Description[/B] [B]Example[/B]
--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"
[SIZE=4][B]6.2 Code Status Explanation[/B][/SIZE]
[B]Status[/B] [B]Meaning[/B]
ACTIVE Usable
DEPLETED Uses exhausted (automatic)
EXPIRED Expired (automatic)
DISABLED Manually disabled by admin
[SIZE=4][B]6.3 Code PAPI Placeholders[/B][/SIZE]
Using code VIP2026 as example:
[B]Placeholder[/B] [B]Example Return[/B]
%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
[SIZE=5][B]7. Refund System In-Depth[/B][/SIZE]
[SIZE=4][B]7.1 Refund Method Comparison[/B][/SIZE]
[B]Method[/B] [B]Command Example[/B] [B]Use Case[/B]
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
[SIZE=4][B]7.2 Refund Approval Workflow[/B][/SIZE]
[LIST=1]
[*]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
[/LIST]
[SIZE=4][B]7.3 What Happens After Refund[/B][/SIZE]
[LIST]
[*]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
[/LIST]
[SIZE=5][B]8. Multi-Language System[/B][/SIZE]
[SIZE=4][B]8.1 Adding a Language[/B][/SIZE]
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.
[SIZE=4][B]8.2 Switching Language[/B][/SIZE]
[LIST]
[*]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
[/LIST]
[SIZE=5][B]9. Database Selection Guide[/B][/SIZE]
[B]Server Scale[/B] [B]Recommended Type[/B] [B]Reason[/B]
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
[SIZE=5][B]10. Troubleshooting Common Issues[/B][/SIZE]
[SIZE=4][B]Callback server fails to start[/B][/SIZE]
[LIST]
[*]Check if port is occupied
[*]Confirm firewall/security group has opened the port
[*]Check console error logs
[/LIST]
[SIZE=4][B]Payment successful but rewards not received[/B][/SIZE]
[LIST]
[*]Check order status in database — should be SUCCESS
[*]Confirm economy.enabled and commands.enabled are both true
[*]Check console for economy plugin load errors
[/LIST]
[SIZE=4][B]Map QR code not showing[/B][/SIZE]
[LIST]
[*]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
[/LIST]
[SIZE=4][B]WeChat Pay says public key file not found[/B][/SIZE]
[LIST]
[*]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
[/LIST]
[SIZE=4][B]Configuration lost after plugin upgrade[/B][/SIZE]
[LIST]
[*]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
[/LIST]
[SIZE=5][B]11. Database Tables[/B][/SIZE]
[B]Table Name[/B] [B]Stored Content[/B]
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
[SIZE=5][B]12. Uninstallation Steps[/B][/SIZE]
[LIST=1]
[*]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)
[/LIST]
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: [URL]https://ifdian.net/item/012b6c1c4a0911f18d1b52540025c377[/URL]
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.