1.2.2.0
Compatibility
Changes
YuPay Release Notes ยท v1.2.2.0-SNAPSHOT
Callback Server Upgrade
The builtโin HTTP callback server has been replaced from the JDKโs com.sun.net.httpserver to Undertow 2.3.18.Final.
Undertow is a productionโgrade HTTP server from the JBoss/WildFly project, widely used in enterprise Java applications. For plugin users, the most noticeable changes are:
- Callback notifications are no longer queued or blocked when the server is busy โ responses to WeChat Pay / Alipay notifications become more timely.
- A request body size limit (default 64 KB) is added; abnormal requests are rejected directly, saving server resources.
- An optional IP whitelist is added โ when configured, only requests from the official WeChat/Alipay servers can reach the callback endpoint.
- When the plugin stops, the callback server waits for inโflight requests to finish before shutting down, so ongoing order confirmations are not interrupted.
First Launch Instructions
Undertow and its dependencies are not bundled inside the plugin JAR. They will be automatically downloaded from Maven Central and cached in plugins/YuPay/libs/ when the server starts for the first time.
On first launch you will see log messages similar to the following โ this is normal:
[LibraryLoader] Downloading: undertow-core-2.3.18.Final.jar โ https://repo1.maven.org/maven2/...
[LibraryLoader] โ Download completed: undertow-core-2.3.18.Final.jar (xxx KB)
[LibraryLoader] โ Verification passed (newly downloaded): undertow-core-2.3.18.Final.jar
After the download completes, subsequent startups use the cached files without requiring an internet connection.
Note: The server must be able to access repo1.maven.org on first launch. Please ensure network connectivity.
New Configuration Options in config.yml
The following optional fields have been added under the existing callback: node. If omitted, the default values (shown in parentheses) will be used:
callback:
port: 8080
host: "0.0.0.0"
# Threading model
io-threads: 2 # Number of IO threads โ recommended not to exceed CPU cores (default 2)
worker-threads: 8 # Number of worker threads for business processing (default 8)
# Timeouts (milliseconds)
read-timeout-ms: 10000
write-timeout-ms: 10000
# Security
max-body-size: 65536 # Maximum request body size in bytes (default 64 KB)
allowed-ips: [] # IP whitelist โ leave empty to disable
# Debugging
access-log: false # When enabled, logs every callback to the console
# Shutdown behavior
shutdown-grace-ms: 3000 # Grace period for graceful shutdown (milliseconds)
Old configuration files do not need to be modified manually. Any unspecified fields will fall back to the defaults, and the plugin can be updated without issues.
Other Fixes
- Fixed an issue where cumulative sponsorship tier records were not saved when using SQLite. The original code used MySQLโspecific
ON DUPLICATE KEY UPDATEsyntax, which caused errors on SQLite and resulted in lost tier records. The plugin now automatically selects the correct syntax based on the database type. - Fixed a missing app_id consistency check for Alipay callbacks. The plugin now verifies that the
app_idin the callback matches the one configured. - Added a timestamp replay attack prevention check for WeChat Pay callbacks. Callbacks with a timestamp older than 5 minutes are rejected.
If you encounter any issues after the upgrade, please feel free to join our QQ group 1080918424 for feedback.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:ND76NcgJ:iIx9xs5b"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:ND76NcgJ:iIx9xs5b"
}

